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 pacman.conf. You're the most recent person to discover https://bugs.archlinux.org/task/50298 https://bugs.archlinux.org/task/58804 (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: https://www.archlinux.org/news/now-using-zstandard-instead-of-xz-for-package... (Or use the installation media.) -- Eli Schwartz Bug Wrangler and Trusted User