Ubuntu Tutorial: apt software package management

Source: Internet
Author: User
Ubuntu Tutorial: apt package management apt-getupdate-after you change/etc/apt/sources. list or/etc/apt/preferences, you need to run this command to make the change take effect. At the same time, run this command regularly to ensure that your source list is up-to-date. This command is equivalent to "refresh" in the new software package manager, or "checkforupda" in the Adept Software Package Manager under Windows and OSX

Ubuntu Tutorial: apt software package management

Apt-get update-after you change/etc/apt/sources. list or/etc/apt/preferences, run this command to make the change take effect. At the same time, run this command regularly to ensure that your source list is up-to-date. This command is equivalent to "refresh" in the new software package manager, or "check for updates" in the Adept Software Package Manager under Windows and OS X ".

Apt-get upgrade-update all installed software packages. Similar to a command, the new software package manager completes "marking all software packages for upgrade" and "applying ".

Apt-get dist-upgrade-update the entire system to the latest release version. It is equivalent to "marking all updates" in the new software package manager and selecting "smart upgrade" in preferences-This tells APT to update to the latest package and even deletes other packages (note: we do not recommend that you use this method to update to a new release ).

Apt-get-f install -- equivalent to "edit-> modify (dependency) corrupted software package" in the new software package manager, and click "application. If "unmet dependencies" is displayed, You can execute this command.

Apt-get autoclean-if your hard disk space is small, you can regularly run this program and delete the. deb installation file of the deleted software package from the hard disk. If you still need hard disk space, try apt-get clean. This will delete the installation packages of your installed software packages. Of course, these packages are useless in most cases, therefore, this is a good way to store the hard disk.

Apt-get clean is similar to the preceding command, but it deletes all packages in the package cache. This is a good practice, because these packages are useless in most cases. But if you use dial-up Internet access, You have to reconsider.

The package cache path is/var/cache/apt/archives. Therefore, du-sh/var/cache/apt/archives tells you the hard disk space occupied by the package cache.

Dpkg-reconfigure foo-reconfigure the "foo" package. This command is useful. When many packages are configured at a time, a lot of questions need to be answered, but some questions are unknown in advance. For example, dpkg-reconfigure fontconfig-config displays the font Configuration Wizard in Ubuntu. Every time I install a Ubuntu system, I run this command because I want bitmap fonts to work in all my applications.

Apt-get remove package name-delete Installed Package (keep the configuration file)

Apt-get -- purge remove package name-delete the installed package (the configuration file is not retained)

TIPS: If you want to delete the 'foo' package and install 'bar': apt-get -- purge remove foo bar +.

Apt-get autoremove-delete a software package that is installed to meet the requirements of other software packages but is no longer needed.

Apt-cache search foo-search and "foo" matching packages.

Apt-cache show foo-displays information about the "foo" package, such as description, version, size, dependency, and conflict.

Dpkg -- print-avail package name-similar to the above.

Dpkg-l * foo *-find the package containing "foo. Similar to apt-cache show foo, it also shows whether or not each package is installed.

Dpkg-l package-name-pattern-list software packages named package-name-pattern. Unless you know the full name of the software package, you can use "* package-name-pattern *".

Dpkg-L foo-displays the files installed in the package named "foo" and their paths. It is a useful command.

Dlocate foo-search for the "foo" file in the installed package. It is very practical to answer the question "which package this file comes from. Dlocate is a software package. You must install it to use this command.

Dpkg-S foo-is the same as the preceding command, but it is slower. It can only run In Debian or Ubuntu. In addition, you do not need to install the dlocate package.

Apt-file search foo-similar to dlocate and dpkg-S, but search for all valid software packages, not just installed software packages on your system. -- The answer is "which software packages provide these files ". You must install the apt-file package and ensure that the apt-file database is up-to-date.

What files does dpkg-c foo. deb-"foo. deb" contain? Note: foo. deb is the file name containing the path. -- This is the. deb package you downloaded.

Apt-cache dumpavail-displays all available software packages and their respective details (which produces a lot of output ).

Apt-cache show package name-display package records, similar to dpkg -- print-avail package name.

Apt-cache pkgnames-quickly lists the names of installed software packages.

Apt-file search filename-search for software packages containing specific files (not necessarily installed). The file names contain the specified strings. 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 ).

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.