Home page of this blog

Tuesday, February 22, 2011

Installing latest nvidia driver in Ubuntu Lucid using APT Pinning

Disclaimer: This is a risky upgrade technique, follow only if you love to take risks and enjoy the benefit of risks. If it fails, you may have to reinstall the entire operating system


Introduction

In this experiment I will try to explain, how I used apt pinning to install latest nvidia drivers from Ubuntu Natty inside Ubuntu Lucid. I wanted to use X Updates PPA but unfortunately, it is always pulling the beta versions of nvidia drivers (270.x when I last saw)

This apt pinning will use the debian trick of pinning upcoming versions of the distribution to pull the packages which we like

see the following links

http://wiki.debian.org/AptPreferences
http://www.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html


Initial steps

Install the restricted nvidia drivers in lucid using Hardware drivers tool. This step is most important. By default Ubuntu Lucid will offer to install 195.36.x version of nvidia drivers. After installing this nvidia drivers, ensure Ubuntu works fine, that is we are able to boot into graphical mode

Addding entry for packages of natty in /etc/apt/sources.list


In the last line of /etc/apt/sources.list add entry to natty mirror.

To open the sources.list in editable mode, open it as root

sudo vi /etc/apt/sources.list


move to the last line and append

deb http://in.archive.ubuntu.com/ubuntu/ natty main restricted universe multiverse

As you can see, I have given in.archive.com as Ubuntu points to Indian mirror in my system. You should change it to appropriate mirror of your region for blazing fast updates

Very important, do not run apt-get update after this step, there is an even more important step, which is giving low priority to natty packages in Lucid installation, which is explained in following

APT Pinning natty packages with lower priority


Create a new file  /etc/apt/preferences as root

To do that I am using, sudo vi /etc/apt/preferences


and add the following three lines (If already you have a preferences file, do not worry, just append these three lines for giving natty packages a priority compared to current distribution packages)


Package: *
Pin: release a=natty
Pin-Priority: 400


First line Package: * tells apt to treat all packages, which is meant by asterik *
Second line tells the release name which we want to pin
Third line gives a priority value of 400 for all natty packages. Default priority is 500 and giving 400 to natty makes sure update manager does not inadvertently update to natty packages

Now after saving this file, run apt-get update


sudo apt-get update



You should not be offered to dist upgrade or upgrade to natty packages. If you are being offered lots of updates or offered to do dist upgrade, remove the entry for natty from /etc/apt/sources.list (the last line we added in /etc/apt/sources.list) and re run apt-get update to avoid inadvertent upgrade

Use Synaptic or APT to upgrade packages selectively to natty


This step can be achieved via a single apt-get or via synaptic, I try to explain both


Via synaptic


This step is tricky when using synaptic because many packages can't be upgraded to natty as is due to nested dependencies. For nvidia the most important package to be upgraded is nvidia-current and libvdpau1


Search and select nvidia-current in synaptic and press Ctrl + E and select the version from natty, 


see the screenshot to understand when I meant






Repeat this selective upgrade for libvdpau1, nvidia-185-kernel-source and nvidia-185-libvdpau


Press apply and synaptic will take care of upgrading the selected package to versions to natty

Via apt-get


This step is easier via apt-get

sudo apt-get install -t natty nvidia-185-kernel-source nvidia-185-libvdpau nvidia-current libvdpau1


See the -t natty which specifies apt-get to look for the packages from natty distribution

If suppose apt-get asks you to upgrade lots of packages, do not do, it might be a full upgrade to natty, just stop as is and recheck preferences file

Reboot

Now reboot to see if the nvidia card is upgraded to the version of natty

See the screenshots below which shows my nvidia-settings showing the latest nvidia versions running from natty inside lucid



System monitor  + nvidia settings screenshot, which shows I am running lucid but latest nvidia drivers!!


Tuesday, February 8, 2011

Debian squeeze live images

Official debian.org site download does not advertise or highlight the live images of debian live CD

They can be downloaded from

http://live.debian.net/




For e.g, if I wanted to try amd64 version of debian live, I can download from, iso hybrid folder under amd64. The advantage of iso-hybrid image is the downloaded iso can be written to a DVD or a pendrive!!

http://cdimage.debian.org/cdimage/release/current-live/amd64/iso-hybrid/

Let us say I download gnome version of live cd

http://cdimage.debian.org/cdimage/release/current-live/amd64/iso-hybrid/debian-live-6.0.0-amd64-gnome-desktop.iso

I can write the iso image to a DVD or via USB

For making usb bootable, need to use dd command as root. Say my pendrive is mounted in /dev/sdd1, first I need to unmount using


sudo umount /dev/sdd1

and can write the hybrid bootable iso image using the following command

sudo dd if=debian-live-6.0.0-amd64-gnome-desktop.iso of=/dev/sdd bs=4M


Thought this info might help someone who wants to try live image of debian

Sunday, February 6, 2011

Alsa 1.0.24 in Ubuntu 10.10

Disclaimer: Build, Install the sources at your own risk. Your system may become unusable unless you reinstall fresh in case you failed this step. I tried this risk thinking of installing debian squeeze in case I unset my running Ubuntu audio, fortunately it worked!


Introduction

I read about the release of alsa 1.0.24 bringing better audio to linux. And as usual it made me restless and I downloaded the source, built it. Now I am running 1.0.24

I followed this blog which taught how to upgrade to 1.0.23 and I modified it for 1.0.24

Here are the steps which I followed to get 1.0.24

Stop running alsa driver


sudo /sbin/alsa-utils stop



Install compilation dependencies

sudo apt-get install gettext xmlto --no-install-recommends

sudo apt-get install build-essential libncurses5-dev libncursesw5-dev linux-headers-`uname -r`

Remove pulse configuration

rm -rf ~/.pulse*

Make a directory to build new Alsa sources

cd ~
mkdir -p Alsa
cd Alsa

Download source tarballs of Alsa driver, lib and utils

wget ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.24.tar.bz2
wget ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.0.24.1.tar.bz2
wget ftp://ftp.alsa-project.org/pub/utils/alsa-utils-1.0.24.2.tar.bz2

Extract source tarballs

tar xjvf alsa-driver-1.0.24.tar.bz2
tar xjvf alsa-lib-1.0.24.1.tar.bz2
tar xjvf alsa-utils-1.0.24.2.tar.bz2

Build alsa-driver

cd alsa-driver-1.0.24/
./configure
make
sudo make install

Build alsa-lib

cd ../alsa-lib-1.0.24.1/
./configure
make
sudo make install

Build alsa-utils

cd ../alsa-utils-1.0.24.2/
sudo ln -s libpanelw.so.5 /usr/lib/libpanelw.so
sudo ln -s libformw.so.5 /usr/lib/libformw.so
sudo ln -s libmenuw.so.5 /usr/lib/libmenuw.so
sudo ln -s libncursesw.so.5 /lib/libncursesw.so


./configure
make
sudo make install

Reboot

sync
sudo reboot

Test the version

cat /proc/asound/version





Conclusion

Audio geeks and multimedia gurus can tell if the audio quality is really improved. To my ears there seems to be an improvement, that I can hear individual beats while playing music in my 2 in 1 speakers. Not sure if it is a placebo effect or real improvement


Note: If sound does not start automatically, run the following to start

sudo /sbin/alsa-utils start