DebianbasedLinuxsystem (Ubuntu) package management tool

Source: Internet
Author: User
Apt-* view, install, delete, and update packages. 1. apt-cachesearch: SearchRepositoryUsingPackageNameapt-cachesearch ^ package name $ search for the package name in the Repo, and search for Apache2 as an example $ apt-cachesearch ^ apache

Apt-* view, install, delete, and update packages.

1. apt-cache search: Search Repository Using Package Name

Apt-cache search ^Package name$

Search for the package name in the Repo. Take Apache 2 as an example.

  1. $ Apt-cache search ^ apache2 $
  2. Apache2-Apache HTTP Server metapackage

2. apt-cache search: Search Repository Using Package Description
Apt-cache search + package description. Sometimes you do not know the package preparation name. You can search for the package description.

  1. $ Apt-cache search "Apache HTTP Server"
  2. Apache2-Apache HTTP Server metapackage
  3. Apache2-doc-Apache HTTP Server documentation
  4. Apache2-mpm-event-Apache HTTP Server-event driven model
  5. Apache2-mpm-prefork-Apache HTTP Server-traditional non-threaded model
  6. Apache2-mpm-worker-Apache HTTP Server-high speed threaded model
  7. Apache2.2-common-Apache HTTP Server common files

3. apt-file search: Search Repository Using a Filename from the Package

Any file name in the apt-file search + package. Sometimes, you only know the configuration file in the package or the possibly executable file. You can also use this information to find the package.

  1. $ Apt-file search apache2.conf
  2. Apache2.2-common:/etc/apache2/apache2.conf
  3. Apache2.2-common:/usr/share/doc/apache2.2-common/examples/apache2/apache2.conf.gz

4. apt-cache show: Basic Information About a Package

The apt-cache show + package displays the basic package information.

  1. $ Apt-cache show apache2
  2. Package: apache2
  3. Priority: optional
  4. Maintainer: Ubuntu Core Developers
  5. Original-Maintainer: Debian Apache Maintainers
  6. Version: 2.2.11-2ubuntu2. 3
  7. Depends: apache2-mpm-worker (>= 2.2.11-2ubuntu2. 3)
  8. | Apache2-mpm-prefork (>= 2.2.11-2ubuntu2. 3)
  9. | Apache2-mpm-event (>= 2.2.11-2ubuntu2. 3)
  10. Filename: pool/main/a/apache2/apache2_2.2.11-2ubuntu2.3_all.deb
  11. Size: 46350
  12. Description: Apache HTTP Server metapackage
  13. The Apache Software Foundation's goal is to build a secure, efficient and
  14. Extensible HTTP server as standards-compliant open source software.
  15. Homepage: http://httpd.apache.org/

5. apt-cache showpkg: Detailed Information About a Package

The apt-cache showdpkg + package displays more detailed information about the package.

  1. $ Apt-cache showpkg apache2
  2. Package: apache2
  3. Versions:
  4. 2.2.11-2ubuntu2. 3 (/var/lib/apt/lists/us.archive.ubuntu.com _ ubuntu_dists_jaunty-updates_main_binary-i386_Packages) (/var/lib/apt/lists/security.ubuntu.com _ ubuntu_dists_jaunty-security_main_binary-i386_Packages)
  5. Description Language:
  6. File:/var/lib/apt/lists/us.archive.ubuntu.com _ ubuntu_dists_jaunty-updates_main_binary-i386_Packages
  7. MD5: d24f049cd70ccfc178dd8974e4b1ed01
  8. Reverse Depends:
  9. Squirrelmail, apache2
  10. Squid3-cgi, apache2
  11. Phpmyadmin, apache2
  12. Mahara-apache2, apache2
  13. Ipplan, apache2
  14. Dependencies:
  15. 2.2.11-2ubuntu2. 3-apache2-mpm-worker (18 2.2.11-2ubuntu2. 3) apache2-mpm-prefork (18 2.2.11-2ubuntu2. 3) apache2-mpm-event (2 2.2.11-2ubuntu2. 3)
  16. 2.2.11-2ubuntu2-apache2-mpm-worker (18 2.2.11-2ubuntu2) apache2-mpm-prefork (18 2.2.11-2ubuntu2) apache2-mpm-event (2 2.2.11-2ubuntu2)
  17. Provides:
  18. 2.2.11-2ubuntu2. 3-
  19. 2.2.11-2ubuntu2-
  20. Reverse Provides:
  21. Apache2-mpm-itk 2.2.6-02-1build4.3
  22. Apache2-mpm-worker 2.2.11-2ubuntu2. 3
  23. Apache2-mpm-prefork 2.2.11-2ubuntu2. 3
  24. Apache2-mpm-prefork 2.2.11-2ubuntu2
  25. Apache2-mpm-event 2.2.11-2ubuntu2

6. apt-file list: List all the Files Located Inside a Package
Apt-file list + package: displays all files in the package.

  1. $ Apt-file list apache2 | more
  2. Apache2:/usr/share/bug/apache2/control
  3. Apache2:/usr/share/bug/apache2/script
  4. Apache2:/usr/share/doc/apache2/NEWS.Debian.gz
  5. Apache2:/usr/share/doc/apache2/README.Debian.gz
  6. Apache2:/usr/share/doc/apache2/changelog.Debian.gz
  7. ...

7. apt-cache depends: List all Dependent Packages

The apt-cache depends + package displays all dependencies of the package. Check all dependencies of the installation package before installing the package.

  1. $ Apt-cache depends apache2
  2. Apache2
  3. | Depends: apache2-mpm-worker
  4. | Depends: apache2-mpm-prefork
  5. Depends: apache2-mpm-event

8. dpkg-l: Is the Package Already Installed?

Dpkg-l: displays all installation packages in the system

9. apt-get install: Install a Package

Apt-get install + package and installation package.

10. apt-get remove: Delete a Package

Apt-get remove/purge: delete a package

Apt-get removeWillNotDelete the configuration files of the package

Apt-get purgeWill delete the configuration files of the package

11. apt-get-u install: Upgrade a Specific Package

Apt-get-u install + package to update the installation package.

12. apt-get-u upgrade: Upgrade all Packages

Update all installation packages.

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.