Managing Software on Ubuntu Server Edition

Ubuntu Server Edition's package management utilities can be intimidating but can be easily navigated at the command line and with Synaptic's GUI package manager.


Package management in Ubuntu Server Edition – and the layered organization of Ubuntu package management services in particular – can be difficult for admins who are used to working with RPM-based Linux distributions such as Red Hat and SUSE. But, in many ways Ubuntu offers a much easier solution to managing packages, allowing a server administrator to work more efficiently by updating a system with a single command.

Ubuntu uses the same package management solutions as Debian, logging all software package installations in database format. The most important of these, the dpkg-database, is based directly on the Debian package management utility. These databases can be managed with simple tools; for example, for the apt database, which is stored in /var/lib/apt, you can use the apt-get command or the aptitude command. If a graphical user interface is installed, the Synaptec utility can be used as well. In this article, we'll discuss some of the tools used for Ubuntu Server package management.

Managing software repositories

In addition to databases, the software repository is the second fundamental component of package management. The repository is basically a list of installation sources. One such installation source, for example, could be a cd used to install Ubuntu Server. Sources are added automatically to the list, which is found in the configuration file /etc/apt/sources.list.

Since these sources also refer to internet sites as well as local installation sources, they help keep your server up to date. The apt-get command always uses this list of sources before installing new software. To make sure that the list is up to date, use the apt-get update command to ensure that the indexes your server keeps locally are updated on the latest software packages. This way you can use apt-get upgrade to upgrade packages on your server to their latest versions or apt-get install package-name which will install the most recent version of the package that you want to use.

Managing packages with aptitude

Another command that works on the same package database is aptitude. Aptitude is helpful when searching for packages that match a given keyword (aptitude search xen, for example.) This displays a list of all packages that match the description xen. The command would give a result like this:


Listing 1: Searching packages with aptitude
[email protected]:~$ aptitude search xen
p ubuntu-xen-desktop Xen software for running on servers.
p ubuntu-xen-server Xen software for running on servers.
p xen-doc-2.6.16 Linux kernel specific documentation
p xen-docs-3.0 documentation for XEN, a Virtual Mac
v xen-headers  
v xen-headers-2.6  
p xen-headers-2.6.16 Header files related to Linux kernel
p xen-headers-2.6.19-4 Common header files for Linux 2.6.19
p xen-headers-2.6.19-4-gener Common header files for Linux 2.6.19
p xen-headers-2.6.19-4-serve Common header files for Linux 2.6.19
v xen-hypervisor  
v xen-hypervisor-3.0  
p xen-hypervisor-3.0-i386 The Xen Hypervisor for i386
p xen-hypervisor-3.0-i386-pa The Xen Hypervisor for i386 (pae ena
v xen-hypervisor-i386  
v xen-hypervisor-i386-pae  
p xen-image-2.6.19-4-generic Linux 2.6.19 image on PPro/Celeron/P
p xen-image-2.6.19-4-server Linux xen 2.6.19 image on x86.
p xen-ioemu-3.0 XEN administrative tools
p xen-restricted-modules-2.6 Non-free Linux 2.6.17 modules on x86
v xen-source  
v xen-source-2.6  
p xen-source-2.6.16 Linux kernel source for version 2.6.
p xen-tools Tools to manage debian XEN virtual s
v xen-utils  
p xen-utils-3.0 XEN administrative tools
p xen-utils-common XEN administrative tools - common files
p xengine A benchmark program for the X Window
p xenman A graphical Xen management tool
v xenx-doc-2.6  


From the list, you can use the aptitude command show to get more information about a package. For example, use aptitude show xen-source to get a description of the xen-source package if it is already installed, or use apt-get install xen-source to install it now.

If you don't like to manage packages from the command line, there is good news. The aptitude utility can work in menu mode as well, but to do that you must make sure that the right terminal setting is used. To do this, first type export TERM=vt100. Next, run aptitude again and you'll see the interface (figure 1). From this interface you can check which packages are installed and which are not from an intuitive menu interface.


Figure1: The aptitude menu interface allows you to manage packages from an intuitive menu interface

GUI package management
If managing packets from the console using apt-get or aptitude is not ideal for you, you might want to do it from a graphical user interface instead. One of the tools that come with the graphical interface is the Synaptic package manager, which is also based on the apt database. As you can see, it offers an intuitive mouse-driven interface to help you install and manage software packages (figure 2).


Figure 2: The Synaptic package management tool makes software management easy.

Use the sections button as a starting point. This button allows a user to see all available software, organized by category. Click and see what's inside a category and in the right part of the Synaptic window you'll see a list of available packages. After clicking an individual package, it will give a description showing exactly what is in the package. Next, select the mark for installation option and click apply. This will bring up a window asking you if you really want to install this package(figure 3). From this window, click apply to start the package installation.


Figure 3: Click Apply to start installation of the selected package.

Another useful option from the Synaptic interface, is the search feature. It's easy: click search and in the window that pops up, select the software for which you are looking. Click search again and you'll see a list with all matching packages in it. Next, mark them for installation and click apply if you really want to use these packages.

For first time users, the Ubuntu server package management utilities can be quite intimidating. In time, users benefit from the layered architecture and the easy commands used to manage software on the server. Users who prefer a GUI interface will do well with the Synaptic packageme manager. But don't be afraid of the command line – these commands are a simple and efficient way to manage your packets.
About the author: Sander van Vugt is an author and independent technical trainer, specializing in Linux since 1994. Vugt is also a technical consultant for high-availability (HA) clustering and performance optimization, as well as an expert on SLED 10 administration.


Dig Deeper on Linux servers