Apt-get/dpkg

From Briki
Jump to: navigation, search

Command Summary

  • apt-get - install and remove stuff
    apt-get install package 
    install package
    apt-get install package=version 
    install specified version of package
    apt-get update  
    update sources
    apt-get upgrade 
    upgrade all upgradeable packages
    apt-get dist-upgrade 
    upgrade all upgradeable packages, including installing new packages where dependencies have changed
    apt-get remove package 
    remove package
  • apt-cache - find information on packages
    apt-cache search regexp 
    search packages names and descriptions for regexp
    apt-cache show package 
    show package info
    apt-cache policy package 
    show installed and available versions of package
  • apt-file - look for files contained within packages
    apt-file update 
    update file contents lists
    apt-file search string 
    search package contents for file name/path containing string
    apt-file list package 
    list files in package
  • dpkg - information on installed packages
    dpkg -s package 
    show status of package
    dpkg -L package 
    list files in package
    dpkg --get-selections 
    list all installed packages
  • wajig - wrapper for apt-get, dpkg, dpkg-deb, apt-cache, and other tools
    wajig hold package 
    stop package being upgraded as part of normal upgrade or dist-upgrade
    wajig unhold package 
    revert held status of package

Solving public key errors

Errors like:

W: GPG error: http://packages.freecontrib.org edgy-plf Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F120156012B83718
W: You may want to run apt-get update to correct these problems

can be fixed by finding out the location for the relevant sites public key, and installing the key using:

wget http://packages.freecontrib.org/ubuntu/plf/12B83718.gpg -O- | sudo apt-key add -