如何使用pacman强制在Arch中删除软件包?


64

我如何强制在Arch中删除一个软件包,pacman而其他软件包仍然依赖于它。

pacman -R perl-libwww                                                               
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: perl-app-cpanminus: requires perl-libwww>=5.828
:: perl-app-pmuninstall: requires perl-libwww
:: perl-app-sd: requires perl-libwww
:: perl-catalyst-action-rest: requires perl-libwww>=2.033 
:: perl-catalyst-runtime: requires perl-libwww>=1.64
:: perl-cpan: requires perl-libwww
:: perl-cpan-mini: requires perl-libwww
:: perl-cpan-uploader: requires perl-libwww
:: perl-feed-find: requires perl-libwww
:: perl-http-body: requires perl-libwww
:: perl-http-request-ascgi: requires perl-libwww
:: perl-module-cpants-analyse: requires perl-libwww
:: perl-module-install: requires perl-libwww>=5.812
:: perl-net-trac: requires perl-libwww
:: perl-net-whois-raw: requires perl-libwww
:: perl-prophet: requires perl-libwww
:: perl-rt-client-rest: requires perl-libwww
:: perl-uri-fetch: requires perl-libwww
:: perl-www-mechanize: requires perl-libwww
:: perl-xml-atom: requires perl-libwww
:: perl-xml-feed: requires perl-libwww

基本上,LWP 6会拆分一大堆软件包,因此我需要将其删除以便重新安装。


有没有apt-get的--reinstall标志的等效项?
Faheem Mitha

@faheem考虑到arch尚未发布libwww 6 ...即使在这种情况下它也无法正常工作
xenoterracide 2011年

@xenoterracide:抱歉,我根本没有听从您的回应(我想libwww与您要安装的软件包有关),但是请不要觉得您需要代表我解释一下。:-)
Faheem Mitha

@faheem是LWP。但是我们通常可以通过再次请求安装来重新安装软件包...在这种情况下这无济于事,因为它不在arch repo中,并且我需要卸载它并升级而不使用arch repo's,并且由于该软件包是拆分,我遇到了文件冲突。
xenoterracide 2011年

@faheem还请注意,Arch不是debian,也不知道debian的apt-get --reinstall工作方式。
xenoterracide 2011年

Answers:


97

您应该可以使用以下简单的方法重新安装该软件包:

# pacman -S perl-libwww

这只会删除perl-libwww:

# pacman -Rdd perl-libwww

请注意命令中的双-d,如果您使用--nodeps,则还必须指定两次-或将其与-d结合使用,例如:

# pacman -R --nodeps --nodeps perl-libwww
# pacman -Rd --nodeps perl-libwww

这将删除所有依赖于perl-libwww的软件包:

# pacman -Rc perl-libwww

在pacman的手册页中:

   -d, --nodeps
       Skips dependency version checks. Package names are still
       checked. Normally, pacman will always check a package’s
       dependency fields to ensure that all dependencies are
       installed and there are no package conflicts in the
       system. Specify this option twice to skip all dependency
       checks.
   -c, --cascade
       Remove all target packages, as well as all packages that
       depend on one or more target packages. This operation is
       recursive, and must be used with care since it can remove
       many potentially needed packages.

2
+1也感谢-Rc,更多内容请访问Arch Wiki
vladkras
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.