Useful commands

apt-cache

  • apt-cache search package - search for package in local database
  • apt-cache depends package - check package dependencies
  • apt-cache rdepends package - check package reverse dependencies

apt-get

  • apt-get update - update local package database
  • apt-get upgrade - upgrade packages to newest version if available
  • apt-get install package - install package
  • apt-get install --reinstall package - reinstall package
  • apt-get autoclean - remove packages which are not needed anymore
  • apt-get clean - remove all downloaded packages from /var/cache/apt/archives
  • apt-get remove package - remove package
  • apt-get --purge remove package - purge package with configuration files

apt-file

  • apt-file search filename - search for filename within local package database

dpkg

  • dpkg -l - list all packages
  • dpkg -L package - list of files and directories intalled through that package
  • dpkg -S filename - search for filename
  • dpkg -r package - remove package
  • dpkg -P package - purge package with all configuration files
  • dpkg -i package - install a package
  • dpkg -i --force-all package - use only in critical situations :-)

dpkg vs. rpm


dpkgrpminfo
dpkg -lrpm -qaList all installed packages
dpkg -L packagerpm -ql packageList all files in a installed package
dpkg -i file.debrpm -i file.rpmInstall package from a file
dpkg -i file.debrpm -U file.rpmUpgrade package from a file
dpkg -r packagerpm -e packageRemove installed package
dpkg -l file.deb rpm -qpi file.rpmShow information about package
dpkg -c file.deb rpm -qpl file.rpmList files in a package
dpkg -p package rpm -qi packageShow information about a installed package