Using APT in RedHat Linux

    A Smarter Way of Handling Dependencies


    • Package Management
      • Dependency Hell
    • Introducing APT
      • Getting Started
      • Using APT

    • Back...


      Package Management

      These days, most software you may want to use on your Linux system comes prepackaged in binary form in addition to the sources. Contrary to commercial, proprietary software, a binary distribution is an addition to the source code - it is not a target in itself. It is there merely to make installation and deinstalltion of software easier, faster, and cleaner.

      A lot of software depends on parts of other packages, usually shared libraries but sometimes also complete executables, to function correctly. The relation between software that is installed on a system, or is scheduled to be installed, is called a dependency. You cannot install a package that depends on other packages without installing them also, and you cannot deinstall software that other packages depend on. The package management system, in Redhat's case RPM will keep you from doing that.

      Dependency Hell

      An integral part of package management is to keep track of these dependencies and take care they are not broken, which may render parts of or the entire system unusable. Fulfilling these dependencies, however, is a manual process, and this is where the RPM system has shortcomings and APT can change things for the better.

      Introducing APT

      APT is a system developed for Debian Linux that has become renown for offering unprecedented luxury in updating, upgrading, and maintaining software packages on Linux systems. In a nutshell, APT maintains a database of package dependencies encompassing not only software installed on a system, but all packages being available from one or several repositories. It will automatically check for dependencies when a (de-)installtion request is issued, and offer to download and install any packages that are required.

      Even though it was designed to work with Debian's package format, .deb, the actual package manager commands are seperate from the APT system, and as such it can work using RPM also. Packages ported for various releases of Redhat Linux are available from http://freshrpms.net/.

      Getting Started

      In a nutshell, this is what you need to do:

      • download RPMs from freshrpms.net and install
      • check /etc/apt/sources.list for correctness
      • (optional) put proxy into /etc/apt/apt.conf:
                Acquire
                {
                        http::Proxy "http://my.proxy.xxx:3128";
                        ftp
                        {
                                Proxy "ftp://my.proxy.xxx:3128"
                        };
                };

      • apt-get update
      • apt-get -f install (check for errors)
      • optional: install Synapsis (graphical tool)

      Using APT

      apt-get update will synchronize your local APT configuration files with the current version available on the servers specified in the /etc/apt/sources.list. Execute this once a day before starting work with APT.

      apt-get upgrade will upgrade all currently installed RPMs to the latest version available on the servers. It will not install additional RPMs unless the new packages have changed dependencies.

      apt-get install <package> will install the package named <package>, including all unmet dependencies. You will be prompted to confirm the installtion.

      apt-cache search <package/file> searches through the cached APT repositories for a package or package contents named <package/file>.

      Synaptic, a graphical tool, can be used to execute these commands without actually having to memorize their syntax. It is available from Connectiva at: http://distro.conectiva.com.br/projetos/46/.


    Comments, Flames, Correspondence: <wfb@mtnsub.org> - $Id: apt-for-linux.html,v 1.4 2003/03/24 13:27:20 eedmgu Exp $