Installing packages in Debian/Ubuntu servers

of packages in Debian and Ubuntu servers



There are multiple tools that are used to manage Debian packages, from graphic or text-based interfaces to the low level tools used to install packages. All the available tools rely on the lower level tools to properly work.


dpkg (short for Debian package) is the base of the Debian package management system. dpkg
is similar to
RPM, as it is used to install, remove, and provide information about .deb packages.

dpkg itself is a low level tool; higher level tools, such as APT, are used to fetch packages from remote locations or deal with complex package relations. End users are encouraged to use tools like aptitude or synaptic, having a more sophisticated way of dealing with package relationships and a friendlier interface.

The Debian package “dpkg” provides the dpkg program, as well as several others necessary for run-time functioning of the packaging system,

dpkg-shlibdeps calculates the dependencies of runs with respect to libraries.

  • dpkg-genchanges reads the information from an unpacked Debian tree source that once
    constructed creates a control file (.changes).

  • dpkg-buildpackage is a control script that can be used to construct the package automatically.

  • dpkg-distaddfile adds a file input to debian/files.

  • dpkg-parsechangelog reads the changes file (changelog) of an unpacked Debian tree source and creates a conveniently prepared output with the information for those changes.

  • dpkg -l adduser
  • Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
 |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
 ||/        Name       Version Description================================================================ii  adduser     3.64                   Add and remove users and groups
  • dpkg -i ‘deb fileName’ to install the deb package. dpkg –install foo_VVV-RRR.deb.
  • Print out the control file (and other information) for a specified package: dpkg –info foo_VVV-RRR.deb
  • Unpack (but do not configure) a Debian archive into the file system of the hard disk: dpkg –unpack foo_VVV-RRR.deb Remove a package (but not its configuration files):
    dpkg –remove foo.
  • Remove a package (including its configuration files): dpkg –purge foo.
  • List the installation status of packages containing the string (or regular expression) “foo*”: dpkg –list ‘foo*’.


APT is the Advanced Package Tool and provides the apt-get program. apt-get provides a simple way to retrieve and install packages from multiple sources using the command line. Unlike dpkg, apt-get does not understand .deb files, it works with the packages proper name and can only install
.deb archives from a source specified in /etc/apt/sources.list. apt-get will call dpkg directly after
downloading the .deb archives from the configured sources.


  • To update the list of package known by your system, you can run:

    apt-get update

  • To upgrade all the packages on your system, run:

       apt-get upgrade
  • To install the foo package and all its dependencies, run:

     apt-get install foo
  • To remove the foo package from your system, run:
     apt-get remove foo
  • To upgrade all the packages on your system to a new Debian GNU/Linux release, run:
         apt-get dist-upgrade
  • To remove the foo package and its configuration files from your system, run:

         apt-get --purge remove foo
    The apt tool suite also includes the apt-cache tool to query the package lists. You can use it to find packages providing specific functionality through simple text or regular expression queries and through queries of dependencies in the package management system.

  • To find packages whose description contain word:
    apt-cache search word

    • To print the detailed information of a package:
           apt-cache show package
    • To print the packages a given package depends on:
           apt-cache depends package
    • To print detailed information of the versions available for a package and the packages that reverse-depends on it:
           apt-cache showpkg package


      aptitude is a package manager for Debian GNU/Linux systems that provides a frontend to the apt package management infrastructure. aptitude is a text-based interface using the curses library, it can be used to perform management tasks in a fast and easy way.


    • aptitude offers access to all versions of a package. 
    • aptitude logs all its actions in /var/log/aptitude.
    • aptitude makes it easy to keep track of obsolete software by listing it under “Obsolete and Locally Created Packages”.
    • aptitude includes a fairly powerful system for searching particular packages and limiting the package display. Users familiar with mutt will pick up quickly, as mutt was the inspiration for the expression syntax.
    • aptitude tracks which packages have been installed due to dependencies and removes them automatically when the packages that needed them are removed from the system.
    • aptitude can automatically install Recommended: packages.
    • aptitude can be used to install the predefined tasks available.
    • aptitude in full screen mode has su functionality embedded and can be run by a normal user. It will call su (and ask for the root password, if any) when you really need administrative privileges


      Leave a Reply

      Fill in your details below or click an icon to log in: Logo

      You are commenting using your account. Log Out / Change )

      Twitter picture

      You are commenting using your Twitter account. Log Out / Change )

      Facebook photo

      You are commenting using your Facebook account. Log Out / Change )

      Google+ photo

      You are commenting using your Google+ account. Log Out / Change )

      Connecting to %s