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