active-technologies.com - Network Computer Services - Web Page Design and Hosting - QuickBooks & Bookkeeping Services            
  • Login

Network & Computer Services

  • Full Network - Computer Maintenance - Repair
  • Cloud - Servers - Desktops - Mobile
  • New Equipment Roll-outs
  • System Upgrade - Lifecycle Management
  • Windows - Linux - Office - LibreOffice
  • Backup Systems
  • WiFI & Barcode
  • Security - AntiVirus - Malware
  • System Design - Planning - Training
  • Purchase Equipment At Cost Through Us
  • On-site and On-line Service Service



Web Page Design & Optimization

  1. Drive Customers To Your Business
  2. Web Hosting and Maintenance
  3. Web and Mobile Web Sites
  4. Wordpress Customization
  5. Drupal CMS Customization
  6. Organic Search Engine Optimization (SEO)
  7. Local Search Engine Optimization (SEO)
  8. Website Re-Design and Intranets
  9. Online Shopping Carts & Catalogs
  10. Web Analytics and Reporting

QuickBooks & Bookkeeping Services

  • Quickbooks Online Certified
  • Quickbooks Desktop MultiUser
  • Building Construction Job Costing
  • Landscaping - Cleaning Services
  • Point of Sale and Warehousing
  • Installation Upgrades Support
  • Inventory
  • Payroll
  • Custom Reporting
  • 12+ Years Experience!

  • Home
  • About Us
  • Projects
  • Legalease
  • Green Policy
  • Recommendations
  • CIM Manufacturing Demo
  • Contact Us

You are here

Home | Open Source

Services

  • What We Do
  • Web Page Design
  • Mobile Web
  • Web Hosting
  • Identity Management
  • Search Optimization
  • Content Manager
  • Computer Repair
  • Network Service
  • Backup System
  • Network Assessment
  • Disaster Recovery
  • Data Recovery
  • Technology Planning
  • Technology Partner
  • AntiVirus
  • Quickbooks

Navigation

  • Chaos Tools AJAX Demo
  • Forums
  • Recent content

Ubuntu Debian Linux apt-get package management cheat sheet

Submitted by gma on Wed, 11/14/2012 - 10:28

nixCraft on May 9, 2005 · 17 comments· Last updated September 9, 2012

Both Debian and Ubuntu Linux provides a number of package management tools. This article summaries package management command along with it usage and examples for you.

Gui tools: You can also try GUI based or high level interface to the Debian GNU/Linux package system. Following list summaries them:

  • apt-get : APT is acronym for Advanced Package Tool. It supports installing packages over internet using ftp or http protocols. You can also upgrade all packages in a single operations, which makes it even more attractive.
  • dpkg : Debian packaging tool which can be use to install, query, uninstall packages.
    • aptitude: It is a text-based interface to the Debian GNU/Linux package system.
    • synaptic: GUI front end for APT

Red hat Linux package names generally end in .rpm, similarly Debian package names end in .deb, for example:

apache_1.3.31-6_i386.deb

Where,

  1. apache : Package name
  2. 1.3.31-6 : Version number
  3. i386 : Hardware Platform on which this package will run (i386 == intel x86 based system)
  4. .deb : Extension that suggest it is a Debian package

Remember whenever I refer .deb file it signifies complete file name, and whenever I refer package name it must be first part of .deb file. For example, when I refer to a package sudo it means sudo only and not the .deb file i.e. sudo_1.6.7p5-2_i386.deb. You can find out debian package name with the following command:

apt-cache search {package-name}
apt-cache search apache

Finally, most of the actions listed in this post are written with the assumption that they will be executed by the root user running the bash or any other modern shell.

apt-get add a new package

Add a new package called samba. The syntax is:

 
apt-get install {package-name}
 

To install a package called samba, run:

# apt-get install samba

apt-get remove the package called samba but keep the configuration files

The syntax is:

 
apt-get remove {package-name}
 

Example:

# apt-get remove samba

apt-get remove (erase) package and configuration file

The syntax is:

 
apt-get --purge remove {package-name}
 

Example:

# apt-get --purge remove samba

apt-get update (upgrade) package

The syntax is:

 
apt-get upgrade
 

To upgrade individual package called sudo, enter:
# apt-get install sudo

apt-get display available software updates

Following command will display the list of all available upgrades (updates) using -u option, if you decided to upgrade all of the shown packages just hit 'y'

# apt-get upgrade samba

However if you just wish to upgrade individual package then use apt-get command and it will take care of rest of your worries:

 
apt-get install {package-name}
 

dpkg command to get package information such as description of package, version etc.

The syntax is:

 
dpkg --info {.deb-package-name}
 

Example:

# dpkg --info sudo_1.6.7p5-2_i386.deb | less

List all installed packages

The syntax is:

dpkg -l

Example:

# dpkg -l

To list individual package try such as apache

# dpkg -l apache

You can also use this command to see (verify) if package sudo is install or not (note that if package is installed then it displays package name along with small description):

# dpkg -l | grep -i 'sudo'

To list packages related to the apache:

# dpkg -l '*apache*'

List files provided (or owned) by the installed package (for example what files are provided by the installed samba package). The syntax is:

 
dpkg -L {package-name}
 

Example:

# dpkg -L samba

(H) List files provided (or owned) by the package (for example what files are provided by the uninstalled sudo package). The syntax is:

 
dpkg --contents {.deb-package-name}
 

Example:

# dpkg --contents sudo_1.6.7p5-2_i386.deb

Find, what package owns the file /bin/netstat?

The syntax is:

 
dpkg -S {/path/to/file}
 

Example:

# dpkg -S /bin/netstat

Search for package or package description

Some times you don't know package name but aware of some keywords to search the package. Once you got package name you can install it using apt-get -i {package-name} command:

 
apt-cache search "Text-to-search"
apt-cache search "httpd"
apt-cache search "web server"
apt-cache search "web server"| grep something
 

Find out all the Debian package which can be used for Intrusion Detection

Type the following command:

# apt-cache search "Intrusion Detection"

Find out all sniffer packages, run:

# apt-cache search sniffer

Find out if Debian package is installed or not (status)

The syntax is:

 
dpkg -s {package-name} |  grep Status
 

Example:

# dpkg -s samba| grep Status

List ach dependency a package has...

Display a listing of each dependency a package has and all the possible other packages that can fulfill that dependency. You hardly use this command as apt-get does decent job fulfill all package dependencies. The syntax is:

 
apt-cache depends package
 

Display dependencies for lsof and mysql-server packages:

# apt-cache depends lsof
# apt-cache depends mysql-server

Further reading

  • Our dpkg cheat sheet
  • Our apt-get cheat-sheet
  • APT Howto
  • APT and Dpkg Quick Reference Sheet
‹ Ubuntu DVD Play Issue up Ubuntu File Type Control - Mime Control ›
  • Printer-friendly version
  • Log in to post comments
  • 3058 reads

News

  • News

References

  • Thunderbird
  • Outlook
  • Excel
  • Word
  • Access
  • General
  • Open Source
  • Mobile
  • Security
  • ShareWare
  • Site map
  • SEO News/Tips
  • Social Media

Search form

Copyright © 2004-2021 Active Technologies, LLC
Network Computer - Web Services - Quickbooks Provider
(Powered by active-technologies.com)

Search engine optimization