May 28, 2007, 1:21 p.m.
posted by void
Manage Packages with Synaptic
Use the default Ubuntu package manager to easily install and update programs on your system. One thing that can be difficult to get used to if you are new to Linux is package management. On one hand, the way that Ubuntu handles program installation and upgrading is much simpler than on other operating systems. On the other hand, it's rather different from what you might be used to, so it takes some time to learn the ins and outs. Luckily, all you need to learn is a single tool and you can then apply that knowledge to install and upgrade any of thousands of Ubuntu programs. In this hack, we talk about how to use the default Ubuntu package manager called Synaptic to manage all of Ubuntu's packages efficiently and easily. The first step is to start Synaptic. Click System The default Synaptic window
The main window is divided into a few sections. The sidebar displays the different package categories so that you can quickly drill down to a particular group of packages (like games) and not have to read through packages in other categories. The first category, All, displays all packages. On the right side of the window along the top is the list of packages, along with information about whether they are installed and what the latest version is. If you select a particular package, detailed information is displayed in the pane below. Near the top of the screen are a few buttons that correspond to the main actions you'll want to perform when using Synaptic, described next. Reload the Package ListIn Ubuntu, packages reside in what are known as package repositories. "Modify the List of Package Repositories" [Hack #60] goes into more detail about the different package repositories that exist for Ubuntu, but in short, these repositories allow different types of packages to be kept together in a central place. As a user, this means that you don't need to search around on the Internet to find a program; you just find the program in the package manager, and it retrieves that program's package, as well as any other packages that program needs from the appropriate package repositories. There are often updates to these package repositories as new versions of software are released, so before you do anything else, you will want to get the very latest list of packages and their versions. To do so, click the Reload button at the top of the window. Synaptic will download and update its local database of packages with these new versions (Figure). Once it is finished, you are ready to install and update packages. Click Reload to grab the latest list of packages
Install PackagesTo install a package in Synaptic, find the particular package in the package list. You can either scroll down manually or, if you know the name of the package, you can start typing in that list to highlight it. If you aren't sure about the category or the name of a particular program, you can also search within Synaptic for it. More information on how to use the Synaptic search feature can be found in "Search for Packages," later in this hack. After you identify the package you want to install, right-click on it and select "Mark for Installation." If you want to install more than one package, mark them all for installation at this point. Synaptic will prompt you if a package depends on another package to install so that you can approve the installation of it. Once all of the packages you wish to install are selected, click the Apply button, and Synaptic will display a prompt letting you know which packages it will install along with how much space it will need. Then Synaptic will automatically download and install all of the programs onto the system. Update PackagesOne particularly nice feature of a centralized package repository is that it makes upgrading all of the programs on your system a breeze. To update your system, click the Mark All Upgrades button. Synaptic will go through and mark any and all packages that have an update available. Click Apply to apply the changes, and Synaptic will download and install all available updates for your system: from desktop programs to libraries to games. You will want to periodically update the programs on your system to make sure you have the latest bug fixes and security patches.
Remove PackagesYou can remove packages in Synaptic in much the same way as you can install them. Find the package you want to remove in the package list, right-click, and select "Mark for Removal" if you want to remove the program but leave behind any configuration files you may have changed. You can also select "Mark for Complete Removal" if you want to purge even the configuration files from the system. Search for PackagesSometimes you know what sort of program you want to install, but you aren't completely sure what the exact name of the package is. Synaptic includes a search tool to make it simple to find the packages you need. Click the Search button at the top of the window and enter any keywords you want to search for. Synaptic will then display a filtered package list that contains only the packages that match those keywords (Figure). You can then more easily locate and install them. To get back to the standard package list, click the Sections button at the bottom of the window. The Synaptic search interface
Edit Preferences and Add RepositoriesThe above steps are enough to do standard package management, but as you get used to Synaptic you may want to tweak some of its settings. Click Settings Synaptic's Preferences window lets you tweak default behavior
You may also want to add extra software repositories to your system. Extra repositories such as universe and multiverse [Hack #60] contain a much larger set of software; however, the software is packaged and supported by the Ubuntu community instead of the Ubuntu project itself, so these packages may not be as well tested. To change your repository settings, click Settings
Add to Synaptic's package repositories
|
- Comment
Synaptic Package Manager to launch the program. Synaptic requires

Figure). In the Preferences window, you can configure some of Synaptic's default behavior, such as how many undo operations to allow, what colors and fonts to use for packages, which columns to display in the main window, and the details of your network proxy settings.
Figure shows the main window that displays all of the main repositories you have configured. To add subcategories to a particular repository, select the repository and click Add. To add