Home > Enterprise Linux Tips > Administrator > How to manage software on Ubuntu Server with "aptitude" and "apt-get"
Enterprise Linux Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ADMINISTRATOR

How to manage software on Ubuntu Server with "aptitude" and "apt-get"


Sander van Vugt
08.17.2007
Rating: -4.00- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


If you are used to RPM-based Linux-distributions such as Red Hat and SUSE, it is quite a shock getting used to package management on Ubuntu Server. The most difficult part is the layered organization of Ubuntu package management services. Nevertheless, in many ways Ubuntu offers a much easier way to manage packages based on the Debian package format. Understanding how Ubuntu Package management works allows you to do your work as a Ubuntu Server administrator much more efficiently, and even update your system in one single command. In this article we'll explain how it works.

Ubuntu uses the same package management solutions as Debian. Package management on Ubuntu Server is based on a database that keeps track of all software packages that are installed. The most fundamental of all is the dpkg-database, which is based directly on the Debian package management utility. On top of that sits the apt database which is stored in /var/lib/apt. To manage packages in this database, you can use the "apt-get" command or the "aptitude" command. Both do more or less the same. If a graphical user interface is installed, the Synaptec utility can be used as well. In this article you'll read how to work with these tools.

Managing software repositories
Apart from the database that manages packages that are installed on your server, there is also the software repository as a second fundamental component that you need for package management. These repositories are basically lists of installation sources. One such installation source is the cd that you have probably used to install Ubuntu Server. Other sources are added automatically when installing Ubuntu Server. A list of all installation sources is found in the configuration file /etc/apt/sources.list.

Since these sources refer to Internet sites as well as local installation sources, they help you in keeping your server up to date. The "apt-get" command always uses this list of sources before installing new soft


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Heartbeat  (SearchEnterpriseLinux.com)
tty command  (SearchEnterpriseLinux.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


ware. To make sure that the list is up to date, you have to use the "apt-get update" command. This makes sure that the indexes that your server keeps locally are updated so that they know about new software packages that have become available. Once the indexes are updated 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". This is not so much a command that you would use to install or upgrade packages, but more a command that is used for package management. You would use this command, for example, to search for packages that match a given keyword, e.g.: "aptitude search xen". This displays a list of all packages that match the description xen. The command would give a result like in listing 1.

Listing 1: Searching packages with "aptitude"

From the list of all these packages, you can next use the command "aptitude 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 from Figure 1. From this interface you can check which packages are installed and which are not 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 comes with the graphical interface is the Synaptic package manager, which is based on the apt database as well. As you see in Figure 2, it offers an intuitive mouse-driven interface to help you install and manage software packages.

In Synaptic, the "Sections" button is a good starting point. This button allows you to see all available software, organized by software category. To see what's inside a category, click it, and in the right part of the Synaptic window you'll see a list of available packages. After clicking an individual package, you'll see a description of the package, allowing you to see exactly what is in the package. Next, select the "Mark for Installation" option and click "Apply." This will bring up the window that you see in Figure 3, asking you if you really want to install this package. From this window, click "Apply" to start the package's installation.

Another useful option from the Synaptic interface is the "Search" feature. It works very easily: Click "Search," and in the window that pops up, select the software that you are looking for. 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.

Summary
For first time users, the Ubuntu server package management utilities are quite intimidating. The most important reason for that is that a layered architecture with related commands is used to manage software on your server. The most important system is based on the apt package database. In this article you have learned how to use the commands "apt-get" and "aptitude" to perform package management from the command line. You've also seen how the Synaptic package manager can make package management easier if you are using a graphical environment.

Rate this Tip
To rate tips, you must be a member of SearchEnterpriseLinux.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Enterprise Linux Web Server & Application Server
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts