Apt-Get install usage

Source: Internet
Author: User

Apt-Get install
Download and install or upgrade all dependent packages. if a package is set to hold (stop flag, it will be put aside (that is, it will not be upgraded ). for more information about hold, see the following.
Apt-Get remove [-- purge]
Remove and any other packages that depend on this package.
-- Purge indicates that the package should be completely purged (purged). For more information, see dpkg-P.
Apt-Get update
Upgrade the package list from the Debian image. If you want to install any software on the day, run the package at least once a day and modify the package every time.
/Etc/APT/sources. list must be executed.
Apt-Get upgrade [-u]
Upgrade the package to the latest available version. old packages will not be installed or removed. if a package has changed its dependency and needs to be installed with a new package, it will not be upgraded, but marked
Hold. APT-Get update will not upgrade the package marked as hold (this is what hold means). See how to manually set the package
Hold. I suggest using the '-U' option at the same time, because you can see which packages will be upgraded.
Apt-Get dist-upgrade [-u]
Similar to Apt-Get upgrade, apart from dist-upgrade, packages will be installed and removed to meet the dependency. Therefore, it is dangerous.
Apt-cache search
Search for the expected packages and descriptions.
Apt-Cache show
The complete description.
Apt-Cache showpkg
Shows many details and relationships with other packages.
Dselect
Console-Apt
Aptitude
Gnome-Apt
Several graphical front ends of APT (some of which must be installed before use). Here, dselect is undoubtedly the most powerful, the oldest, and the most difficult to control.
Common dpkg usage
Dpkg-I
Install a Debian package file, such as the file you downloaded manually.
Dpkg-C
List content.
Dpkg-I
Extract package information from.
Dpkg-R
Remove an installed package.
Dpkg-P
Clear a fully installed package. Unlike remove, remove only deletes data and executable files, and purge also deletes all preparation files.
Dpkg-l
List all installed files. Check the content of A. Deb file by using dpkg-C.
Dpkg-S
Shows the information of installed packages. Also, see apt-cache to display the package information in the Debian archive, and dpkg-I to display the package information from
The package information extracted from the. Deb file.
Dpkg-reconfigure
Re-prepare an installed package. If debconf is used (debconf provides a unified configuration interface for package installation), you can re-Prepare the package.
Debconf itself, for example, if you want to change the priority of its front-end or question, for example, re-prepare debconf and use a dialog front-end for simple operation:
Dpkg-reconfigure -- frontend = dialog debconf
Echo "hold" | dpkg -- Set-selections
Set the status to hlevels (command line)
Dpkg -- Get-selections ""
The current status (in command line mode)
Wildcard characters are supported, such:
Debian :~ # Dpkg -- Get-selections * wine *
Libwine hold
Libwine-ALSA hold
Libwine-arts hold
Libwine-dev hold
Libwine-Nas hold
Libwine-print hold
Libwine-Twain hold
Wine hold
Wine + hold
Wine-Doc hold
Wine-utils hold
For example:
We are using gaim-0.58 + QQ-plugin, in order to prevent Gaim from being upgraded, we can use the following method:
Method 1:
Debian :~ # Echo "Gaim hold" | dpkg -- Set-selections
Then run the following command to check:
Debian :~ # Dpkg -- Get-selections "Gaim"
Gaim hold
The Current Status indicates "hold" and cannot be upgraded.
What should I do if I want to restore it?
Debian :~ # Echo "Gaim install" | dpkg -- Set-selections
Debian :~ # Dpkg -- Get-selections "Gaim"
Gaim install
At this time, the status flag is reset to install again, and the upgrade can continue.
Comrades will ask, which of these status signs are written in which file?
In/var/lib/dpkg/status, you can also modify this file to implement hold.
Sometimes you may find that some software status indicators are purge.
For example, amsn has been installed in advance and is unloaded.
Apt-Get remove -- purge amsn
Then the status flag changes from install to purge.
Method 2:
Manually create a preferences file under/etc/Apt
Content:
Package: Gaim
Pin: Version 0.58 *
Save
For more details, see:
Http://linuxsir.com/bbs/showthread....&threadid=22601
Dpkg-S
Find the package in the package database and tell you which package contains this file. (Note: Find the package that has been installed in advance)
Build Deb packages from source code
Apt-Get source [-B]
Download a source code package and unlock it.
You must write a Deb-Src record in your/etc/APT/sources. list file to complete this operation.
If you enter a-B parameter and are root, the Deb package is automatically created.
Apt-Get build-Dep
Automatically download and install the package required for source code creation.
Only apt 0.5 and later versions support this function.
Currently, Woody and later versions include this function.
If you use an old version of APT, the easiest way to find dependencies is to view the Debian/control file in the source package,
Note that the path is relative to the path in the package.
Common usage, combined with APT-Get source-B, example (as root ):
Apt-Get build-Dep
Apt-Get source-B
Will download the source code package, establish dependencies, and then try to compile the source code.
Dpkg-source-x
If you manually download the source code package of a program, which contains several files similar to .orig.tar.gz,. DSC,
And files like .diff.gz,
Then you can use this command to unpack the source code package for the. DSC file.
Dpkg-buildpackage
Create a deb package from the Debian source code tree. It takes effect only in the source tree home directory. For example:
Dpkg-buildpackage-rfakeroot-uc-B
Here '-rfakeroot' specifies the command to use the fakeroot program to simulate root permissions (to achieve ownership ),
'-Uc' indicates "Don't cryptographically sign the changelog",'-B 'indicates that only Binary packages are created.
Debuild
A Fast packaging script, similar to dpkg-buildpackage, can automatically identify whether to use fakeroot,
Run lintian and GPG
Modify dependency relationship
Dpkg -- configure -- pending
If dpkg fails to exit when apt-Get install upgrade dist-uptradeing,
Use this command to configure unpack packages.
Use apt-Get install, upgrade, or dist-upgrade-F,
Then use apt-Get install, upgrade, or dist-upgrade.
It may be repeated multiple times, which usually solves most of the dependency problems.
(If you are prompted to require a specific package for some reason, you can install or uninstall the package with common sense)
Apt-Get install-F
Apt-Get upgrade-F
Apt-Get dist-upgrade-F
Try to correct the dependency in the above process
Note that APT-Get install-F does not need to be used as a parameter.

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.