Summary Ubuntu apt-get apt-cache Command use

Source: Internet
Author: User

http://rsljdkt.iteye.com/blog/1142463

Apt-cache Search Wubipinyin

The Apt-get command itself does not have the ability to manage packages, but provides a command-line platform for package management.

Use richer subcommands on this platform to accomplish specific management tasks.

The general syntax format for the Apt-get command is:

SH code
    1. Apt-get subcommands [-D |-f |-m |-Q |--purge |--reinstall |-B |-S |-y |-u |-H |-v] [PKG]

The Apt-cache provides search functionality.

Note: In the following command, the contents of the angle brackets are determined by the user, such as <pkg> can be replaced with the actual package name Mysql-server.

1. Update or upgrade operation:

SH code
    1. Apt-get Update # Updates source
    2. Apt-get Upgrade # Update all installed packages
    3. Apt-get Dist-upgrade # Release Upgrade (for example, from 10.10 to 11.04)

2. Install or reload the class operation:

SH code
    1. Apt-get Install <pkg> # installation package <pkg>, multiple packages separated by spaces
    2. Apt-get Install--reinstall <pkg> # Reinstall package <pkg>
    3. Apt-get install-f <pkg> # Repair installation (broken dependencies) package <pkg>

3. Uninstall the class operation:

SH code
    1. Apt-get Remove <pkg> # Remove package <pkg> (not including profile)
    2. Apt-get Purge <pkg> # Delete package <pkg> (including configuration file)

4. Download the Purge class operation:

SH code
  1. Apt-get source <pkg> # Download pkg package source code to current directory
  2. apt-get download <pkg> # download PKG Package binary package to current directory
  3. Apt-get source-d <pkg> # After downloading the source package, compile
  4. Apt-get BUILD-DEP <pkg> # Build a dependent environment for PKG source packages (compiled environment? )
  5. Apt-get Clean # Clears all downloaded packages in cache (/var/cache/apt/archives/{,partial})
  6. Apt-get AutoClean # is similar to clean, but clears the expired packages in the cache (that is, packages that cannot be downloaded or are useless)
  7. Apt-get Autoremove # Remove dependencies that are automatically installed due to installation software, and now do not require a dependency package

5. Query the class operation:

SH code
    1. Apt-cache Stats # Displays statistics for the system software package
    2. Apt-cache Search <pkg> # Searching for packages using the keyword pkg
    3. Apt-cache Show <pkg_name> # shows details of package Pkg_name
    4. Apt-cache depends <pkg> # see which packages the pkg depends on
    5. Apt-cache rdepends <pkg> # View Pkg is dependent on those packages

6. Description of the Software installation directory:

The generic Deb package (including new or apt-get downloads) is/usr/share.

You download the compressed package or compiled package, some can choose to install the directory, generally placed in the/usr/local/, also in the/opt.

7. About the Apt-get cache directory:

The default cache directory is/var/cache/apt/archives/

In order to install the software after reinstalling the system later or to save the download time or to use the package for others, you can compress the package in the directory to save space after compressing the backup.

Summary Ubuntu apt-get apt-cache Command use

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.