Introduction to the dpkg command in Linux

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.

Introduction to dpkg command in Linux Introduction to dpkg command in Linux

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

Introduction to dpkg command in Linux Introduction to dpkg command in Linux

install software

sudo dpkg -i /var/cache/apt/archives/fdisk_2.34-0.1ubuntu9.1_amd64.deb

Introduction to dpkg command in Linux Introduction to dpkg command in Linux

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

Introduction to dpkg command in Linux Introduction to dpkg command in Linux

dpkg -s fdisk#Query the detailed information of the software package

Introduction to dpkg command in Linux Introduction to dpkg command in Linux

Display all installed deb packages, and display the version number and summary description

dpkg -l

Introduction to dpkg command in Linux Introduction to dpkg command in Linux

dpkg -l |grep fdisk

Introduction to dpkg command in Linux Introduction to dpkg command in Linux

Remove package

sudo dpkg -P fdisk

Introduction to dpkg command in Linux Introduction to dpkg command in Linux

#Uninstall the software package, do not retain the configuration, -r retain the configuration.

Guess you like

Origin blog.csdn.net/yaxuan88521/article/details/114964984