Debian package management tool apt-get usage in Linux

Source: Internet
Author: User

Although many articles on Debian's package management tool apt-get have been published on the Internet, I decided to summarize the usage of apt-get. This is very useful for learning linux, especially debian. The Ubuntu operating system is also a debian-based release. Therefore, this method is also applicable. Apt is an abbreviation of Advanced Package Tool. It is used to query, install, uninstall, and upgrade Debian Linux software packages. Centos release, which uses the yum package management tool. This method is not applicable.
Command: apt-get update
Purpose: Update the package source list. After modifying/etc/apt/sources. list or/etc/apt/preferences, run this command to ensure that the package list is up-to-date.
Command: apt-cache search
Purpose: search for a package based on the file name of the package.
Command: apt-cache show
Purpose: view the package details
Command: apt-cache showpkg
Purpose: view the package summary.
Command: apt-show-versions
Purpose: Display the package version information.
Command: apt-get install
Purpose: run the command to install software packages. Multiple software packages can be installed simultaneously.
Command: apt-get install package-name = version
Purpose: install the specified version.
Command: apt-cache depends package-name
Purpose: view the packages that the software package depends on.
Command: auto-apt run command
Purpose: auto-apt run./configure automatically uses apt-get to install the dependent package, which can solve the compilation error without installing the dependency package.
Command: apt-get remove
Purpose: run this command to uninstall the software package, but the configuration files of the software still exist.
Command: apt-get-purge remove
Purpose: completely uninstall the software package, including configuration files
Command: apt-get autoremove
Purpose: unmount unnecessary files
Command: apt-get upgrade
Role: system upgrade
Command: apt-get-u upgrade
Purpose: list the software to be upgraded (recommended)
Command: apt-get clean
Purpose: delete all installation packages. apt downloads the packages to the local device/var/cache/apt/archives/and then installs them. If too many software packages are installed, the disk space will be occupied. You can use clean and autoclean to delete these installation packages.
Command: apt-get autoclean
Purpose: retain the latest installation package and delete the old installation package.
Command: dpkg-l
Purpose: view the software packages installed in the system.

Common APT command parameters
Apt-cache search package
Apt-cache show package obtains package information, such as description, size, and version.
Apt-cache depends package for dependency usage
Apt-cache rdepends package
Sudo apt-get install package installation package
Sudo apt-get install package -- reinstall re-installation package
Sudo apt-get-f install fix and install "-f = -- fix-missing"
Sudo apt-get remove package Delete package
Sudo apt-get remove package -- purge deletes a package, including deleting a configuration file.
Sudo apt-get update source
Sudo apt-get upgrade updates installed packages
Sudo apt-get dist-upgrade system
Sudo apt-get dselect-upgrade using dselect
Sudo apt-get build-dep package installation-related compilation environment
Apt-get source package download the source code of the package
Sudo apt-get clean & sudo apt-get autoclean clear useless packages
Sudo apt-get check whether any corrupted dependency exists

Where:
1. If SUDO exists, administrator privileges are required!
2. In UBUNTU, the short parameter is "-", and the long parameter is "--".
3. You can use the man command to view the help information or
Command-H (-- help) to view
4. To exit the command in the MAN command, press "q !!
Option description
Use sudo-h Help to list usage methods and exit.
Sudo-V Version displays the Version information and exits.
Sudo-l List lists the commands that can be executed by the current user. This option can only be used by users in sudoers.
Sudo-u username | # uid User executes commands as a specified User. The following users are not only root users, but also usernames or # UIDs.
Sudo-k Kill clears the time on the "admission ticket" and enters the password next time you use sudo.
Sudo-K Sure kill is similar to-k, but it also needs to tear up the "admission volume", that is, delete the timestamp file.
Sudo-B command Background executes the specified command in the Background.
Sudo-p prompt command Prompt can change the prompt message for asking the password, where % u is replaced by the user account name, and % h displays the host name. Very user-friendly design.
Sudo-e file Edit is not a command, but a file modification, which is equivalent to the command sudoedit

 

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.