dpkg is a tool for installing, building, deleting and managing Debian packages. All linux distributions originating from "Debian" can use the dpkg command , such as Ubuntu. |
grammar:
dpkg (option) (parameter)
Options:
-i: install the package
-r: delete the package
-P: delete the configuration file while deleting the package
-L: Display the files associated with the package
--unpack: Unpack the package
-c: display a list of files in the package
-configure: configure the software package
parameter:
deb package
List the contents of the deb package or the directory structure in the file
sudo dpkg -c /var/cache/apt/archives/fdisk_2.34-0.1ubuntu9.1_amd64.deb
install software
sudo dpkg -i /var/cache/apt/archives/fdisk_2.34-0.1ubuntu9.1_amd64.deb
fdisk_2.34-0.1ubuntu9.1_amd64.deb has been downloaded to the computer software package.
Query package
dpkg -l fdisk#Query the version of the software package
dpkg -L fdisk#Query the files associated with the software package
dpkg -s fdisk#Query the detailed information of the software package
Display all installed deb packages, and display the version number and summary description
dpkg -l
dpkg -l |grep fdisk
Remove package
sudo dpkg -P fdisk
#Uninstall the software package, do not retain the configuration, -r retain the configuration.