Category Archives: Linux

[SOLVED] Blank dark screen after installing ATI Proprietary Drivers (fglrx) in Ubuntu 11.04 Natty Narwhal

Having video and sound issues with Fedora 15, I decided to try out Natty on my HP Pavilion G4 1009tx. Surprisingly, sound and 3D effects ran great with Intel onboard graphics so I installed it onto the Hard drive. In all excitement, I decided to try out proprietary ATI drivers for the switchable dedicated AMD Radeon HD 6470M graphics. However, when I rebooted, it would not boot. It seems that plymouth crashes and system ends up with a black screen. So, I decided to remove fglrx and keep on using Intel card but it seems that I can’t even boot into recovery mode. So, I had to remove fglrx and make the system usable again using the Live CD and chroot. Here is how I did it.

Note: If you are trying to get the fglrx to work, you should look somewhere else. I just removed fglrx and decided not to use it (for now at least).

First, I booted into the Live Ubuntu Desktop. Then, I opened the terminal and created a directory for mounting everything:

sudo mkdir /mnt/root

Then I mounted the root partition.

sudo mount /dev/sda7 /mnt/root

Please note that my installation’s root partition is /dev/sda7. In your case, it can be something else. Since I have a separate home partition (/dev/sda8), I mounted it too, just in case. You can skip this if you don’t have a dedicated home partition.

sudo mount /dev/sda8 /mnt/root/home

You should also mount other drives if you have dedicated partitions for other directories (for /boot perhaps?).

Then, I mounted other required directories.

sudo mount -o bind /dev /mnt/root/dev
sudo mount -o bind /proc /mnt/root/proc
sudo mount -o bind /sys /mnt/root/sys

Then, I chrooted to the mounted root:

sudo chroot /mnt/root

Now, I got into the root of my installed Ubuntu. Then I just had to run the following to remove fglrx:

apt-get remove fglrx

UPDATE 1:
(ignore this, see UPDATE 2 below)
After upgrading xserver-xorg-video-all, xserver-xorg-video-ati and xserver-xorg-video-radeon, the screen went blank again after reboot. So, I had to downgrade the packages by downloading from repos. Here is how you can do it too (I have included the packages in an archive, please note that you need an active Internet connection for the following):

dhclient
cd /tmp
wget http://www.khattam.info/wp-content/uploads/xserver-ati-old.tar.gz
tar xzvf xserver-ati-old.tar.gz
dpkg -i xserver-xorg-video-radeon_6.14.0-0ubuntu4_i386.deb xserver-xorg-video-ati_6.14.0-0ubuntu4_i386.deb xserver-xorg-video-all_1%3a7.6+4ubuntu3_i386.deb

UPDATE 2:
This blank screen issue would still reappear once in a while and the laptop would get very hot over prolonged usage, so I decided to go for a slightly different solution. I removedxserver-xorg-video-radeon and xserver-xorg-video-ati, blacklisted the radeon module and disabled it via vgaswitcheroo. Here is how I did it:
Remove ATI Radeon drivers:

apt-get remove xserver-xorg-video-ati xserver-xorg-video-radeon

Blacklist kernel module:
To disable kernel module, I opened the file /etc/modeprobe.d/blacklist.conf and add a line ‘blacklist radeon’. You can use nano to do this:

nano /etc/modprobe.d/blacklist.conf

Ctrl+O to save and Ctrl+X to exit nano.
Re-enable kernel module after startup and switch the card off:
To do this, I just added two lines before the line ‘exit 0’ in /etc/rc.local (you can use nano for this too) so that the file looks like the following:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

modprobe radeon
chown USERNAME /sys/kernel/debug/vgaswitcheroo/switch
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

exit 0

In the file above, USERNAME is my login username. Don’t forget to replace USERNAME with your username before saving the file. (If you are not sure what your username is, just do this: ls /home/, you should see it in the name of the directory.)

When done, I just exited from the chrooted environment:

exit

Then, I unmounted everything:

sudo umount -a

(You’ll see some error messages, like device is busy, just ignore them)

Now, I am able to boot into the installed Ubuntu again. Hope this helps.

[SOLVED] Booting up stuck at “Starting Wait for Plymouth Boot Screen to Quit” after ATI Driver Installation

I installed Fedora 15 on HP Pavilion G4 1009tx Notebook recently. It has Intel Onboard Graphics and ATI Radeon HD 6470M Graphics 1024MB GDDR3, with switching option in Windows. However, it was disappointing to see that Gnome-Shell does not load on it while used to run fine on my old Desktop with onboard Intel Graphics. I tried to install ATI Properiatary drivers from RPM Fusion repos. However, after reboot, the booting process halted after showing the following:

Starting SYSV: Enable monthly update of Smolt...

Started SYSV: Enable monthly update of Smolt.

Starting SYSV: Grant or revoke access to X for the ATI External Events Daemon...

Started SYSV: Grant or revoke access to X for the ATI External Events Daemon.

Starting SYSV: Late init script for live image....

Starting /etc/rc.local Compatibility...

