g Text Version
Beauty & Self
Books & Music
Food & Wine
Health & Fitness
Hobbies & Crafts
Home & Garden
News & Politics
Religion & Spirituality
Travel & Culture
TV & Movies

Bored? Games!
Take a Quiz
Rate My Photo

Autism Spectrum Disorders
Mental Health
Blogs / Social Networking
Kidney Disease
Today in History

All times in EST

Full Schedule
g Computer Careers Site

BellaOnline's Computer Careers Editor


Installing Linux and Unix Software From Source

Guest Author - Julie L Baumler

Number 1 Programmer Excuse for Goofing Off: My Code's Compiling (XKCD)A few days ago, I had to track down the root cause of some error messages. It turned out that the server was missing three special purpose libraries – all from software that was not available as an RPM or other package format (at least, if you wanted anything approaching a current version.) It occurred to me that I couldn't remember the last time I'd installed a software package from source and that it would be worth writing up how to do so for the benefit of users who started using Linux and Unix after packaging tools took over.

The first step is to find the software you want to install. (I'm assuming you already have a compiler, but if not use your usual packaging tools to install gcc or another compiler if your choice.) Usually a Google source for software_name source OR src download will locate the software you want for you. The file will likely be named something like software-src-version.tar,extension. This is called a tarball. Save the file to your system. Conventionally you put source code in /usr/local/src or /opt/src (depending on whether your system adds local files to /opt or /usr/local.) You may find that you need to create this directory. If you are building this on a machine where you don't have root or sudo access – for instance, in your hosting account on a web server or other shared system, you probably want to create a src folder in your home directory. Move to this directory and untar your tarball. If your tarball ends in tar.gz or .tgz, this means that GNUzip compression was used and you can untar it with the command:
tar xvzf directory_where_you_saved_your_download/tarball_name
If it ends with tar.bzip or tar.bz,, this is BZIP compression and you should use xvjf instead of xvzf. If it ends with tar.Z, which you don't see very often anymore, the old Unix compress compression was used, and you should use a capital Z (xvZf).

The tar command should have created a directory named package.version. Move to that directory and then run ./configure. If you want to install the software in a location other than /usr/local, you'll need to run ./configure –prefix=/full/directory/name. (To install under your home directory, you can run ./configure –prefix=$HOME.) If you want to fine tune where the package installs or see your other options, you can get more information by typing ./configure –help. Configure checks your system to make sure that all the required elements to build the program are on your computer and sets up the installation for your computer (it also provides copious information while doing so.) Sometimes configure will need you to provide more information using special command line options, it will tell you what those are when you run it if they are needed. If configure fails to find everything you need, it will tell you what is missing, and it can probably be installed using your favorite package manager (if not, start this process over with that package.)

Once configure has successfully completed, you can actually build the program by running make. Like configure, make provides a lot of output while it is running. Finally, you can install your program using make install. You will probably have to run the last step as root using sudo make install unless you are installing in an alternate location.

At this point your software should be installed and ready to use! If you run into a problem anywhere along the way, try Googling the error message. If this still leaves you struggling, feel free to post in the forum. Enjoy using your new software!

The XKCD Store has a t-shirt version of the comic above.

If you are going to get into anything more complicated than ./configure, make, make install or even troubleshoot problems with that process, Porting Unix Software is a huge help. Although it is somewhat outdated regarding the specific operating system references, the tools and software still work the same way.
Add Installing+Linux+and+Unix+Software+From+Source to Twitter Add Installing+Linux+and+Unix+Software+From+Source to Facebook Add Installing+Linux+and+Unix+Software+From+Source to MySpace Add Installing+Linux+and+Unix+Software+From+Source to Del.icio.us Digg Installing+Linux+and+Unix+Software+From+Source Add Installing+Linux+and+Unix+Software+From+Source to Yahoo My Web Add Installing+Linux+and+Unix+Software+From+Source to Google Bookmarks Add Installing+Linux+and+Unix+Software+From+Source to Stumbleupon Add Installing+Linux+and+Unix+Software+From+Source to Reddit

Benefits of ACM Membership
Professional Benefits of Geeky Hobbies
Computer Careers Shop
Related Articles
Editor's Picks Articles
Top Ten Articles
Previous Features
Site Map

For FREE email updates, subscribe to the Computer Careers Newsletter

Past Issues

Printer Friendly
tell friend
Tell a Friend
Email Editor

Content copyright © 2015 by Julie L Baumler. All rights reserved.
This content was written by Julie L Baumler. If you wish to use this content in any manner, you need written permission. Contact Maria S. Cuasay for details.


g features
Get Hip to Hybrid Medical Tech Careers

Front-End Developer An In Demand Career

Can You Be An IT Project Manager?

Archives | Site Map


Past Issues

Less than Monthly

BellaOnline on Facebook

| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2015 Minerva WebWorks LLC. All rights reserved.

BellaOnline Editor