Apt-getinstall usage

Source: Internet
Author: User
Apt-getinstall usage: Download apt-getinstall and install 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-getremove... use apt-get install to download apt-get install and install 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 dependent on this package. www.2cto.com -- 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 /Etc/apt/sources is modified each time. list, must be executed. apt-get upgrade [-u] is upgraded, so the installed package is 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 will be marked as hold. apt-get update will not upgrade the package marked as "hold" (this is what "hold" means ). see how to manually set the package to www.2cto.com 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] is similar to apt-get upgrade, except that dist-upgrade installs and removes packages to satisfy the dependency. therefore, it is dangerous. search for packages and descriptions that meet apt-cache search requirements. display at www.2cto.com apt-cache show. Apt-cache showpkg shows many details and relationships with other packages. several graphic front ends of dselectconsole-aptaptitudegnome-aptAPT (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 manually download. contents listed in dpkg-c. dpkg-I extracts package information from. dpkg-r remove an installed package. dpkg-P completely clears an installed package. unlike remove, remove only deletes data and executable files, and purge also deletes all preparation files. dpkg-L lists all installed files. at the same time, check the dpkg-c to check one. deb file content. dpkg-s displays the information of installed packages. see apt-cache for Debi. An archive package information and dpkg-I to display from one. the package information extracted from the deb file. dpkg-reconfigure re-prepares an installed package if it uses debconf (debconf provides a unified configuration interface for package installation ). you can reconfigure debconf itself, for example, you want to change the priority of its front-end or question. for example, re-configure debconf and use a dialog front-end to run the following command: dpkg-reconfigure -- frontend = dialog debconf (if you have chosen an error during installation, here, we can change back to echo "hold" | dpkg -- set-selections to hlevels (command line) the current status (command line mode) of the dpkg -- get-selections "" command supports wildcards, such as Debian :~ # Dpkg -- get-selections * wine * libwine holdlibwine-alsa holdlibwine-arts holdlibwine-dev holdlibwine-nas container-print container-twain holdwine + holdwine-doc holdwine-utils hold 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 and then run the following command to check: Debian :~ # Dpkg -- get-selections "gaim" gaim hold the current status flag is "hold" and cannot be upgraded. what should I do if I want to restore it? Debian :~ # Echo "gaim install" | dpkg -- set-selectionsDebian :~ # Dpkg -- get-selections "gaim" gaim install at this time, the status flag is reset to install again. you can continue the upgrade. comrades will ask which of these status marks 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 in/etc/apt: Package: gaimPin: version 0.58 * save dpkg-S and find it in the Package database, and tell you which package contains this file. (Note: find the package that has been installed in advance) create deb packagesapt-get source [-B] from the source code to download a package of source code 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 downloads and installs the packages 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 the dependency 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, for example (as root): apt-get build-dep apt-get source-B will download the source package and establish dependency, then, compile the source code. Dpkg-source-x if you manually download the source code package of a program, which contains several packages similar to .orig.tar.gz ,. dsc, and files such as .diff.gz. the dsc file uses this command to unpack the source code package. Dpkg-buildpackage creates 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 that the command uses the fakeroot program to mimic the root permission (to achieve ownership ), '-UC' indicates "Don't cryptographically sign the changelog",'-B 'indicates that only binary packages are created. www.2cto.com debuild a fast packaging script similar to dpkg-buildpackage, which can automatically identify whether to use fakeroot, run lintian and gpg dependency correction for you 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, and 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-fapt-get upgrade-fapt-get dist-upgrade-f tries to correct the dependency in the above process. Note that apt-get install-f does not need to be used as a parameter.
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.