[arch-general] oops, 'sudo: pacman: command not found'

Eli Schwartz eschwartz at archlinux.org
Mon Jun 8 01:24:30 UTC 2020

On 6/7/20 9:09 PM, Greg Minshall wrote:
> hi.  a month ago i ran out of room on my root file system, so relocated
> /var/cache/pacman to /home, and left behind a symlink.
> today, after a while, i did a 'pacman -Syu', which downloaded lots, and
> ran through a lot new keys, upgrading, etc., then failed (see below),
> and (the symbolic link at) /var/cache/pacman seems to have disappeared.
> any suggestions on how i might recover?  (and, should i, possibly,
> rather than using a symlink, have modified, e.g., /etc/pacman.conf?)

Your post-disaster analysis is correct. You should have modified

You're the most recent person to discover

(To be clear, pacman "should" learn to fatally abort with "error: you're
not allowed to replace a packaged directory with a symlink", and refuse
to let you pacman -Syu until you put things back where they belong.
Instead, it gets mid transaction, then as part of uninstalling the old
version of pacman it tries to delete /var/cache/pacman/pkg and *doesn't*
skip it since it is not a directory. Boom. Your symlink is uninstalled,
along with the old version of /usr/bin/pacman and everything else, and
then it cannot find the new package anymore to get the replacements.)

> i have all the files still in /home/pacman/pkg, etc. (and have put back
> the symlink).

In that case, reinstalling pacman is an adequate recovery method, though
as the disaster manifested by wiping pacman from your system, you'll
need to extract the *.pkg.tar.zst using bsdtar, or use the static
recovery binaries listed here:

(Or use the installation media.)

Eli Schwartz
Bug Wrangler and Trusted User

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1601 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/arch-general/attachments/20200607/d17e5b2a/attachment.sig>

More information about the arch-general mailing list