Started SYSV: Late init script for live image..

Started /etc/rc.local Compatibility.

Starting Wait for Plymouth Boot Screen to Quit...

I discovered that I could still navigate to virtual terminals by pressing Ctrl+Alt+F2, F3 and so on. So, I decided to remove the catalyst drivers so that I could boot into my PC again. I logged in as root and ran the following to show the latest installed packages:

cat /var/www/yum.log

The most recently installed were the packages related to ATI drivers:

Aug 31 02:29:01 Installed: xorg-x11-drv-catalyst-libs-11.7-1.fc15.x86_64
Aug 31 02:29:08 Installed: xorg-x11-drv-catalyst-11.7-1.fc15.x86_64
Aug 31 02:29:08 Installed: akmod-catalyst-11.7-1.fc15.x86_64
Aug 31 02:29:10 Installed: xorg-x11-drv-catalyst-libs-11.7-1.fc15.i686

So, to remove I typed the following:

yum remove xorg-x11-drv-catalyst

Then, I rebooted the PC with the reboot command. Now, the Laptop boots successfully but still has no 3D graphics. I guess I will have to stay with the boring Gnome 3 fallback interface unless I figure something else out. 🙁

[HOWTO] Install Wireless support for Fedora 15 in HP Pavilion G Series (G4) Notebook

To install Wireless driver for HP Pavilion G4, I followed the instructions here. Basically, I just connected it to the internet using a cable and here is what I did in the terminal (System Tools>Terminal):

su #enter password when prompted
sudo yum localinstall --nogpgcheck http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
yum install akmod-wl
akmods --akmod wl
modprobe wl

Then, I disconnected the cable and reboot and the Wifi started working. Hope this helps.

Hope this helps.

[HOWTO] Install Sun/Oracle Java JDK 7 in Fedora 15

Sun/Oracle Java JDK 7 may be required to run some applications that are not compatible with OpenJDK which can be installed using package manager in Fedora 15. Here is how to do it. Open the terminal and use the following commands:

For 64-bit

wget "http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.rpm"
su -c 'rpm -i jdk-7-linux-x64.rpm'

For 32-bit

wget "http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-i586.rpm"
su -c 'rpm -i jdk-7-linux-i586.rpm'

If you already have OpenJDK/OpenJRE installed, you will need to configure your system so that the applications use the Sun/Oracle Java version instead of OpenJDK/OpenJRE. Here is how to do it:

su -c 'alternatives --install /usr/bin/java java /usr/java/jdk1.7.0/jre/bin/java 20000'
su -c 'alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.7.0/jre/bin/javaws 20000'
su -c 'alternatives --install /usr/bin/javac javac /usr/java/jdk1.7.0/bin/javac 20000'
su -c 'alternatives --install /usr/bin/jar jar /usr/java/jdk1.7.0/bin/jar 20000'

For 64-bit:

su -c 'alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/jdk1.7.0/jre/lib/amd64/libnpjp2.so 20000'

For 32-bit:

su -c 'alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/jdk1.7.0/jre/lib/i386/libnpjp2.so 20000'

Hope this helps.

[SOLVED] Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0

While trying to run a single-file php script in my Fedora 15 installation, I got a very strange error:

Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0

Fatal error: Unknown: Failed opening required ‘/var/www/html/test/filename.php’ (include_path=’.:/usr/share/pear:/usr/share/php’) in Unknown on line 0

To get rid of this error, right click and go to Properties. Then, in Permissions, make sure it is readable by other users and it has a SELinux context httpd_user_content_t. That should do it.

[SOLVED] “[[WARNING]] The posix_isatty() is available: FAILED *** Install and enable the php_posix extension (used to colorized the CLI output) ***”

I ran the Symfony PHP Framework configuration check script in Fedora 15 and got the following error:

[[WARNING]] The posix_isatty() is available: FAILED
*** Install and enable the php_posix extension (used to colorized the CLI output) ***

To enable this extension, you should install php-process from Add/Remove Software or using yum.

su -c 'yum install php-process'

Run the check_configuration.php again and you should not see this warning again.

UPDATE: If you also see the following:

[[WARNING]] A PHP accelerator is installed: FAILED
*** Install a PHP accelerator like APC (highly recommended) ***

and want to have a PHP accelerator, you can install php-pecl-apc:

su -c 'yum install php-pecl-apc'

[HOWTO] Compile Facebook hiphop-php in Fedora 15

HipHop for PHP is a source code transformer which transforms PHP code to C++ and compiles it with gcc/g++. I wanted to experiment with it and tried to install in on my PC with Fedora 15. Here is how I did it and how you can do it ( hopefully 🙂 ). Please note that this did not work and I will update the article soon.

Install Dependencies Available in the Repos
In the terminal, run the following command:

su -c 'yum -y install git cmake boost pcre-devel libicu-devel libmcrypt-devel oniguruma-devel mysql-devel gd-devel boost-devel libxml2-devel libcap-devel binutils-devel flex bison expat-devel re2c tbb libmemcached-devel tbb-devel bzip2-devel openldap-devel readline-devel libc-client-devel pam-devel gcc-c++ memcached'

