Learning notes for apt commands in Ubuntu

Source: Internet
Author: User
Learning notes for apt command in Ubuntu: apt-getupdate -- 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-getinstallpackagename -- install a new software package (see aptitude below) apt-getremovepackagenam

Notes for learning apt commands of Ubuntu:

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 document)

Apt-get -- purge remove packagename -- uninstall an installed software package (delete configuration document)

Dpkg -- force-all -- purge packagename some software is hard to uninstall and can be used to block other software applications, but it is a little risky.

Apt-get autoclean apt will back up installed or unloaded software on the hard disk, so if you need space, you can run this command to delete the software you have deleted.

The apt-get clean command will also delete the backup of the installed software, but this will not affect the use of the software.

Apt-get upgrade -- Update any 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 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 check 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 dumpavail -- print the list of available packages.

Apt-cache show pkgs -- displays Software Package records, similar to dpkg-print-avail.

Apt-cache pkgnames -- print the name of any package in the package list.

Dpkg-S file -- this document belongs to the installed software package.

Dpkg-L package -- list any documents in the software package.

Apt-file search filename -- search for software packages containing specific documents (not necessarily installed). The document names of these documents contain 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 ). Apt-get autoclean -- run this command regularly to clear the. deb documentation for uninstalled software packages.

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.