Answers:
dpkg
和apt-get
两种安装软件的方式。基本上,apt-get,aptitude和synaptic是在debian的dpkg软件包管理程序的基础上构建的。它们都执行相同的基本功能-程序包管理,但具有一些额外的功能。apt-get的额外功能之一是它将安装依赖项,而dpkg不会。
关于-p / purge ...
将-P
在dpkg
手段--purge
和将删除一切,包括setttings和配置文件。从手册中:
-r, --remove, -P, --purge package...|-a|--pending
Remove an installed package. -r or --remove remove everything
except conffiles. This may avoid having to reconfigure the pack‐
age if it is reinstalled later. (Conffiles are configuration
files that are listed in the DEBIAN/conffiles control file). -P
or --purge removes everything, including conffiles. If -a or
--pending is given instead of a package name, then all packages
unpacked, but marked to be removed or purged in file
/var/lib/dpkg/status, are removed or purged, respectively. Note:
some configuration files might be unknown to dpkg because they
are created and handled separately through the configuration
scripts. In that case, dpkg won't remove them by itself, but the
package's postrm script (which is called by dpkg), has to take
care of their removal during purge. Of course, this only applies
to files in system directories, not configuration files written
to individual users' home directories.
Removing of a package consists of the following steps:
1. Run prerm script
2. Remove the installed files
3. Run postrm script
这同样适用于purge
在apt-get
。
remove
remove is identical to install except that packages are removed
instead of installed. Note the removing a package leaves its
configuration files in system. If a plus sign is appended to the
package name (with no intervening space), the identified package
will be installed instead of removed.
purge
purge is identical to remove except that packages are removed and
purged (any configuration files are deleted too).
基本上,这是相同的选择。请注意:dpkg不会删除依赖项。apt-get确实删除了依赖项
Lekensteyn的评论文档:
php5
也会导致phpmyadmin
被删除(假设没有其他PHP SAPI)。apt
可以解决这个问题,dpkg
本身无法解决。
dpkg
直接使用后遇到依赖项问题,则可以用sudo apt-get install -f
(如的建议dpkg
)进行纠正
sudo apt-get install -f phpmyadmin
要确保删除依赖项?如果共享依赖关系怎么办?