The Debian Universe


/read/online

^contents

6: Synaptic: Point-n-Click Software Management

Last month I introduced you to the range of tools available within Debian for installing software packages. While there will be times you'll need to use the low-level command-line tools, many users who run X would prefer a more point-n-click oriented approach. Enter Synaptic, perhaps one of the biggest advances in Linux software package management since Apt itself. Early versions of Synaptic were created by Conectiva, a Linux distro based on Red Hat, but it's since been embraced by Debian and is now part of the main distribution.

If you're used to running Windows, you can think of Synaptic as a sort of super-dooper, turbocharged, steroid-munching version of the "Add / Remove Software" control panel. Except that it would be rude to even think about comparing them since there's a world more sophistication in Synaptic.

Getting Synaptic

Open up a terminal and get ready for what may be your last use of Apt for a while! As root, type:

apt-get install synaptic

Once Synaptic has finished installing, type 'synaptic' as root. Synaptic will take a few seconds to start up as it queries your system to build a list of available and installed packages and then you'll be greeted with the default view, a categorised software list something like this:

If you've become accustomed to Apt, Synaptic should make a lot of sense from the moment you first see it. As I noted last month Synaptic is in many ways just Apt with point-n-click goodness, and that means most of the operations in Synaptic are based on operations in Apt. If you know how to do something in Apt there's probably a button in Synaptic to do exactly the same thing.

General Approach

Unlike Apt, which performs all actions immediately, Synaptic lets you queue up a number of actions until you're satisfied with your choices. Selecting a package in the list and marking it to be installed or removed won't cause a sudden flurry of activity. In fact, it'll look like nothing much is happening at all. Synaptic just makes a little internal note about your selection and waits to see what you do next. That means you can browse through the packages at your leisure without waiting for your computer to go through a potentially lengthy download-configure-install cycle for every item you select.

Then when you are ready you can click the big 'Proceed' button at the top of the main screen to tell Synaptic to go ahead and install or remove packages as requested while you go off to do more interesting things.

Updating The Package List

To make all this package-management funkiness possible your Debian system maintains a local list of available packages. The local list is created by fetching lists of packages from a number of sources, and then merging them into a local list. Of course over time the local package list will become out of date: new packages and updates to existing packages are made available daily on Debian's servers, so your system needs to rebuild the local package list from time to time.

Fortunately Synaptic makes it really easy for you: on the main screen you'll see a button labelled 'Update List'. Just click it to have Synaptic query all the software sources it knows about and merge updates into the local list.

Finding Packages

There are several ways to find packages in Synaptic, and all of them are based on the list in the middle of the main window. They all work by applying an overlay to restrict which packages are shown in the list, and a view mode to determine how the list should be grouped.

The overlay is selected using the 'Show' drop-down list at the top. To just browse through all the available packages, select 'Show: All Packages' and wander on through.

Synaptic has a number of view modes, accessed through the 'View' menu on the main screen. By default it groups packages into categories, but you can also choose to view the list grouped alphabetically, by status (such as 'installed' or 'broken'), or in a big flat list with no grouping at all.

Browsing the list should be pretty self-explanatory: the little triangles spin down the groups (if applicable), and selecting a package enables the additional information tabs across the bottom. Here you can read the extended description of each package, check what other packages it depends on, and if the package is already installed you can see a list of files that were installed as part of it.

If you want to restrict the list of packages a bit (browsing through 11,000 packages may not be the most efficient way to find something!) you can select alternative overlays such as 'Installed' or 'Not Installed'. The grouping will still appear exactly the same because it's based on the view mode, but now only the packages matching your selected overlay will be displayed within each group.

Searching for packages based on keyword wasn't at all intuitive for me at first, because I had a preconception that search results would always be presented as a flat list and it took me a while to realise that to keep things consistent what Synaptic does is honor the view mode you've selected. That can be confusing, because it may look like nothing has happened when you do a search: you still just see a list of groups, and you have to look through them to find your search results.

