Linux Multi-Distro Package Manager Cheatsheet
Debian and Fedora (apt and yum)
The problem of managing software installs is one which is faced by all Linux distributions; but unfortunately, not all distros solve it the same way! If you're familiar with Debian's apt-get, you may be thrown by RedHat's yum, or OpenSUSE's Zypper, and vice versa. This handy cheatsheet is here to help when you suddenly find yourself facing an unfamiliar system.
Debian: aptitude and apt-get
Debian now has three options available for interacting with its packaging back-end, dpkg. Synaptic, the very graphical option, I won't tackle here as it's deliberately very self-explanatory. Aptitude is also graphical, but runs within a console using ncurses. To find a package, you can either browse through the package tree, or hit / to search for a particular string (then n to look for the next instance). Installed packages are shown in bold. To add a package for install, hit +; to remove an installed one, hit -, or _ to purge. Once you've done making changes, hit g to apply them, which will take you to a dependency resolution screen if necessary.
However, if you know what packages you're after, the command-line apt-get is your best bet. Here are the main commands you'll need:
|apt-get update||Update information from repositories. Do this before running any other commands.|
|apt-get install newpackage||Install newpackage|
|apt-get upgrade||Upgrade all packages that have available upgrades.|
|apt-get remove oldpackage||Remove oldpackage|
|apt-get remove --purge oldpackage||remove oldpackage and purge all associated files|
|dpkg-query --list "package*"||List packages matching the pattern given, and show whether they're installed (line begins ii) or not.|
To add a repository, edit /etc/apt/sources.list to add a couple of lines like this:
deb http://example.com/debian stable main deb-src http://example.com/debian stable mainThen run apt-get update to grab the information for the new repository.
Fedora (and other RPM systems): yum
Yum is the package manager used for RPM-based systems such as Fedora. (OpenSUSE uses RPMs, but the default tool is Zypper, which is covered in the next section). It's a command-line tool and here are the basic commands you'll need:
|yum install newpackage||Install newpackage|
|yum update [package]||Updates (upgrades) either all packages with updates available (if no argument given), or the specified package.|
|yum remove newpackage||Removes oldpackage.|
|yum info mypackage||Prints out information on the specified package (or use available or installed as the argument to get information on all available or installed packages).|
|yum search keyword||Searches name, summary, description, and URL fields for keyword|
|yum list [installed | available]||Lists all installed or available packages from your repositories|
|yum list updates||Lists updates available for installed packages (use yum check-updates for shell scripts, as this returns an exit code of 100 if there are updates avaiable)|
To add a repository, you should either edit /etc/yum.conf directly, or add an extra repository.repo file in /etc/yum.repos.d/, depending on your system setup. The file should look like this:
[reponame] name=Name RPM Repository baseurl=http://example.com/redhat/el$releasever/en/$basearch/repo gpgcheck=1 enabled=1You should be able to get this information from the repository webpage. If the gpgcheck parameter is switched on, you'll also need to grab the GPG key for the repository:
rpm --import http://example.com/packages/RPM-GPG-KEY.txt
Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.
- 1Linux Top 3: GNOME 3.12 and New Betas for Ubuntu 14.04 and OpenMandriva Lx 2014.0
- 2Linux Top 3: Linus Lashes out, Linux 3.14 Gets PIE and Ubuntu One is Done.
- 3Linux Top 3: Ubuntu 14.04, Debian Gives Squeeze More Life and Red Hat Goes Atomic
- 4Linux Top 3: Linux 3.11, Kubuntu Goes Commercial
- 5Linux Top 3: RHEL 6.5, Debian 7.2 and EOL for Linux 3.0.x