Debian Package Management Simplified


Published on

This is just a compilation of commands which are frequently used for debian package management

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Debian Package Management Simplified

  1. 1. These are some Debian specific commands which are used frequently for completely command line based Debian package management Using Aptitudeaptitude update fetches latest package list from server and updates local package listaptitude install <package_name> installs packageaptitude remove <package_name> removes package but its configuration filesaptitude purge <package_name> removes packages along with its configuration files Using aptitude searchaptitude search <search_pattern> e.g. aptitude search ~c~v Virtual Packages~U Upgradeable Packages~o Obsolete Packages~N New Packages~i Installed Packages~g Garbage Packages~c Removed packages with configuration files not removed~b Broken Packages~M Automatically Installed PackagesNote : Sometimes “aptitude search <pkg_name>” doesnt yield better results. One can use “apt-cache search <pkg_name>” in this case. Using dpkgdpkg -L <package_name> lists files installed for particular packagedpkg -S <file_name> shows which parent package the file belongs to e.g. dpkg -S /bin/ls dpkg -S $(which ls) dpkg -S /etc/apache2/apache2.confdpkg -l lists all available packages with their state (installed, not-installed etc)
  2. 2. Some more useful commandsapt-cdrom add adds CD / DVD to repository in /etc/apt/sources.listNote:* You should have at least following two lines in your /etc/apt/sources.listdeb stable main contrib non-freedeb stable/updates main contrib non-freeYou can replace "stable" with "testing" or "unstable". For moreinformation ... just Google it ;)* Make a habit of running "aptitude update" before installing any package,which ensures that you get latest updated version