Setup build environment
I compiled it in dev folder of home directory. Change directory in subsequent commands if you are doing it somewhere else. Run the following commands:

cd
mkdir -p dev/local

Download hiphop-php

cd
cd dev
git clone git://github.com/facebook/hiphop-php.git

Download, patch and compile libcurl and libevent
Use these versions because as of current, patches for these versions are only available in hiphop git.

cd
cd dev

wget http://curl.haxx.se/download/curl-7.20.0.tar.bz2
wget http://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz
tar xvzf libevent-1.4.13-stable.tar.gz
tar xvjf curl-7.20.0.tar.bz2

export CMAKE_PREFIX_PATH=`pwd`/local

cd libevent-1.4.13-stable
cp ../hiphop-php/src/third_party/libevent-1.4.13.fb-changes.diff .
patch < libevent-1.4.13.fb-changes.diff
./configure --prefix=`pwd`/../local
make install
cd ..

cd curl-7.20.0
cp ../hiphop-php/src/third_party/libcurl.fb-changes.diff .
patch -p0 < libcurl.fb-changes.diff #see note-1 below

Note-1: While patching curl, you may be asked paths to the files. Enter includes/curl/multi.h and lib/multi.c respectively.

Now, you will need to make a small change in Makefile for it to compile properly. To do that open the file src/Makefile in gedit or any text editor, find the line that has the following:

curl_LDADD = $(top_builddir)/lib/libcurl.la -lz

and append -lrt so that the line looks like the following:

curl_LDADD = $(top_builddir)/lib/libcurl.la -lz -lrt

Now, run the following in the terminal:

cd
cd dev/curl-7.20.0
./configure --prefix=`pwd`/../local
make install
cd ..

Compile hiphop-php

cd
cd dev
export CMAKE_PREFIX_PATH=`pwd`/local
cd hiphop-php
git submodule init
git submodule update
export HPHP_HOME=`pwd`
export HPHP_LIB=`pwd`/bin
cmake . #see note-2 below
make #see note-3 below

Note-2: You may get errors while running cmake. This may be because of dependencies I might have missed above. In that case, please let me know the output of cmake in the comments so that I might be able to help.
Note-3: If you encounter any errors while using make, remove CMakeCache.txt and run make clean, cmake and make again.

This should have worked, but I am getting the following error:

../../bin/libhphp_runtime.a(ext_mysql.cpp.o): In function `HPHP::php_mysql_do_query_general(HPHP::String const&, HPHP::Variant const&, bool)':
ext_mysql.cpp:(.text+0x8100): undefined reference to `cli_safe_read'
ext_mysql.cpp:(.text+0x826a): undefined reference to `net_field_length'
ext_mysql.cpp:(.text+0x83a0): undefined reference to `cli_safe_read'
ext_mysql.cpp:(.text+0x8712): undefined reference to `free_root'
collect2: ld returned 1 exit status
make[2]: *** [src/hphp/hphp] Error 1
make[1]: *** [src/hphp/CMakeFiles/hphp.dir/all] Error 2
make: *** [all] Error 2

It seems like a problem with mysql version in the Fedora repo. I will download and build mysql and update this post.

Further Reading
https://github.com/facebook/hiphop-php/wiki/running-hiphop

References
https://github.com/facebook/hiphop-php
http://www.ioncannon.net/programming/918/building-hiphop-php-for-fedora-12-on-64-bit-and-32-bit-systems/
http://comments.gmane.org/gmane.comp.web.curl.library/29278

[SOLVED] No package ‘gtk+-3.0’ found

If you are trying to compile a gtk-3 application and if you don’t have development package installed here is the error you can get:

configure: error: Package requirements (gtk+-3.0 >= 3.0.0) were not met:

No package ‘gtk+-3.0’ found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GTK_CFLAGS
and GTK_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

If you encounter this error in Fedora, you should install gtk3-devel. In terminal, type in the following:

su -c 'yum install gtk3-devel'

If you encounter this in Ubuntu, you should install libgtk-3-dev. To do so, type in the following in terminal:

sudo apt-get install libgtk-3-dev

Hope this helps.

[HOWTO] Install GPaste in Fedora 15

GPaste is a clipboard management tool for GNOME 3. It is not available in the repos and must be downloaded via git and compiled. Here is how you can do it:

UPDATE:
GPaste is now available in the repos, so you can install it by using Add/Remove Programs or by running the following commands in the terminal:

su
yum install gpaste

That should install GPaste. The following post is for historical reasons only.


Install Git

su -c 'yum install git'

Download GPaste sources

cd; git clone https://github.com/Keruspe/GPaste.git

Install Dependencies

su -c 'yum install gtk3-devel glib2-devel intltool automake autoconf vala'

Compile and Install

cd;cd GPaste
./autogen.bash
./configure --prefix=/usr
make
su -c 'make install'

Restart GNOME Shell
To restart, press Alt+F2, enter ‘r’ (without quotes) and press enter.

You should now see GPaste icon in the top panel.