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.
- $ Apt-cache search ^ apache2 $
- 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.
- $ Apt-cache search "Apache HTTP Server"
- Apache2-Apache HTTP Server metapackage
- Apache2-doc-Apache HTTP Server documentation
- Apache2-mpm-event-Apache HTTP Server-event driven model
- Apache2-mpm-prefork-Apache HTTP Server-traditional non-threaded model
- Apache2-mpm-worker-Apache HTTP Server-high speed threaded model
- 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.
- $ Apt-file search apache2.conf
- Apache2.2-common:/etc/apache2/apache2.conf
- 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.
- $ Apt-cache show apache2
- Package: apache2
- Priority: optional
- Maintainer: Ubuntu Core Developers
- Original-Maintainer: Debian Apache Maintainers
- Version: 2.2.11-2ubuntu2. 3
- Depends: apache2-mpm-worker (>= 2.2.11-2ubuntu2. 3)
- | Apache2-mpm-prefork (>= 2.2.11-2ubuntu2. 3)
- | Apache2-mpm-event (>= 2.2.11-2ubuntu2. 3)
- Filename: pool/main/a/apache2/apache2_2.2.11-2ubuntu2.3_all.deb
- Size: 46350
- Description: Apache HTTP Server metapackage
- The Apache Software Foundation's goal is to build a secure, efficient and
- Extensible HTTP server as standards-compliant open source software.
- 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.
- $ Apt-cache showpkg apache2
- Package: apache2
- Versions:
- 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)
- Description Language:
- File:/var/lib/apt/lists/us.archive.ubuntu.com _ ubuntu_dists_jaunty-updates_main_binary-i386_Packages
- MD5: d24f049cd70ccfc178dd8974e4b1ed01
- Reverse Depends:
- Squirrelmail, apache2
- Squid3-cgi, apache2
- Phpmyadmin, apache2
- Mahara-apache2, apache2
- Ipplan, apache2
- Dependencies:
- 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)
- 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)
- Provides:
- 2.2.11-2ubuntu2. 3-
- 2.2.11-2ubuntu2-
- Reverse Provides:
- Apache2-mpm-itk 2.2.6-02-1build4.3
- Apache2-mpm-worker 2.2.11-2ubuntu2. 3
- Apache2-mpm-prefork 2.2.11-2ubuntu2. 3
- Apache2-mpm-prefork 2.2.11-2ubuntu2
- 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.
- $ Apt-file list apache2 | more
- Apache2:/usr/share/bug/apache2/control
- Apache2:/usr/share/bug/apache2/script
- Apache2:/usr/share/doc/apache2/NEWS.Debian.gz
- Apache2:/usr/share/doc/apache2/README.Debian.gz
- Apache2:/usr/share/doc/apache2/changelog.Debian.gz
- ...
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.
- $ Apt-cache depends apache2
- Apache2
- | Depends: apache2-mpm-worker
- | Depends: apache2-mpm-prefork
- 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.