How to compile from sources in Ubuntu or DebianFollow @ggarron
There are times when you need to compile software from sources, maybe because you need to compile the package with some specific option that is not enabled in the default package.
Do that in Debian is really easy.
Compile software from sources in Debian
Fetch the dependencies
The first thing you need, is to be sure that your Linux has all dependencies installed, so run:
apt-get build-dep htop
htop as the example in this article.
Now we have all dependencies solved.
Get the sources of the package
Continuing with our example, run:
You may want to change to
tmp folder, as in that folder the sources will be downloaded. Then get the sources
apt-get source htop
Then enter into the folder of the sources, in our case.
Then you are ready to change the default options, if you need to do it.
Compile the software
dpkg-buildpackage -uc -b
Install the package into your Debian or Ubuntu Linux
dpkg -i ../htop_0.7-1_i386.deb
Please be sure to have a source repository in your
This is the minimum needed:
deb http://mirrors.kernel.org/debian/ stable main deb-src http://mirrors.kernel.org/debian/ stable main deb http://security.debian.org/ stable/updates main contrib
You can also use this other option to compile the software.
apt-get --build source htop
Update, 12/17/10: I did not realized that my friend Raphael Hertzog has already covered this just one day before I did. You may want to check his version for more tips and options