Building packages from sources using Debian/Ubuntu

Sometimes you want to install latest version of selected software package while keeping base system stable. Then installing from source is a safe option to proceed.

First, you have to include sources from fresh system version, below is example taken from Ubuntu, I selected natty (/etc/apt/sources.list):

deb-src http://pl.archive.ubuntu.com/ubuntu/ natty main restricted

Then you should refresh package list:

sudo apt-get update

and install dependencies:

sudo apt-get build-dep ccache

and finally build the new version of a package (note that no root account is needed for that step):

apt-get -b source ccache

As a result there's a *.deb package, install it:

sudo dpkg -i ccache*.deb

That's all!

This entry was posted in en and tagged , . Bookmark the permalink.