Apt-get command:
Apt-get is a Debian,ubuntu release package management tool, very similar to the Yum tool in Red Hat, for the Deb package managed operating system, which is used to automatically search, install, upgrade, uninstall software or operating systems from the Internet's software warehouse. Apt-get When installing the package is based on the source specified in the/etc/apt/sources.list file to find the installation package, you can according to your needs to modify this file.
Apt-get commands typically require root access, so follow the sudo command generally.
- sudo apt-get install package
- sudo apt-get Install package--Reinstall reinstall packages
- sudo apt-get-f install fix "-F =--fix-missing"
- sudo apt-get Remove Package
- sudo apt-get Remove Package--purge delete packages, including deletion of configuration files, etc.
- sudo apt-get autoremove package deletes packages and their dependent packages
- sudo apt-get update source
- sudo apt-get upgrade update installed packages
- sudo apt-get Dist-upgrade upgrade system
- sudo apt-get dselect-upgrade using Dselect upgrade
- sudo apt-get BUILD-DEP Package Installation-related compilation environment
- sudo 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
Some of the tools that are commonly used include:
tools |
Description |
Install |
followed by package name for installing a package |
update |
from soft Download/update the list of packages used to update the local software source on the source mirror server |
upgrade |
upgrade all locally updatable packages, but there is a dependency problem that will not be upgraded, usually in a more New update |
dist-upgrade |
resolve dependencies and upgrade (there is a risk) |
remove |
Remove an installed package, including a package that is dependent on the removed package, but does not contain a configuration file for the package |
autoremove |
Remove packages that were previously dependent on other packages, but are no longer in use |
purge |
and remove Identical, but will completely remove the package, including its configuration file |
clean |
Remove the installed packages that are downloaded to the local, which are saved by default in/var/cache/apt/archiv es/ |
autoclean |
Remove old versions of installed software packages |
apt-get
Common parameters:
Parameters |
Description |
-y |
It is useful to use this parameter in some automated installation scripts to automatically respond to the option to install packages. |
-s |
Analog installation |
-q |
Silent installation, specifying multiple q or -q=# , #表示数字, to set the level of silence, which is useful when you do not want to have too much screen output when you install a package |
-f |
Repairing a corrupted dependency |
-d |
Download-Only not installed |
--reinstall |
Reinstall installed packages that may have problems |
--install-suggests |
Install the recommended package installed by apt at the same time |
Apt-cache command:
Apt-cache is primarily used to search for packages.
- sudo Apt-cache search Package
- sudo apt-cache Show package get information about packages, such as description, size, version, etc.
- The sudo apt-cache showpkg Pack displays package information, including package dependencies, package providers,
- sudo apt-cache pkgnames The name of all packages in the print package list
- sudo apt-cache dumpavail For information about all packages in the Print packages list
- sudo Apt-cache depends package learn about using dependencies
- sudo apt-cache rdepends package is to see which packages are dependent on the package
dpkg command:
Dpkg is a background package manager for the Debian system, similar to RPM. It is also a mainstay of the Debian package management system, which is responsible for securely uninstalling packages, configuring them, and maintaining installed packages. Because Ubuntu and Debian are same strain, many commands are equals.
All packages information in Ubuntu is in the/var/lib/dpkg/directory, where the subdirectory "/var/lib/dpkg/info" is used to save a list of profiles for each package. Different suffix names represent different types of files, such as:
The. Conffiles records the list of configuration files for the package.
The list of files in the package is saved, and the user can find the specific installation location of the files in the package from the. List information.
The. Md5sums records the package's MD5 information, which is used for packet validation.
The. Prerm script runs before the Debian packet is unpacked, and the main function is to stop the service that acts on the package that will be upgraded until the package installation or upgrade is complete.
The. Postinst script is a configuration that completes after the Debian package is unpacked and is typically used to perform commands and service restarts for the installed packages.
The content of the/var/lib/dpkg/available file is a description of the package, which includes all packages in the Debian installation source used by the current system, including installed and not installed packages on the current system.
Command:
- Dpkg–l | The grep package queries the details of the Deb Pack, and no packages are specified to show all installed packages
- Dpkg-s Package View detailed information about the specified packages that have been installed
- Dpkg-l Package List of all files installed
- Dpkg-s file to see which package is part of the system and search for installed packages
- Dpkg-i installing the specified Deb package
- Dpkg-r followed by a directory name for installing all of the Deb installation packages in this directory
- Remove an installed package from the Dpkg-r remove
- Dpkg-p thorough uninstallation, including configuration files for the software
- Dpkg-c querying the files contained in the Deb package file
- Dpkg-l View a detailed list of installed packages in the system, and execute the-C
Ubuntu Package Management Command for APT and dpkg usage