However, try switching the view mode to 'Flat list' and you'll get a list of packages that's probably a bit more what you expected.

Rather than letting you enter a search term and then processing it, Synaptic does a look-ahead search, narrowing down the packages based on what you've typed so far. Try entering a search term such as 'gimp' in the main screen. As you type you'll see the results narrow down. There's no 'search' button as such, because it does the search on the fly while you type.

You can manually scroll through the results, or you can use the right-arrow button next to the search box to step through them one by one, and the up-arrow to go back to the start of the results.

Installing And Removing Packages

If you see a package you want to install, just select it in the package list and click the 'Install' button on the right to have Synaptic flag it for installation. If you find something already installed and you want to remove it, click the 'Remove' button.

Pretty simple!

As noted before though, nothing much will happen when you do that. Once you've flagged all the packages you want to install or remove, click the 'Proceed' button at the top of the main screen. Synaptic will then figure out what it needs to do to fulfil the dependencies of the packages you've flagged, and after some confirmations will proceed to download, unpack and configure any packages it needs to fetch.

As packages are installed they may need to be configured. Synaptic displays progress in a terminal window while it works, and may ask you configuration questions along the way as well.

Updating Your Entire System

Remember how you can use Apt to upgrade every single installed package to the latest version using 'apt-get upgrade' or 'apt-get dist-upgrade'? Well, Synaptic lets you do the same thing. In fact, it gives you big fat buttons at the top of the main window to make it really easy.

To upgrade all the packages on your system to the latest version, but not install anything additional, just click 'Upgrade all'. That will compare your installed package versions with the latest package list, and upgrade everything possible.

But sometimes a software package will have new features added that make it depend on some other external package that wasn't required before. In this case, 'Upgrade all' just won't cut it because it will refuse to install the additional dependency if it isn't already on your system. No problem, the cure for that is the 'Dist Upgrade' button that will not only update all installed packages, but also install any new packages that may now be required. Clicking that button every now and then (after doing an 'Update List' of course) will ensure you've always got the latest versions of all packages.

Managing Software Sources

As noted last month, your Debian machine uses an '/etc/apt/sources.list' file to tell it where to find new software for you to install. By modifying the entries in your sources.list file you can control which release (such as Stable, Testing or Unstable) your machine follows, and add extra sources for using unofficial software sources.

Normally that's done by editing the file directly, but Synaptic includes a handy little interface that lets you manage entries from the GUI. You can get to it through the top menu by opening Settings/Repositories.

As you can see, the repository dialog even takes care of the syntax of each entry by giving you convenient little boxes to enter the URI, distribution and section. You can also use a drop-down to select the repository type, such as 'deb', 'deb-src', 'rpm', etc.

You can also put in entries for different software vendors along with their cryptographic fingerprints, and then associate individual sources with vendors. While it's a little-used feature at present, this is part of the architecture being put in place to allow users to verify that packages they are downloading and installing haven't been intercepted and modified. You may not be aware of it, but all software packages created by Debian developers have to be crytographically signed before they can be uploaded to the master servers and distributed to users around the world. That is done so that hackers can't create their own copy of a software package which they have modified to include a virus or trojan and then upload it to the master Debian servers - the master servers only accept packages signed by known developers.

At present very few people actually check the signatures on the packages they download, but with its built-in support for signature checking Synaptic will make this a lot easier in future.

Conclusion

Synaptic has a few other goodies hidden in its menus as well, but I've shown you enough for 99% of what you'll need to do.

The sharp-eyed among you may notice that a couple of the repository entries in the diagram above look a little strange: the first and third entries are set up to use a local Apt-cacher machine so that any packages that are downloaded are stored locally on a central server for other local machines to install. Tune in next month for the low-down on Apt-cacher, and how it can save you heaps on your bandwidth if you manage multiple Debian machines.

Copyright 2003-2004Jonathan Oxer. All rights reserved.
-:Site powered by Internet Vision Technologies:-