Saturday, January 28, 2017

How do I force remove a package in Arch with pacman

How do I force remove a package in Arch with pacman



How do I force remove a package in Arch with pacman while other packages still depend upon it.
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

1 Answer


You should be able to reinstall the package with a simple:
# pacman -S perl-libwww
This will only remove perl-libwww:
# pacman -Rdd perl-libwww
Please notice the double -d in the command, if you use --nodeps you have to specify that twice too or combine it with a -d like:
# pacman -R --nodeps --nodeps perl-libwww
# pacman -Rd --nodeps perl-libwww
This removes all the packages which depend on perl-libwww:
# pacman -Rc perl-libwww
From pacmans man page:
 -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.


Available link for download