Ubuntu / Debian Package Manager:
dpkg:
Ubuntu/Debian package management. (equivalent to rpm in functionality.)
-
Command Description dpkg -l List all packages installed on system. Often used with grep: dpkg -l | grep partial-name-of-package dpkg -l package-name Query version of package and if package is installed. dpkg -L package-name List all files on the system associated with the package. dpkg -S file-name List the package name to which this file is associated. dpkg -p file-name Print package information. See /var/lib/dpkg/available dpkg -i package-name.deb Install package.
Also see “apt-get install package-name“.dpkg -r package-name Remove package. Keep configuration files.
Also see “apt-get remove package-name“.dpkg -P package-name Remove package. Remove configuration files.
Also see “apt-get remove package-name“.
apt-get:
Ubuntu/Debian package installer using an internet repository. (equivalent to yum in functionality.)
| Command | Description |
|---|---|
| apt-get install package-name apt-get install package-1, package-2 |
Query repository for package and if package is available, download and install. |
| apt-get remove package-name | Remove package from system. Keeps configuration files. Use flag “–purge” to remove configuration files. |
| apt-get -s update or apt-get --simulate update |
Simulate apt-get actions to be taken but no action is performed. In this example, apt-get simulates an update. |
| apt-get update | Update the package index on the system to the latest version associated with the OS release in use. Only the index (package list) is changed. An update should always be performed before an upgrade |
| apt-get -s upgrade | The command will identify all packages to be upgraded without performing an upgrade. Stop any services targeted for upgrade before perfoming the upgrade. |
| apt-get upgrade | Upgrade all packages on the system to the newest versions of all the packages. The command will first identify all packages to be upgraded and then with permission, will perform an upgrade on the packages. Use flag “-y” to grant permission and avoid question. |
| apt-get dist-upgrade | Upgrade the OS and all packages on the system to the newest version. |
| apt-get source package-name | Download package source. |
| apt-get build-dep package-name | Configure build-dependencies for source packages. |
Uses the configuration file: /etc/apt/apt.conf
Uses the repository source list: /etc/apt/sources.list
-
Command Description apt-cache search package-name Query repositories to see if package is available.
Also see the man pages for: dpkg, dselect, apt-get, apt-cache, apt-cdrom (add CD-Rom to sources list), apt-config
A new installation requires use of the command: apt-get update before apt-get will work.
Please note: If you add a new repository you must execute the command: apt-get update. Attempting to install a package (apt-get install xxxxxxx) from a new archive without first updating, will give you the following error message:
Package xxxxxxx is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source