1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Discuss in my forum

Introduction to Linux

By Machtelt Garrels

7.5.3. Automating package management and updates

7.5.3.1. General remarks

The first thing you do after installing a new system is applying updates; this applies to all operating systems and Linux is not different.

The updates for most Linux systems can usually be found on a nearby site mirroring your distribution. Lists of sites offering this service can be found at your distribution's web site, see Appendix A .

Updates should be applied regularly, daily if possible - but every couple of weeks would be a reasonable start. You really should try to have the most recent version of your distribution, since Linux changes constantly. As we said before, new features, improvements and bug fixes are supplied at a steady rhythm, and sometimes important security problems are addressed.

The good news is that most Linux distributions provide tools so that you don't have to upgrade tens of packages daily by hand. The following sections give an overview of "package manager managers." There is much more to this subject, even regular updates of source packages is manageable automatically; we only list the most commonly known systems. Always refer to the documentation for your specific distribution for advised procedures.

7.5.3.2. APT

The Advanced Package Tool is a management system for software packages. The command line tool for handling packages is apt-get , which comes with an excellent man page describing how to install and update packages and how to upgrade singular packages or your entire distribution. APT has its roots in the Debian GNU/Linux distribution, where it is the default manager for the Debian packages. APT has been ported to work with RPM packages as well. The main advantage of APT is that it is free and flexible to use. It will allow you to set up systems similar to the distribution specific (and in some cases commercial) ones listed in the next sections.

Generally, when first using apt-get , you will need to get an index of the available packages. This is done using the command

apt-get update

After that, you can use apt-get to upgrade your system:

apt-get upgrade

Do this often, it's an easy way to keep your system up-to-date and thus safe.

Apart from this general usage, apt-get is also very fast for installing individual packages. This is how it works:


   

 
[david@jupiter ~] su - -c "apt-get install xsnow"
 Password:
 Reading Package Lists... Done
 Building Dependency Tree... Done
 The following NEW packages will be installed:
 xsnow
 0 packages upgraded, 1 newly installed, 0 removed and 3 not upgraded.
 Need to get 33.6kB of archives.
 After unpacking 104kB of additional disk space will be used.
 Get:1 http://ayo.freshrpms.net redhat/9/i386/os xsnow 1.42-10 [33.6kB]
 Fetched 33.6kB in 0s (106kB/s)
 Executing RPM (-Uvh)...
 Preparing... ########################################### [100%]
 1:xsnow ########################################### [100%]
 

Note the -c option to the su command, which indicates to the root shell to only execute this command, and then return to the user's environment. This way, you cannot forget to quit the root account.

If there are any dependencies on other packages, apt-get will download and install these supporting packages.

More information can be found in the APT HOWTO .

7.5.3.3. Systems using RPM packages

Update Agent , which originally only supported RedHat RPM packages, is now ported to a wider set of software, including non-RedHat repositories. This tool provides a complete system for updating the RPM packages on a RedHat or Fedora Core system. On the command line, type up2date to update your system. On the desktop, by default a small icon is activated, telleng you whether or not there are updates available for your system.

Yellowdog's Updater Modified (yum ) is another tool that recently became more popular. It is an

* License

* Introduction to Linux Index

  1. About.com
  2. Technology
  3. Linux

©2014 About.com. All rights reserved.