Tuesday, February 06, 2007

How to manage source packages on Ubuntu

Sometimes you want the latest version of a particular application, but you find out that it isn't available from the Ubuntu repositories just yet, and most probably it won't be included until the next version of Ubuntu is released. So what to do? You can use the older version that is included in the repositories or build the latest version from source.

But source packages are inconvenient because you don't really know what's installed, or where it is installed. And, most of the time, you can't uninstall them unless you delete every file that was installed by hand. So, you'll have to stick with the repository version, right? Well, no because there exists a solution to the problems I just mentioned.

You can use a source package manager to track the installation of source packages. Some of these package managers will let you uninstall all the packages you have added to your system, among other useful features. One source package manager I like and that I've found to be the one that works best is called Paco, a short name for Package Organizer.

Paco was originally written to help manage the installation of software in Linux From Scratch, where everything is built from source and there is no package management built in.

How does Paco work? Here's a description from its homepage:
When installing a package from sources, paco wraps the "make install" command (or whatever is needed to install the files into the system), and generates a log containing the list of all installed files.

Technically, this is done by preloading a shared library before installation using the environment variable LD_PRELOAD. During installation this library catches the system calls that cause filesystem alterations, logging the created files.

Paco is able to show information about the applications you have installed, and it also lets you uninstall them in a very easy way. It also provides a basic graphical interface called GPaco.

"Okay, that's all cool and all, but where do I get it and how do I use it?" you may ask. Well, you can get Paco from its homepage. I'll give a brief description on how to use it in the following lines. To install it please read the README file that's inside the tarball.

To install a source package with Paco simply begin as you usually do:
  1. Open a terminal.
  2. Decompress the tarball.
  3. Change into the source directory of the application you want to install, usually the directory extracted from the tarball.
  4. Do the usual ./configure and make steps.
  5. After make has finished type sudo paco -lD "make install" to install the application. Paco will log it into its database to provide information about it and to allow its removal at a later time.
The -lD switch will make Paco log the application with the name of the current directory you're in. Say, if you're in the foo-0.1 directory Paco will log this application as foo-0.1.

To remove a package you can type sudo paco -rx --batch package-name - the package name must be the one Paco has logged in its database. To see the packages you have installed in your system you can issue the following command in a terminal: paco -av or paco -av --one-column.

And that's all folks! Be sure to read the MAN page for further and more complete instructions!

3 comments:

Anonymous said...

The info and product description was helpful. Thanks.

Anonymous said...

Many thanks! There should be a special manual for advanced linux users and this article should be part of it.

Anonymous said...

Many thanks! There should be a special manual for advanced linux users and this article should be part of it.