Liunx Xinxue-dpkg of ubuntu software package management tool

Source: Internet
Author: User

Dpkg is a software package manager for Debian Linux systems. It can be installed, uninstalled, or created, but unlike other software package management systems, it cannot automatically download and install software packages, and cannot process dependencies between software packages. Therefore, it is mainly used to manage software packages that have been installed locally or installed with Deb software packages that have been downloaded.

To view all installed software packages on the current system, run the following command:

Dpkg-l

Many installation packages can be installed on the system, so the above command can output a lot of content. In this case, you can use the pipeline and grep command to check whether a specific software package is installed.

Dpkg-L | grep apache2
This command can check whether apache2 is installed. Of course, if you do not know the full name of a software package, you can also use a regular expression.

To view the files involved in the installation of a software package, for example, to view all related files of UFW software, you can use:

Dpkg-l UFW

If you do not know which package has a file installed, you only know a file name or its path. You can try the following command, it notifies you which installation package is installed or generated for a file.

Dpkg-S/etc/host. conf
Base-Files:/etc/host. conf

The output indicates that the/etc/host. conf file belongs to the base-files package. However, dpkg-S does not always tell you the answer.

If a software package has been downloaded locally, run the following command to install it:

Sudo dpkg-I zip_2.32-1_i386.deb

The following command may be used to uninstall a software package:

Sudo dpkg-r zip

However, it is generally not recommended to use dpkg to uninstall the software package, because it does not take into account the software dependency issue. When the software can be detached, other software dependent on the software package cannot work normally. It is best to use software packages with processing software dependencies.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.