Apt-GET command explanation

Source: Internet
Author: User

Apt-get is a Linux Command, applicable to Deb package-managed operating systems. It is mainly used to automatically search, install, upgrade, and uninstall software or operating systems from the software warehouse on the Internet.

Apt-get is the package management tool of Debian and Ubuntu, which is similar to the yum tool in red hat. The apt-GET command generally requires the root permission for execution, so it is generally followed by The sudo command. Example: Sudo apt-Get xxxxAPT command usage:
Note: packagename refers to the package name.
Apt-Get update is being modified /Etc/APT/sources. List or/etc/APT/preferencesThen run the command. In addition, you need to regularly run this command to ensure that your package list is up-to-date. Apt-Get install packagename install a new software package (see the following Aptitude) Apt-Get remove packagename uninstall an installed package (keep the configuration document) apt-Get remove -- purge packagname uninstall an installed package (delete the configuration document) apt-Get autoremove packagename: Delete the package and its dependent package apt-Get autoremove -- purge packagname: Delete the package and its dependent package + configuration file, A little more thorough than the one mentioned above: dpkg -- force-all -- purge packagename some software is hard to uninstall and can be used even if it stops other software applications, but it is a little risky. Apt-Get autocleanapt backs up installed or unloaded software on the hard disk, so if space is required, this command can delete the software you have deleted. APT-Get clean will also delete the backup of the installed software, but this will not affect the use of the software. Apt-Get upgrade can use this command to update the software package. APT-Get upgrade can not only update the software package from the released version with the same version number, but also update the software package from the released version of the new version number, although the recommended command for implementing the next update is apt-Get dist-upgrade, it is useful to add the-u option when running the apt-Get upgrade command (I .e: apt-get-u upgrade ). This option enables apt to display the complete list of updatable software packages. Without this option, you can only update it blindly. APT downloads the latest versions of each software package and installs them in a proper order. Note that you should first run apt-Get update to update the database before running this command. Update any installed software packages. [1] apt-Get dist-Upgrade: upgrade the system to the latest apt-cache search string. Search for strings in the package list. Dpkg-l package-name-PatternList any software packages that match the pattern. If you do not know the full name of the software package, you can use "* package-name-pattern *". Aptitude carefully checks installed or available software packages. Similar to Apt-Get, aptitude can be called through command lines, but it is limited to some commands-the most common commands are installation and uninstallation. Because aptitude knows more information than apt-get, it is more suitable for installation and uninstallation. Apt-Cache showpkg pkgs displays the package information. Apt-Cache dumpavailPrint the list of available software packages. Apt-Cache show pkgs displays package records, similar to dpkg-print-avail. Apt-Cache pkgnames prints the name of any package in the package list. Dpkg-s file: Which package is installed. Dpkg-l package lists any documents in the software package. Dpkg-l lists all installed software packages apt-file search filename and finds software packages containing specific documents (not necessarily installed). The document names of these documents contain the specified strings. Apt-file is a separate software package. You must first install apt-Get install and then run apt-file update. If apt-file search filename outputs too much content, you can try to use apt-file search filename | grep-W filename (only display the file names in which the specified string appears as the complete word) or similar methods, such: apt-file search filename | grep/bin/(only show documents in folders such as/bin or/usr/bin. If you are looking for a specific execution document, this is helpful.) run the apt-Get autoclean command in a specific period to clear the packages that have been uninstalled. deb document. In this way, you can release a large amount of disk space. If your requirements are urgent, you can use apt-Get clean to release more space. This command will delete the. Deb document that has installed the software package. In most cases, you will not use these. Debs documents, so if you feel overwhelmed by insufficient disk space, this method may be worth a try.

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.