Skip to main content
Welcome guest. | Register | Login | Post

installing from source

This was written as a reply to a question, but I figured it didn't answer the question... It's a useful explanation though...

Compiling source usually goes like this:

(optional) verify the download is error-free:
md5sum blah.tgz
compare the result to a file that usually is named MD5SUMS, which can be downloaded in the same place as the archive.

unpack the archive:
tar xvzf blah.tgz
or
tar xvzf blah.tar.gz
or
tar xvjf blah.tar.bz2
note the j instead of z in the last one

go into the directory that was created, usually:
cd blah

(usually, but not always) configure the source code:
./configure
or if you have special wishes:
./configure --help | less
./configure --option-you-just-read-about --another-option

compile:
make

if the compilation was successful (if it wasn't, that will be obvious by the last few lines before the return or the prompt), install:

sudo make install

Note not all packages can do make uninstall, and you can't use the package manager to uninstall software that was installed this way. Often it's a good idea to give ./configure the option --prefix=/opt/blah , so you can uninstall by deleting the directory /opt/blah . The downside is that software installed in /opt may not show up in menus.

Comments

Nice writeup.Another thing

Nice writeup.

Another thing I like to use when compiling from source on a distro that has either of the RPM, APT or TGZ package management is use checkinstall instead of the last make install step in order to create a package for that distro and then install from that package. Then it is easily managed by the given distro's package manager making uninstalling easier.

I've written a tip on that earlier in the old tips thread: http://www.nuxified.org/topic/tip_collection#comment-809

Edit: For those who may be wondering, checkinstall is available in Ubuntu repositories (universe I think) and should probably be available in other popular Debian-based and RPM-based distros. There is a Slackware TGZ package for it as well. So, you don't need to compile checkinstall itself before being able to use it for compiling other stuff you would be installing with it.

sudo make install only

sudo make install only works on distroes with sudo. If it doesn't, use su -c 'make install'.

sudon't

free-zombie wrote:

sudo make install only works on distroes with sudo. If it doesn't, use su -c 'make install'.

... and it won't work on my computer, because I configured sudo to accept only a few commands, and make install is not one of them. I was trying to answer an ubuntu question...

Comment viewing options