Sunday, February 20, 2011

Build a file from source

Sometimes you need to build a file from source, and simply can't rely on aptitude or Ubuntu Software Center for the obscure program you need.  Here's how to do it.

First of all you need to make sure you have what you need installed.  Sometimes, if you're getting errors, you may want to run this simple command:
sudo apt-get install openssl
I can't quite remember what I was trying to install but I found that after i installed that the program built from source.

Anyway, after we do that (or if we don't need that step alltogether) we may need to unpack the file. If it is, in fact, a .tar.gz file then we can just extract it from command line nice and easy:
tar xvzf filename.tar.gz
Of course replace "filename" with the name or path to the file.

After that we need to bring our command line to the directory that we need.  Remember, navigate using "cd nextfolder/" to change directories.  Once you're in the newly created folder (you remember that unpacking the archive created another folder in that directory with the same name as the archive, right?) run these two commands:
make install
After that just run the program by it's name.  If you just installed a program named bob123, then just type "bob123" (no quotes) in the command line.

No comments:

Post a Comment