Smart Package Manager FAQ

  1. General
    1. What is Smart?
    2. Does Smart's wide support for packaging systems mean I can install .rpm packages on my Debian system? Or .deb packages on my RPM-based system?
    3. What repository formats does Smart support?
    4. Why is it called Smart?
    5. Why is Smart better than APT/YUM/URPMI/etc?
    6. How stable is Smart?
  2. Usage
    1. Can I use Smart with APT/YUM/URPMI/whatever?
    2. Which interfaces does it support?
    3. I am using YUM, and I want to use my repositories with Smart, but "YUM" does not appear to be a valid channel format. What do I do?
    4. I want to install a new kernel package, but Smart says it is going to "upgrade" my old kernel packages. I don't want them removed, what should I do?
    5. What does the little yellow star mean?
    6. How do I add mirrors? How does Smart choose which mirror to use?
    7. Several channels provide an identically-named package. Which of the packages does Smart use? Can I change that?
    8. Can I lock a package so that Smart will never touch them?
    9. Where does Smart save its settings?
    10. I have a package on my disk. Can I use Smart to install it?
    11. I have a package on a remote URL. Can I use Smart to install it?
  3. Packaging Smart
    1. I want to package Smart for my favorite distribution, what should I do?
    2. What's the deal with that distro.py file?
  4. Credits
    1. Who wrote Smart?

General

What is Smart?

Smart is a meta-package manager in the spirit of APT, YUM, URPMI and others. It can manage RPM, DEB and Slackware packages and provides a clean architecture to add new package and repository formats (called channels in Smart).

What sets Smart apart is a dependency-solving algorithm that outperforms other package managers, a clean architecture, wide support for package and repository formats, and great mirror-management. See the README for more information.

The official page is hosted at http://smartpm.org/.

Smart is released under the GNU GPL.

Does Smart's wide support for packaging systems mean I can install .rpm packages on my Debian system? Or .deb packages on my RPM-based system?

Short answer: no.

Long answer: no, unless you have the non-native package system installed in the same machine. Even then, that doesn't mean it would be a good idea.

Smart is not meant as an universal wrapper around different package formats. It does support RPM, DEB and Slackware packages on a single system, but won't permit relationships among different package managers. While cross-packaging system dependencies could be enabled easily, the packaging policies simply do not exist today.

This is not at all different from what you can already do. In fact, Debian has been shipping the RPM package manager for a few years now. "Possible" does not equal "good idea", and everybody should stick to their native package format.

What repository formats does Smart support?

Smart supports the following repository formats as source channels:

RPM repositories: APT repositories for .rpm, RPM-MD (used by YUM), Red Carpet (used by Ximian/Novell), RPM Header List (used by Red Hat and Conectiva installation CDs, probably others), RPM Directory (a directory with a bunch of RPMs in it, no indexing required), URPMI (used by Mandrake)

DEB repositories: APT repositories for .deb

Slackware: Slackware repositories

Mirrors: up2date- and Conectiva-style mirror description formats

Why is it called Smart?

From The Free On-line Dictionary of Computing:

smart

1. <programming> Said of a program that does the {Right Thing}
in a wide variety of complicated circumstances. (...)

See the next question.

Why is Smart better than APT/YUM/URPMI/etc?

Smart supports several repository formats, including those used by APT, YUM and URPMI.

Smart has an easily-extensible, clean architecture. It is written in Python with some C code in performance-critical areas.

Smart has the smartest algorithm of all package managers. It can handle inconsistent states, downgrade packages when necessary and do better dependency-checking. See the README for some situations where Smart outperforms APT's and YUM's dependency-checking systems.

Smart is able to handle broken systems: if you have unsatisfied dependencies, Smart won't force you to fix the problem unless it is absolutely necessary to perform the operation you are requesting. Of course, if you really want Smart to fix the problem, you could run smart fix or choose "Fix all problems" in the GUI.

How stable is Smart?

Smart is just out of closed beta. It does work and has been tested using Conectiva, Debian and Fedora Core. Even though it should mostly work just fine, some features have been more tested than others, and it is possible that important bugs still remain in the code.

Usage

Can I use Smart with APT/YUM/URPMI/whatever?

Yes. Smart is a meta-package manager like APT, YUM and URPMI, meaning it runs over RPM, DPKG or pkgtool. You can run Smart alongside other meta-package managers. Trying out Smart should be very safe.

Which interfaces does it support?

Smart supports a command-line user interface similar to APT, a GUI (using GTK) and an interactive shell. You can also "mix" the interfaces. For example:

# smart --gui install kdegames

Will give graphical feedback to a command-line action.

Like everything else in Smart, interfaces are modular, so it should be very easy to add your own.

I am using YUM, and I want to use my repositories with Smart, but "YUM" does not appear to be a valid channel format. What do I do?

