Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#73306 - Pacman deletes itself during update to 6.0.1-3, unable to finish update.

Attached to Project: Arch Linux
Opened by Pawel Kraszewski (PKraszewski) - Sunday, 09 January 2022, 09:44 GMT
Task Type Bug Report
Category Packages: Core
Status Unconfirmed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No



Pacman 6.0.1-3 generously deletes itself during update. It is hard to update pacman, when there's no pacman in system... You can't manually install it from cache, because cache is wiped along with pacman itself. Convenient.

Steps to reproduce:

> sudo pacman -Suy

Steps to fix:

1/ Remove empty /var/lib/pacman/local/pacman-6.0.1-3
2/ Download pacman-6.0.1-3-x86_64.pkg.tar.zst from web
3/ Extract just /usr directory into root of your system (filling /usr/bin, /usr/share and /usr/lib with all the necessary goods)
4/ Force install with (now working) pacman -U --overwrite "*" pacman-6.0.1-3-x86_64.pkg.tar.zst

Hope it helps

This task depends upon

2022-01-09: A task closure has been requested. Reason for request: Duplicate of FS#72228 and others
Comment by Maxim (mxfm) - Sunday, 09 January 2022, 10:47 GMT
There is some user error. I recently updated pacman to 6.0.1-3, the process was fine. Also, updating pacman should not wipe cache.
Comment by Doug Newgard (Scimmia) - Sunday, 09 January 2022, 10:58 GMT
Let me guess, you replaced /var/cache/pacman with a symlink? If so, yeah, it's a problem. This is why you can change the CacheDir in pacman.conf, and why bind mounts exist.
Comment by Jonathon (jonathon) - Sunday, 09 January 2022, 12:24 GMT
To second Scimmia's observation, the only time I've seen this happen is when /var/cache/pacman/pkg is a symlink.

As an aside, another option for fixing systems with a broken pacman is pacman-static.
Comment by Pawel Kraszewski (PKraszewski) - Sunday, 09 January 2022, 15:14 GMT
Ok, I *know* Arch is for, um, specific kind of people. Some sanity tests? Like big red fu*g error "pacman can't continue with cache in symlinked directory", for example? *AND* big red "don't put cache in symlinked dir" in ?

"Yes, we know" is the worst kind of answer...

> As an aside, another option for fixing systems with a broken pacman is pacman-static.

Yes, and for fixing systems where kernel upgrade failed along the way, and you are left with kernel without initramfs, the solution is having linux-lts installed (because, oh my, you first remove old kernel and initramfs and only then _eventually_ install new ones). Like in "if you are careful enough, you can safely handle grenades with pin removed".

I still like Arch, just a little less passionately.
Comment by Doug Newgard (Scimmia) - Sunday, 09 January 2022, 15:28 GMT
Linux in general, and Arch specifically, don't stop you from destroying your system. It's not a test, it's expecting people to handle their own system responsibly. You replaced a dir that's managed by the package manager with a file. When it updated, that file got replaced with a dir again. That's normal, expected behavior. Pacman should probably handle cache problems a bit better, but it is what it is right now.

Symlinks are not the solution to every problem.
Comment by Pawel Kraszewski (PKraszewski) - Sunday, 09 January 2022, 15:57 GMT
I build custom Linuxen and BSDs for living for over a decade. This is the first and only system with "we forgot to tell you, if you incorrectly lock seatbelts, your engine will blow the head gasket" scenario. I destroyed my systems in ways you can't imagine, always being able to bring them back from the dead (at least from a backup). I don't expect Arch to hold my hand (one of the reasons I chose it), I just expect it not to go up in flames due to as trivial (or not, as was I gently reminded) thing as cache being a symlink, without a word of explanation or warning.

What is the procedure to update wiki? Just register account and propose fix?

I suppose the case might be closed.

Side note: AUR/pacman-static won't compile, if that's the version you mentioned.
Comment by Hanabishi (Hanabishi) - Wednesday, 12 January 2022, 14:23 GMT
Maybe a bit offtopic, but this FS made me to ask: why empty `/var/cache/pacman/pkg` directory is even included in the package?
If cache directory doesn't exist, pacman will create it anyway. (like `warning: no /var/cache/pacman/pkg/ cache exists, creating...`)
Also when the directory was moved (using `CacheDir` option), pacman update raises unnecessary warning (`warning: could not get file information for var/cache/pacman/pkg/`).