Apt-GET command

Source: Internet
Author: User
Sudo is required for all the commands to be introduced below! Replace "packagename" and "string" withProgram.

Apt-Get update-- Run this command after modifying/etc/APT/sources. List or/etc/APT/preferences. 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 aptitude below)

Apt-Get remove packagename-- Uninstall an installed software package (keep the configuration file)

Apt-Get -- purge remove packagename-- Uninstall an installed software package (delete the configuration file)

Dpkg -- force-all -- purge packagenameSome software is hard to uninstall and can be used if it also blocks other software applications, but it is a little risky.

Apt-Get autocleanAPT will back up installed or unloaded software on the hard disk. If you need space, you can run this command to delete the software you have deleted.

Apt-Get cleanThis command will also delete the backup of the installed software, but this will not affect the use of the software.

Apt-Get upgrade-- Update all installed software packages

Apt-Get dist-Upgrade-- Upgrade the system to the new version.

Apt-cache search string-- Search for strings in the package list

Dpkg-l package-name-Pattern-- List all 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-- View installed or available software packages in detail. Similar to Apt-Get, aptitude can be called through the command line, but 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 dumpavail-- Print the list of available software packages.

Apt-Cache show pkgs-- Displays Software Package records, similar to dpkg-print-avail.

Apt-Cache pkgnames-- Print the names of all packages in the package list.

Dpkg-s file-- Which software package does this file belong.

Dpkg-l package-- List all files in the software package.

Apt-file search filename-- Find a software package that contains a specific file (not necessarily installed). The file names of these files contain the specified string. Apt-file is an independent 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 show the names of the complete words in the specified string) or similar methods, such: apt-file search filename | grep/bin/(only files in folders such as/bin or/usr/bin are displayed. If you are looking for a specific execution file, this is helpful ).
* Apt-Get autoclean -- run this command regularly to clear the. Deb files of uninstalled software packages. 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 file that has installed the software package. In most cases, you will not use these. Debs files. Therefore, 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.