APT: Difference between revisions

From Leo's Notes
This page was last edited on 1 October 2019, at 20:31.
m Leo moved page Apt, dpkg Tips & Tricks to APT: APT related software
List of commands for common tasks in an apt environment
Line 1: Line 1:
To list installed packages:
APT is the package manager on Debian based Linux distributions and includes {{code|apt-get}} and {{code|dpkg}} and related utilities.
dpkg -l


To look for a specific package by name:
== Usage ==
dpkg -l <package name>
{| class="wikitable"
! Task
! Command
|-
| Install a package by name
| {{highlight|lang=terminal|code=
# apt-get install <package>
}}
|-
| Remove a package by name
| {{highlight|lang=terminal|code=
# apt-get remove --purge
# apt-get autoremove <package>
}}
|-
| Upgrade a package
| {{highlight|lang=terminal|code=
# apt-get update
# apt-get upgrade <package>
}}
|-
| Search for a package
| {{highlight|lang=terminal|code=
# apt-cache search <package>
}}
|-
| List installed packages
| {{highlight|lang=terminal|code=
# dpkg -l
}}
|-
| Look for a specific package by name
| {{highlight|lang=terminal|code=
# dpkg -l <package name>
}}
|-
| Determine which package provided a file
| {{highlight|lang=terminal|code=
# dpkg -S <path to file>
}}


To determine the origin of a file:
|}
dpkg -S <path to file>
 
eg:
# dpkg -S /etc/rc3.d/
sysv-rc


{{Navbox Linux}}[[Category:Linux]]
{{Navbox Linux}}[[Category:Linux]]
[[Category:PackageManagement]]
[[Category:PackageManagement]]

Revision as of 20:31, 1 October 2019

APT is the package manager on Debian based Linux distributions and includes apt-get and dpkg and related utilities.

Usage

Task Command
Install a package by name
# apt-get install <package>
Remove a package by name
# apt-get remove --purge
# apt-get autoremove <package>
Upgrade a package
# apt-get update
# apt-get upgrade <package>
Search for a package
# apt-cache search <package>
List installed packages
# dpkg -l
Look for a specific package by name
# dpkg -l <package name>
Determine which package provided a file
# dpkg -S <path to file>