Smart Package Manager: a better mousetrap

203
The Smart Package Manager hopes to beat the native package management applications for distributions like Red Hat, SUSE, and Debian at their own game. Still in beta, it has support for most major GNU/Linux package and repository formats, with a modular codebase that hints at further compatibility. Smart introduces many innovative and useful ideas, but its killer feature, with which it purports to excel beyond its counterparts, is the algorithms it uses to select packages and versions that best resolve dependencies and ensure cooperation between the hundreds of applications and libraries on a user’s system.

In most GNU/Linux package management schemes, user-selected packages are fetched from a list of sources, be they CDs or remote repositories, and installed along with other packages on which they depend. Each has slightly different package formats, protocols, and administration interfaces.

Smart is meant to unify all the independent and slightly different schemes. It uses a package management model, but has the ability to support competing package and repository formats. Smart can download and install .deb, RPM, and Slackware packages from wherever it needs to, but performs those downloads in a superior manner. To hasten mass package downloads, Smart uses an Autobalancing Mirror System to select the fastest download repository available, and also an intelligent Download Manager that supports things such as parallel file transfer and decompression, resuming, and protocols from HTTP to Telnet. Smart has a modular interface design, with command line, interactive shell, and GTK interfaces already implemented. Modularity and portability are present throughout Smart’s source, which is required so that it may continue to support any distribution’s package scheme. More information about all of these features can be found on Smart’s features page.

With these features, Smart can compete with other distributions’ native package management schemes, but what Smart’s supporters claim sets it apart is its package selection algorithms. Installing or upgrading packages is not always a simple task, and it is not uncommon for Debian’s APT or Fedora’s yum to err in their attempts, causing broken packages or unmet dependencies. While Smart is not infallible, it is designed to overcome such issues and deliver to users the best possible systems, even if the most obvious route cannot be taken.

Gustavo Niemeyer, lead developer of Smart, has documented several case studies in which his software outperforms its rivals. For instance, in Case 2, both APT and yum select additional unnecessary packages to resolve a dependency issue, while Smart selects only the one package it needs. In Case 3, the newest available package in a repository is missing a dependency and cannot be installed. APT refuses to install it, yum claims that it can be installed anyway, but Smart simply installs an older version without issue.

Light testing on a Debian Unstable system reveals Smart to be both an able and usable replacement for APT. I had no problems during installation from Sid repositories, though one must manually copy the APT repository list into Smart’s “Channels” list. Once installed, Smart coexists nicely with APT, and one is able to use either whenever desired. Smart’s command-line interface is similar to APT’s, but the GTK GUI is not without flaws. For example, it is difficult to distinguish between the current version number of a package and that which one may upgrade to. Furthermore, Smart’s only search filters return too many results if you already know the package’s name or a part of it, though they are useful in searching by package description. Though irksome in some ways, the GTK GUI should be lauded for offering graphical configuration of the channels list, user-priorities, and other advanced features. Smart also offers a system tray app to automatically notify the user of available upgrades.

Smart start

Smart is the brainchild of Niemeyer, who began the project in May 2004 when he was an employee of Conectiva Linux (now a part of Mandriva). “Smart began its life as my own toy project, since it was of course reinventing the wheel, and this was never encouraged inside Conectiva without a good reason. After a while, the project was already showing some interesting advantages, so I was allowed to work on the project part-time during my working hours.” Smart’s position within the distribution grew to the point that Niemeyer felt “Conectiva was going to adopt Smart as the official package manager in the next distribution release. When Conectiva and Mandrake joined to become Mandriva, the plan was to turn Smart into the official package manager for the distribution, as was suggested in the fusion announcement. Unfortunately, I believe that [since] I left the company this position has changed.”

Despite Mandriva’s change of heart, Smart is strongly supported either officially or by the community of most major Linux distributions, including Niemeyer says, Ubuntu, Debian, Mandriva, Fedora, SUSE, and others. This support is reciprocated by Smart’s effort to support the package and repository formats for each of these distributions.

Smart remains principally in Niemeyer’s hands. “I hope to change this situation soon though, and get some heavy coders by my side.” Many developers have contributed patches and support (a list of credits can be found at Smart’s homepage), but a persistent core development team has yet to form. Niemeyer cites Michael Vogt, formerly his co-maintainer of Synaptic for Conectiva and currently his coworker at Canonical, as a possible leader in Smart’s future. “Michael has already helped me a lot in the release process for Smart 0.42, and is preparing some neat features that should be integrated soon. Hopefully Michael will stay around for a long time.”

As Smart’s beta phase continues, Niemeyer plans to add features as well as fix bugs. “[Vogt is working on a feature that] makes Smart keep track of which packages are being explicitly requested by the user, and which ones are being included as automatic dependencies, so that when these automatic dependencies aren’t needed anymore Smart may suggest them to be removed. This is a nice feature already available in aptitude, by Daniel Burrows. Hunting bugs and issues/feature requests reported in the tracker is also high in my list.”

When will Smart leave beta? Niemeyer says, “That’s a good question. I guess the main reason for it to be still considered beta is my lack of time. I feel bad for being unable to give it all the attention that users deserve right now, so I improperly try to get some of the weight off of my shoulders my labeling it beta.” Niemeyer may be wary, but my testing suggests Smart version 0.42 is worth a try today.