Manage Debian packages with the Smart Package Manager

All the Extras

© Lead Image © Pei Ling Hoo , 123RF.com

© Lead Image © Pei Ling Hoo , 123RF.com

Article from Issue 155/2013
Author(s):

The Smart Package Manager makes everyday tasks of handling RPM and DEB packages simple but has a full set of controls for experts.

Package managers simplify the often complex processes involved in managing software on a Linux system. Some package managers operate at the command line, others use a graphical interface, and still others are web-based tools; however, most package managers are designed to work with a specific package format. That means if you migrate from a system that uses the RPM format (e.g., Fedora or RHEL) to a system that uses DEB packages (e.g., Debian or Ubuntu), you need to get used to a whole different collection of package tools … unless you get Smart.

Smart Package Manager (SmartPM) is an innovative tool that has gained fame as a package management system that lets you manage different package formats through a single interface. According to the project website, SmartPM supports both Red Hat's RPM and Debian's DEB formats, as well as the Mandriva/Mageia URPMI format. Additionally, it manages tarballs for Slackware.

This versatility means you only need to learn one package manager to work on nearly any Linux system. (Keep in mind, however, that SmartPM is not intended to let users mix and match random formats on a single system. See the box titled "Not a Magic Bridge.")

Not a Magic Bridge

Although SmartPM supports several package formats, be aware that a multipackage system presents some limitations. The Smart Package Manager project is quick to point out that it is "not a magical bridge between every distribution in the planet." They add, "Instead, this is software offering better package management for these distributions when working with their native packages. Using multiple packaging systems at the same time (like rpm and dpkg) is possible but would require packages from those systems to follow the same packaging guidelines. As this is not the case at the moment, mixing package systems is not recommended" [1].

One look at the SmartPM documentation makes it clear that this vaunted package neutrality is only part of what makes SmartPM so smart. Another important feature is smart transactions. According to the SmartPM project, "While other software tries to find a possible solution to satisfy the relations involved in some user-requested operation, and sometimes even fails to do so, SmartPM goes beyond it. In the kernel of Smart Package Manager lives an algorithm that will not only find a solution, if one is available, but will find the best solution. This is done by quickly weighting every possible solution with a pluggable policy, which redefines the term 'best' depending on the operation goal (install, remove, upgrade, etc.)" [2]. This smart transaction capability means that SmartPM might not choose the latest version of a package if it determines an older version will provide a better overall result for the system.

SmartPM also lets you assign priorities to packages or package sources, so you can give preferred formats an advantage. In SmartPM, external packages are accessed through channels. Each channel supports a specific package type (see Table 1), and you can assign priorities by channel or package name.

Table 1

SmartPM Channels

APT-DEB Repository

APT-RPM Repository

DPKG Installed Packages

Mirror Information

Red Carpet Channel

RPM Directory

RPM Header List

RPM Metadata (YUM)

RPM Installed Packages

Slackware Repository

Slackware Installed Packages

URPMI Repository

In addition to providing a universal GUI for managing Linux packages, SmartPM also has a powerful command-line interface for full control of the package management environment. In this article, I focus on using SmartPM with DEB-based distributions.

Installation

The program is available from the project website [1]. Alternatively, you can enter

sudo apt-get update
sudo apt-get install smartpm

to install the python-smartpm, smartpm-core, and smartpm packages.

Various operating modes are enabled when launching the program. The graphical user interface (GUI) can be accessed with the use of the --gui option, whereas the interactive application for the console is launched by setting the --shell flag.

This interface is similar to Apt and Aptitude. Adding the --gui option to the call tells SmartPM to change to graphics mode before running.

Graphical Mode

Because you will be installing and changing base packages, you will need administrative privileges, so start SmartPM in GUI mode with:

sudo smart --gui

Otherwise, you will get the error Unable to create channel directory.

Interface

The graphical interface includes a menu bar and a row of buttons. The overview includes the software categories, information about the packages, and matching details. At the bottom of the window you will see the status bar with the total number of available and installed packages (Figure 1).

Figure 1: Easy to use and well structured, SmartPM simplifies software package management.

The File menu has options to upgrade channels and rebuild the cache. The File | Update Channels item updates the lists of package information. An individual update is possible by choosing File | Update Selected Channels (Figure 2). So far, only SmartPM offers this function, although it has been on the wishlist of extensions [3] for Apt and Aptitude for a long time.

Figure 2: If you prefer, you can update individual software lists and save time when downloading.

The Edit menu lets you check packages for unresolved dependencies, manage repositories, select packages, and change priorities. Edit | Priorities lets you edit priorities you've already set up. Right-clicking a program and choosing Priority allows you to specify how the program evaluates sources. Figure 3 shows this for the gnome-sudoku package.

Figure 3: Priorities let you determine which sources SmartPM considers in retrieving software.

The Views menu lets you filter the display in the package selection list; for example, you can filter for non-upgradable, unlocked, or installed packages. Selecting Views | Tree Style lets you toggle between sorting by categories, package sources, or package groups.

The Help menu takes you to information about the program version and an overview of the icons used by SmartPM to indicate the status of a package. Important menu items are also implemented as buttons, such as correcting recent changes and updating all installed packages.

The text you enter in the search box on the right acts as a filter for the package list. Right-clicking the magnifying glass reveals two choices: Automatic and Description. Automatic searches file names for the text entered, whereas Description searches the package descriptions for the entered text. Figure 1 shows entries in which the smartpm string occurs in the package name.

After selecting a package from the list, SmartPM shows you more details at the bottom of the window. In addition to general information, such as the status, priority, group, size, package source, and URL, you will find the description and the list of files that the package includes (Content).

The Changelog tab provides information on development, and you can see other packages on which the program depends or that are recommended for the program (Relations).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Smart Package Manager

    The package manager is one of the central components on any Linux system. If you have a system with unreliable package management – such as Suse Linux 10.1 – you may want to consider the Smart alternative.

  • Command Line: Yum

    The RPM package manager Yum has its own advantages over other tools.

  • A Taste of Yum

    Install and manage packages from the command line with the powerful yum package manager.

  • SSH Reverse Tunnels

    We’ll show you a practical project for monitoring home energy usage with SSH and OpenWrt.

  • Yum

    The RPM package manager Yum has its own advantages over other tools.

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News

njobs Europe
What:
Where:
Country:
Njobs Netherlands Njobs Deutschland Njobs United Kingdom Njobs Italia Njobs France Njobs Espana Njobs Poland
Njobs Austria Njobs Denmark Njobs Belgium Njobs Czech Republic Njobs Mexico Njobs India Njobs Colombia