X
Tech

Linux package management is brilliant

Often times when something just works, we tend to take it for granted. I think software package management in Linux is one of those things.
Written by Chris Clay Clay, Contributor

Often times when something just works, we tend to take it for granted. I think software package management in Linux is one of those things. It just works. Time and time again I have to help people with packages in Windows, which makes me even more thankful for the solid package management system in Linux. Packages can be installed while software is currently being used, allowing changes to happen when the software is closed and reopened. Packages can also be removed/updated/installed while the user is actively using the computer, with a simple SSH connection to their PC. And, best of all, no rebooting is necessary, unless you are updating the kernel itself, which is pretty rare.

Remote package installation is very important in corporate environments. For this article, I'll focus on Fedora / Red Hat distributions, however Ubuntu and others have similar package management mechanisms. With a simple command like "rpm -i packagename.rpm", any package can be installed silently. However, using "rpm -ivh packagename.rpm" will provide the package install progress (if you are installing a whole batch of packages with a command like "rpm -ivh *.rpm"). Try this in Windows, it's nearly impossible to install in batches unless you write a custom script. Packages in Windows can be .zip files, self-extracting .exe files, and packaged by any one of several different installers like InstallShield, Wise, Microsoft Installer, and others. And what's even more frustrating is each package in Windows can have totally different options that need to be specified. Each product being installed is uniquely different. With RPM packages in Linux, the parameters are always the same, because they all use the RPM utility to install (RPM stands for Red Hat Package Manager).

The Yum (Yellowdog Updater Modified) utility gives you a link to the Linux distribution's repository, allowing you to update/install packages directly over the Internet. The really nice thing about Yum is that it decides what dependencies are needed, and downloads them all in one step automatically. Commonly with a lot of Linux packages, dependencies are needed as each component is provided as a separate package. This gives complete flexibility of your software management.

Recently I've been faced with updating Java remotely on both Windows and Linux. On the Windows systems, the MSI (Microsoft Installer) packages had to be extracted from the self-executing installation file from Oracle. Then a batch file had to be created to install Java, because no built-in mechanism was in place to silently install Java reliably. This had to be deployed across to the Windows PCs, and about 50% of the installations failed. On Linux, the RPM files were copied to the PCs, and installed with a simple "rpm -Uvh" command, and the update was done. (The -Uvh options provide instant feedback from the installation progress). Linux can also be set up to pull the packages from the JPackage repository, allowing administrators to simply run a command like "yum upgrade java" and the packages will be downloaded and installed on the fly. Adobe has a similar repository for updating Flash. Adding repositories allows Yum to find the packages automatically, and install them on the fly. Very very easy and extremely powerful.

Most distributions have a graphical utility for viewing, adding, and removing packages installed on the system. In Fedora / Red Hat / CentOS, it's called "Add/Remove Software" under the System menu. Ubuntu and other distributions have a similar application. Windows has similar functionality as well, called "Installed Programs" in Windows 7, or "Add/Remove Programs" in Windows XP. However in Windows, all packages work differently, which leads to inconsistencies. Want a file listing of a package? Just run "rpm -ql packagename" and it will list the contents and where they were placed on the filesystem. Try this in Windows, I bet it can't even be done. The RPM database on each system is a complete, clean, and efficient way to managing ALL installed software on the Linux system.

Editorial standards