Usefull Commands: dpkg, apt and aptitude

  • List all installed packages:
    dpkg -l
    
  • Clean aptitude local cache:
    apt-get clean
    
  • Uninstall a package throughly:
    apt-get remove --purge my_package
    
  • Remove orphaned pakages:
    deborphan | xargs apt-get -y remove purge
    
  • Show the changelog of a package (here, the linux kernel of Ubuntu):
    aptitude changelog linux-generic
    
  • Remove dpkg lock file:
    rm /var/lib/dpkg/lock
    

2 Responses to “Usefull Commands: dpkg, apt and aptitude”


  • apt-get autoclean
    

    is also an interesting feature. It purges obsolete package cache.

  • @djib: thanks for the tip ! Actually I delegate all these tasks to cron-apt. If you don’t know it, you should give it a chance: it really save you time.

Leave a Reply