1. APT (one of the management tools for Ubuntu Linux software package)
Apt-cache search # ------ (package search package)
Apt-Cache show # ------ (package obtains package information, such as description, size, and Version)
Sudo apt-Get install # ------ (package installation package)
Sudo apt-Get install # ----- (package--reinstall re-installation package)
Sudo apt-get-F install # ----- (Force installation? # "-F = -- fix-missing" should be fixed and installed ...)
Sudo apt-Get remove # ----- (delete package)
Sudo apt-Get remove -- purge # ------ (delete a package, including deleting a configuration file)
Sudo apt-Get autoremove -- purge # ---- (package deletes packages and their dependent packages + configuration files (only valid for 6.10, it is strongly recommended ))
Sudo apt-Get update # ------ update source
Sudo apt-Get upgrade # ------ Update installed packages
Sudo apt-Get dist-upgrade # --------- upgrade the system
Sudo apt-Get dselect-upgrade # ------ upgrade with dselect
Apt-Cache depends # ------- (package knows how to use dependencies)
Apt-Cache rdepends # ------ (does package know a specific dependency? # Check which packages the package depends on ...)
Sudo apt-Get build-dep # ------ (package installation related compilation environment)
Apt-Get source # ------ (package downloads the source code of the package)
Sudo apt-Get Clean & sudo apt-Get autoclean # -------- clear the archive of downloaded files & only clear outdated packages
Sudo apt-Get check # ------- check for any corrupted Dependencies
Apt-Get install <package>: Download <package> and all dependent packages, and install or upgrade the 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] <package>: removes <package> 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 it at least once a day and modify/etc/APT/sources each time. list, must be executed.
Apt-Get upgrade [-u]: upgrade all installed packages to the latest available version. old packages will not be installed or removed. if a package needs to install a new package because it has changed its dependency, 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 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, but dist-upgrade installs and removes packages to satisfy dependencies. Therefore, it is dangerous.
Apt-cache search <pattern>: searches for packages and descriptions that meet <pattern> requirements.
Apt-Cache show <package>: displays the complete description of <package>.
Apt-Cache showpkg <package>: displays <package> many details and relationships with other packages.
Dselect, console-apt, aptitude, and gnome-APT are 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.
========================================================== ========================================================== ====
2. dpkg (Ubuntu Linux package management tool 2)
Dpkg-I <package. Deb>: Install a Debian package file, such as the file you downloaded manually.
Dpkg-C <package. Deb>: lists the content of <package. Deb>.
Dpkg-I <package. Deb>: Extracts package information from <package. Deb>.
Dpkg-r <package>: remove an installed package.
Dpkg-P <package>: completely clear an installed package. Unlike remove, remove only deletes data and executable files, and purge also deletes all preparation files.
Dpkg-L <package>: lists all the files installed in <package>. Check the content of A. Deb file by checking dpkg-C.
Dpkg-S <package>: displays the information of the installed package. at the same time, see apt-cache to display the package information in the Debian archive, and dpkg-I to display the package information from one. the package information extracted from the Deb file.
Dpkg-reconfigure <package>: reconfigure an installed package. If debconf is used, 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-prepare debconf and use a dialog front-end for simple operation:
Dpkg-reconfigure -- frontend = dialog debconf (if you have chosen an error during installation, you can change it back here)
Echo "<package> hold" | dpkg -- Set-selections
Set the <package> status to hlevels (command line)
Dpkg -- Get-selections "<package>"
The current status of the <package> (in command line mode)
Wildcard characters are supported, such:
Debian :~ # Dpkg -- Get-selections * wine *
========================================================== ======================================
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
Dpkg-S <File>
Find <File> in the package database and tell you which package contains the file.
First Installed Package)
Build Deb packages from source code
Apt-Get source [-B] <package>
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 <package>
Automatically download and install the package required to create the <package> package through the source code.
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, example (as root ):
Apt-Get build-dep <package>
Apt-Get source-B <package>
Will download the source code package, establish dependencies, and then try to compile the source code.
Dpkg-source-x <package. DSC>
If you manually download the source code package of a program, it contains several files 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
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 and run lintian and GPG
Modify dependency relationship
Dpkg -- configure -- pending
If dpkg exits when apt-Get install upgrade dist-uptradeing fails, 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-F
Apt-Get upgrade-F
Apt-Get dist-upgrade-F
Try to correct the dependency in the above process
Note that <package> is not required for apt-Get install-f.
-------------------------------------
Use apt-CDROM-D/Media/cdrom0 add to load the optical drive,
/Dev/HDC/CDROM iso9660 user, noauto 0 0
Use the editor to modify the disk and restart it.
Then, Apt-CDROM-D/CDROM add
Apt-Get install (the software name you want to install: GCC for example)
Software related to GCC is automatically loaded.
Note: APT does not recognize the optical drive you manually attached. If the fstab settings are incorrect, APT will not work normally.
Use apt-CDROM-D/Media/cdrom0 add to load the optical drive, you need to use # mkdir/Media/cdrom0. Otherwise, an error will be prompted: "unable to read the file system mount point/Media/CDROM status-Stat (2 does not have that file or directory )"