在这里给大家总结下Apt-get,DPKG,YUM 使用的相关参数。我这里没有翻译过来,因为是在英文系统状态下。各位见谅。
#1,Apt-Get
1 | $ apt-get –option -o command |
– This is the standard usage for the apt-get command.
1 | $ apt-get -h |
– Use this command to get more help.
1 | –update |
– This will find updates for all packages from locations listed in /etc/apt/sources.list. You should always run an update before attempting an upgrade or a dist-upgrade.
1 | –upgrade |
– Use this to install the newest versions of all packages. Make sure you use the update command to check your sources.list for the newest versions first.
1 | –dist-upgrade |
– This will upgrade your distribution to the newest version. And will also upgrade all packages in your sources.list.
1 | –install |
– Used this with the desired packages to install them. If you install a package that has pre-requisites or related packages apt-get will grab them for you.
1 | –remove |
– This will remove packages from your system.
1 | –purge |
– This is the same as remove but with purge you can delete configuration files also.
#2, DPKG
1 | $ dpkg –option package |
– This is the standard usage for the DKPG command.
1 | $ dpkg -s package | grep Status |
– Use this to find out if a package is installed or not.
1 | $ dpkg -s package |
– See if a package is installed, as well as other useful information.
1 | $ dpkg -S /file |
– With this option you can find out which package a file belongs to.
1 | $ dpkg -S package |
$ dpkg -c package.deb – This will list all files related to the package.
1 | $ dpkg -C |
– This will search for broken packages.
1 | $ dpkg -L package |
– You can use this to list the locations of files added by the chosen package.
1 | $ dpkg -l |
– Get a list of installed packages and a short description.
1 | $ dpkg -l package |
– Will list specified package with a short description.
1 | $ dpkg -i package.deb |
– Use this to install a package or upgrade already installed packages.
1 | $ dpkg -r package |
– This will remove an installed package.
1 | $ dpkg -R /directory |
– With this you can install all packages recursively from the specified directory.
1 | $ dpkg -P package |
– You can remove an installed package but leave the configuration files with the purge option.
1 | $ dpkg -p package |
– You can use this to get further details about a package.
1 | $ dpkg -h |
– Get additional help with DPKG.
#3,Yum