

This article was written on April 17, 2007 by CyberNet.
Many Linux applications don’t have to be installed manually because most distributions have implemented a package management system to make it easier for you to install software. But that’s not always the case. Some programs only offer tarball packages for download, which have to be compiled from source. We’ll show you how to do that.
We’re going to compile and install Audacity (audio editing software) to show you how to install tarballs. Because I wrote this tutorial on an Ubuntu machine, it will be easier to follow if you’re using Ubuntu or a derivative. That, of course, doesn’t mean that you won’t be able to do it with a different distribution. Before we begin, make sure that Audacity is not installed on your computer. If it is, uninstall it using your package manager. This will prevent different versions of the application from being mixed up. You can always uninstall the tarball later.
You can click on any of the screenshots below to enlarge them.
- Download the Audacity tarball by clicking here (6MB). It doesn’t matter where you save it.

- Extract the contents of the package with a package extraction tool such as Ark or file-roller. You can also do it from a terminal by doing
cd /folder/with/Audacity/tarball
tar -xvf audacity-src-1.3.2.tar.gz
Don’t forget to replace /folder/with/Audacity/tarball with the path to the folder where you saved the tarball.
- Let’s have a look at the requirements. According to README.txt (included in the tarball), we will have to download and compile wxWidgets separately. If you scroll down, you’ll see that they ask you specifically to install version 2.6.x. Don’t neglect this kind of warnings, otherwise the compilation process will fail. Let’s install wxWidgets then, shall we?
- Install these packages using your package manager: build-essential, make, g++, gcc and libc6-dev. These are just some basic compiling tools that you have to install when compiling for the first time. Not all distributions use those names for these packages, so you might need to do some research on the Internet before you can proceed. On Ubuntu, you can do
sudo apt-get install build-essential make g++ gcc libc6-dev
to install everything required to start building.
- Download the wxWidgets tarball and extract it. (Note: this particular version of wxWidgets is called wxGTK, referring to the GTK toolkit. Developers often use this GNOME toolkit to develop applications for Linux.)
Open a terminal and go to the newly created directory using the cd command.- Look for a file named INSTALL.txt for install instructions. The file tells us that you have to execute these commands:
mkdir buildgtk
cd buildgtk
../configure –with-gtk=2
make
sudo make install
sudo ldconfig (sometimes ’sudo /sbin/ldconfig’)
If you get a “package/library not found”-like error message, install the necessary package and, when available, its -dev addition. Then re-execute ../configure –with-gtk=2. You might have to do this a couple of times. If you’re lucky, you won’t be bugged at all. Also keep in mind that the make command might take a while to complete depending on the speed of your computer.
- Let’s take a look at the rest of the requirements. The readme file included in the Audacity tarball tells us that the packages libid3tag, libmad, libogg, libvorbis and Twolame are optional. Although you can go ahead and compile Audacity without them, you won’t be able to use everything that Audacity has to offer. You can install these packages if you want by searching for them using your package manager. If there’s also a package with the same name followed by -dev available, install that one too. For example: to enable Ogg Vorbis support, you’ll need to install both libogg0 and libogg-dev. These -dev packages are usually required if you’re compiling programs manually. Ubuntu users can do:
sudo apt-get install libid3tag0 libid3tag0-dev libmad0 libogg0 libogg-dev libvorbis0a libvorbis-dev
to install most requirements from the Ubuntu repositories. (Note: if you’re using Ubuntu 6.06, apt-get might not find all these packages.) If you can’t find everything, don’t worry. Again: these are optional packages. If it turns out that essential functionality is missing, you can always dig up the necessary packages/libraries using Google and compile/install them later.
- Back to installing Audacity. Open a terminal and go to the folder where you extracted the contents of Audacity’s tarball using the cd command. Check if README.txt contains additional install instructions. The file tells us to execute these commands:
./configure
make
sudo make install (if a command is preceded by ’sudo’, it’ll be executed as root)
If you get an error message saying it couldn’t find a certain package/library on your system, just install the missing package or library using your package manager. Then re-execute ./configure. You might have to do this several times. If you get an error saying something like “configure: error: *** Ogg Vorbis libraries not found or they are too old. (>= 1.0-rc3 required). Run configure –without-vorbis to disable it.“, it is most likely that you couldn’t find one of the optional packages. If you wish, you can build Audacity without this functionality by following the instructions. In this particular case, you can do:
./configure –without-vorbis
to compile Audacity without support for Ogg Vorbis.
Everything is now installed! And now, the moment we’ve all been waiting for: testing our newly installed app. Cross your fingers and execute the command audacity. To be honest, it didn’t work for me because I got this error:
audacity: error while loading shared libraries: libwx_gtk2_xrc-2.6.so.0: cannot open shared object file: No such file or directory
When it seems like all your hard work was useless, don’t panic. Use the Internet to find a solution instead. I’ve found a fix for my particular case:
sudo ln /usr/local/lib/libwx* /lib/
sudo ldconfig (in some cases ’sudo /sbin/ldconfig’)
Try starting audacity again. Everything should work fine now.
- You can create a shortcut to Audacity in your start menu using alacarte (GNOME) or by launching KDE’s menu editor (right-click the K button).
Uninstalling
If you’re done playing with Audacity, open a terminal, cd into audacity-1.3.2-beta and execute:
sudo make uninstall
You can also uninstall wxWidgets if you don’t need it anymore. Open a terminal, go to wxGTK-2.6.4 and enter:
cd buildgtk
sudo make uninstall
Be careful though. If you uninstall wxWidgets, programs that require wxWidgets will stop working.

Note
Some programs such as Firefox come in .tar.gz packages but don’t have to be compiled. You can just extract the file anywhere and start using the program immediately. You can check whether a program will have to be compiled or not by searching for the following files: configure, autogen.sh, Makefile and Jamfile. If you don’t find any of these files, it probably doesn’t need to be compiled. Just search for the program executable (in the case of Firefox: ‘firefox’) to run the program.
Summary
In general, this is how you compile applications:
- Download and extract the application’s tarball.
- Open the extracted folder and look for a readme/install file. If there are additional requirements, install or compile them. Make sure that you download the correct version of the package.
- Check the readme/install file for compilation instructions.
- If it contains compilation instructions, open a terminal, cd to the extracted folder and follow the instructions.
- If it doesn’t contain compilation instructions, open a terminal, cd to the extracted folder and do ./configure followed by make and sudo make install.
- If you get an error saying ./configure couldn’t be found, try ./autogen.sh instead.
- If ./autogen.sh or ./configure (with or without parameters) terminates because of a “package/library not found”-type error, install the required stuff and re-execute the command.
Having trouble compiling? Don’t worry, just do some research online. If you can’t fix the problem by yourself, go to one of the big Linux communities and ask for help. Remember: some programs also can be uninstalled using the make command. To uninstall the compiled program, go to the extracted folder and do:
sudo make uninstall
If it returns the message “make: *** No rule to make target `uninstall’. Stop.“, this uninstall method won’t work. Some applications such as wxWidgets store their Makefile (which contains the instructions for the make command) in a separate directory. In that case, cd into that directory and rerun sudo make uninstall.
Editor’s Note: This post was written by Pieter De Decker who is the developer of the free USBsyncer and iPodCALsync!
Copyright © 2009 CyberNet | CyberNet Forum | Learn Firefox
Related Posts:
