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