YUM uses a repository format called RPM-MetaData (rpm-md). Smart expects the same Base URL as your baseurl settings in /etc/yum.conf or /etc/yum.conf.d/*. If your baseurl has macros such as $basearch or $releasever you must use whatever values make sense for you instead, such as "i386" and "3".

Smart does not support old-style YUM repositories, only the newer XML-based RPM-MD format.

I want to install a new kernel package, but Smart says it is going to "upgrade" my old kernel packages. I don't want them removed, what should I do?

This question is irrelevant if you are not using RPM. DPKG and pkgtool do not support different versions of a package installed on a single system.

If you installed Smart on a supported distro, "kernel" should be one of the packages marked with a "multi-version" tag. You can check this by running this:

$ smart flag --show multi-version
multi-version
kernel
kernel-doc
kernel-smp
Or through Edit->Flags in the GUI, where you can also add your own multi-version packages. (or using smart flag --set multi-version <package> in the command line)

When you install a new kernel, Smart may display a dialog saying the new package "upgrades" your old packages. But unless those packages have as their icon they won't be removed. Installation of new multi-version packages does not imply the previous packages will be removed, even if they satisfy the requirements for an "upgrade" operation.

What does the little yellow star mean?

The yellow star means the package has changed since the last time you updated its channel. You can use View->Hide old to view only what changed since the last update.

How do I add mirrors? How does Smart choose which mirror to use?

In the GUI, go to Edit->Mirrors, click "New" and set your Origin URL and Mirror URL. Most likely you will be using whatever it is that you used as Base URLs for your repositories as Origin URLs. You may add as many Mirror URLs to an Origin URL as you wish, and you shouldn't worry too much about slow mirrors and mirrors going out of date. Smart automatically handles bad/inefficient mirrors and avoids them in the future.

Smart also supports downloading mirror information from Conectiva and up2date. In this case, you need to add a mirror channel. Go to Edit/Channels, click "New", the "Provide channel information", then pick either "Mirror information" for Conectiva-style mirror URLs or "Mirror information (up2date format)" if you want up2date-style mirror URLs.

up2date mirror URLs may be acquired from /etc/sysconfig/rhn/sources. The entries that begin with "yum-mirror" point to up2date mirror files. If you are using Fedora you probably already have a mirror channel configured by default.

Please notice that mirror channels will not show up in Edit/Mirrors in the GUI, only in Edit->Channels.

Several channels provide an identically-named package. Which of the packages does Smart use? Can I change that?

All channels are created equal. Smart will attempt to upgrade to the newest package. If you wish to override that, you may assign priorities to channels and packages. To configure your channel priorities, go to Edit->Channels, pick a channel, click Properties and set a value in Priority. Highest numbers imply higher priority.

If you want more granularity, you can define priorities for individual packages in individual channels. To do that, right-click the package and select "Priority". This setting overrides channel priorities.

If you are familiar with packaging, think of Priorities as user-defined "epochs".

While priorities are powerful, they are also dangerous. A channel with higher priority will always have precedence over other channels, including your local package database. It is easy to get in a situation where your system has to downgrade packages because a remote, out-of-date channel has higher priority than your installed packages. If all you want to do is be sure that your vendor's packages are preferred over third-party packages, it may be easier and safer to lower the third-party channel to a priority below zero (zero being the default) rather than increasing other priorities.

(In fact, priorities are more complicated than this, and in some situations Smart may choose a package in a channel with a lower priority. Priorities influence the weight each possible transaction is given, so it does make a difference whether a priority is set to -1, -5 or -100. The exact way this works is, for now, undocumented.)

Can I lock a package so that Smart will never touch them?

Sure. Right-click them in the GUI and choose "Lock this version" or "Lock all versions", as you wish. Or use smart --set lock <package>. Notice that you may lock even packages that are not currently installed. In this case, Smart will never install the locked package.

Where does Smart save its settings?

Unlike most Unix utilities, not in a plain-text file. Even so, you can configure Smart fully through the command line.

I have a package on my disk. Can I use Smart to install it?

Yes. Use:

# smart install foo-1.1-1.i386.rpm

Smart will even download dependencies from remote channels if necessary, which is nifty.

The filename must end with a well-known package extension for this to work.

(Currently this does not work with DEB packages.)

I have a package on a remote URL. Can I use Smart to install it?

Sure, just use something like:

# smart install http://some.url/some/path/foo-1.1-1.i386.rpm

Packaging Smart

I want to package Smart for my favorite distribution, what should I do?

If your RPM version is 4.3, you probably want to include a patched rpmmodule.so (the Python RPM module) that makes readHeaderFromFD() available for Python applications. This patch is not strictly necessary and Smart will work just fine without it, though Smart will warn the user the first three times it is run about increased memory usage. This only really affects channel formats that use large header lists: installation CDs, APT-RPM and URPMI.

If your RPM version is 4.2 or older, you should be aware that RPM versions previous to 4.3 need a bugfix, available in the Smart source in contrib/patches/rpm4.2.2-python.patch. If this is your case you should almost certainly ship a patched rpmmodule.so with your Smart package, at least until your distribution has picked up the fix. The patch for RPM 4.2 includes the readHeaderFromFD() patch.

You may want to check the Fedora Core RPM package as a guide.

What's the deal with that distro.py file?

distro.py is a distribution-dependent Python file that is executed every time Smart is run. Since Smart supports several underlying packaging systems, you should at the very least have it configure your own distribution's native package system as a channel the first time it is run, and maybe even your distribution's main and update channels. If you don't have rpm or rpm2cpio handy, grab a sample distro.py file here.

The distro.py file can do pretty much anything. For example, you could use iface.ask*() to request the user's interactive input. But try to keep things as simple as possible.

Each channel has different options. Run smart channel --help to list know channel types, then smart channel --help-type <channel> to list all available options.

Credits

Who wrote Smart?

Smart was written by Gustavo Niemeyer of Conectiva, and it was first released to the public on December 04, 2004.

Among other things, Niemeyer mantains APT-RPM and Synaptic.


Suggestions? Mail me.