Ubuntu (Debian) usage of apt toolset

Source: Internet
Author: User
Keywords Ubuntu toolset Debian
Tags apt automatic control debian function install install software installation

It is easy to install software using APT or synaptic (newly established) under Ubuntu (Debian). In addition to the simple installation software, the APT toolset has many special circumstances to use.

Remember that man handbook is a good teacher at all times.

1. Use aptitude instead of apt.

Aptitude, although not apt "super bull Power", but the function is more powerful than apt
First, like apt, you can install software

Aptitude Install Pack-foo

Aptitude resolve dependencies more intelligently than apt. Sometimes "xxx needs XXXX, but XXX is installed" will appear when installing software with apt. This is usually because some packages are too new. Using aptitude at this point, aptitude will find the problem and give a few solutions, and we just need to accept the solution that fits the heart.

Another advantage of aptitude is that the packages are automatically recorded as "Automatic Install" (that is, because of dependencies), and if the packages that depend on the Auto install package are not installed, the automatic installation package (now useless) is automatically deleted.
Use these two commands to control the automatic installation property of the package

Aptitude Markauto pack-foo #标记成 "Auto Install"
Aptitude unmarkauto pack-foo #标记成 "Manual Installation"

When you remove the software, you can avoid accidentally deleting important packages by using Markauto instead of remove.
Of course, the new version and Apt also have similar features, but it seems not to use the same database with aptitude, so it is recommended to use only the aptitude management software package.

Aptitude also provides a more flexible way to control software package versions

Hold&http://www.aliyun.com/zixun/aggregation/37954.html ">NBSP; -Put the package in a hold state
Unhold-Cancel the hold command on a package
Forbid-version-prohibits aptitude from upgrading to a specific version of the package.

Examples of Libcairo events in previous weeks:

sudo aptitude install Libcairo2=1.4.10-1ubuntu4 # forced demotion
sudo aptitude forbid-version libcairo2=1.4.10-1ubuntu4.1 # sealed off the wrong version
sudo aptitude markauto Libcairo2 #恢复auto属性

See the Man Manual for a description of the install operation, with more control methods.

Aptitude Reinstall Reinstall Package, equivalent to apt--reinstall install
Aptitude purge completely remove package, equivalent to apt--purge remove
A little trick.

Aptitude purge ' dpkg-l|grep ' ^rc ' |awk ' {print $} '

Aptitude also brings together a number of apt tool functions

Search-Searching for packages by name and/or expression
Show-Displays the details of a package
Download-Download the. deb file for the package

Related Article

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.