Apt-get Common Commands
One, what's the Apt-get
Premium Packaging Tools (English: Advanced packaging tools, abbreviation: APT) is a package manager for Debian and its derivative distributions (e.g., Ubuntu). Apt can automatically download, configure, install binary or source-code packages, thus simplifying the process of managing software on UNIX systems, Apt-get commands typically require root access, so follow the sudo command generally.
Two, apt-get Chinese parameter
Usage:
apt-get [Options] Command apt-get [options] Install|remove pkg1 [pkg2 ...]
Apt-get [options] Source pkg1 [pkg2 ...]
Apt-get is a simple command-line interface for downloading and installing packages. The most common commands are update (update) and install (installation).
Command:
Update-Retrieve the package list again
Upgrade-Update
Install-Installs a new package
Remove-Removes the package
Autoremove-automatic removal of all unused packages
Purge-removing packages and configuration files
Source-Download Source file
BUILD-DEP-Configuring compilation dependencies for source packages
Dist-upgrade-Release Version upgrade
Dselect-upgrade-Updated according to Dselect selection
Clean-Clears the downloaded archive file
AutoClean-Clean up old downloaded archived files
Check-check to see if there is a corrupted dependency
Options:
-h this Help file.
-Q Output To log-no progress indication
-QQ not output information, except for errors
-D Download only-do not install or unzip the archive file
-S is not actually installed. Simulation execution Commands
-Y assumes that all queries are selected, without prompting
-F try to fix system dependency damage
-M if the archive cannot be located, try to continue
-U displays a list of update packages at the same time
-B Get Source package compile-V Show detailed version number
-c=? Read this configuration file
-o=? Set custom configuration options, such as-O dir::cache=/tmp
Three, Apt-get common examples
Apt-cache Search packagename searching Package
Apt-cache show PackageName Get the information about the package, such as description, size, version, etc.
Apt-get Install packagename installation package
Apt-get Install packagename --reinstall Reinstall package
Apt-get-f install fix "-F =–fix-missing"
Apt-get Remove packagename Delete Package
Apt-get Remove packagename --purge Delete package, including deletion of configuration files, etc.
Apt-get Update Source
Apt-get Upgrade Update installed packages
Apt-get Dist-upgrade Upgrade System
Apt-get Dselect-upgrade using Dselect upgrade
Apt-cache depends PackageName learn about using dependencies
Apt-cache rdepends PackageName is to see which packages are dependent on the package
Apt-get BUILD-DEP packagename Installation-related compilation environment
Apt-get source packagename Download the source code for the package
Apt-get clean cleanup of useless packages
Apt-get AutoClean Cleaning up useless packages
Apt-get Check to see if there is a corrupted dependency
Introduction to Apt-get Working principle
As we all know, it is very convenient to use Apt-get to install the software under the Linux operating system. As long as a sudo apt-get install software name, you can easily solve the software installation, the most important thing is that he can solve the various complex dependencies, so that you do not have to do this headache, and before the advent of Apt-get, the use of dpkg or earlier. Configure;make;make install software can not imagine, installed software A, prompting you to install software B, finally installed, and prompted to install software C .... All Kinds of tangle! So apt this advanced package management tool greatly facilitates the vast number of Linux users, but also reduces the entry threshold for Linux users. Well, bits and pieces say so much nonsense, let's get back to the chase.
In order to find out the principle, I have been on the net for a long time, and finally I groped for a while, finally a little clue, whenever the execution of the software installation or update, or update the software source, APT will visit/etc/apt/ The address within the sources.list, and find the corresponding system package information in the website such as my operating system is Ubuntu, the website is Deb Http://mirrors.163.com/ubuntu/precise main restricted Universe Multiverse NetEase, then when we execute the installation of the command, he will be corresponding to the access http://mirrors.163.com/ubuntu/dists/lucid/main/binary-i386/ packages.gz, this file is a list of packages and their dependencies on the server, and is compressed with gzip. Apt-get Update uses this checklist to determine which supplemental packages are available and his content is stored in/var/lib/apt/lists, by accessing the lists to determine if the software is installed, whether it is the latest version, whether the dependencies are met, This determines the content to be updated and updated, and the installation process is primarily done by dpkg.
In general, APT is a management tool that prefers to download.
Apt-get command Explanation
Under Ubuntu, Apt-get is close to being one of the most commonly used shell commands, because he is the common tool command for Ubuntu to install software.
This article lists the common APT command parameters:
Apt-cache Search Package
Apt-cache Show package for information about packages, such as description, size, version, etc.
sudo apt-get install package
sudo apt-get install package--reinstall Reinstall packages
sudo apt-get-f Install repair installation
sudo apt-get Remove Package
sudo apt-get Remove package--purge Delete packages, including configuration files, etc.
sudo apt-get update source
sudo apt-get upgrade update installed packages
sudo apt-get Dist-upgrade upgrade system
Apt-cache depends package understand that using the package depends on those packages
Apt-cache Rdepends package to see which packages are dependent on the packages
sudo apt-get BUILD-DEP Package Installation-related compilation environment
Apt-get Source Package Downloads The source code for the bundle
sudo apt-get clean && sudo apt-get autoclean cleanup of useless packages
sudo apt-get check to see if there is a corrupted dependency
Apt-get Common Commands