Community Packages

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#73352 - "pacman -Syu" has overwritten all system files with empty files

Attached to Project: Community Packages
Opened by andrew (andrew-ld) - Thursday, 13 January 2022, 20:19 GMT
Last edited by George Rawlinson (rawlinsong) - Monday, 17 January 2022, 20:13 GMT
Task Type Bug Report
Category Packages
Status Assigned
Assigned To Allan McRae (Allan)
Levente Polyak (anthraxx)
Architecture x86_64
Severity Critical
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 1
Private No


today while running a "pacman -Syu" I noticed that ldconfig was starting to complain that some shared libraries were empty files. not paying much attention to this problem I restarted the computer and it could no longer load some system modules, I noticed that the initramfs was not updated so I tried to do it manually but the .preset file was empty, doing some analysis I noticed that every single updated package overwrote both the configuration and binaries with empty files.

Additional info:
package version: Pacman v6.0.1 - libalpm v13.0.1

- I honestly have no idea how something of this caliber could have happened, I have no modified system configuration, I keep the system as standard as possible with defaults.

- I tried to reinstall all system packages (I cleared pacman cache first), after this massive reinstall the system binaries are restored. system configurations, on the other hand, remained empty files.

- I don't have any third party repo and i haven't updated any packages from aur, i don't have any unofficial pacman hooks.

- I checked the system logs with journalctl, I fscked the system filesystem but there is no sign of corruption which could indicate that the problem has existed since before this update.

Steps to reproduce:
pacman -Syu
This task depends upon

Comment by Jonathon (jonathon) - Thursday, 13 January 2022, 22:10 GMT
I've seen similar behaviour in two instances. One was when the disk was filled during the update process (i.e. after pacman calculated the necessary disk space was available), the other was (I think) when an NFS share that held /var/cache/pacman/pkg vanished during the update and left the process in a half-completed state and broken.

Other adjacent issues were due to bad RAM causing filesystem corruption, and when /var/cache/pacman/pkg is a symlink and an update to pacman causes the package cache to vanish part-way through the update.
Comment by andrew (andrew-ld) - Friday, 14 January 2022, 18:29 GMT
Jonathon (jonathon) I don't have any of these setups, the filesystem with the packages is the same filesystem where I installed them.
Comment by Allan McRae (Allan) - Tuesday, 18 January 2022, 00:03 GMT
Diskspace issues would result in one package being empty - even then, it may limit to a single file. Losing the pacman cache makes the current or next package install fail. Neither would explain multiple packages having empty file.

I'm not sure there is anything we can do here. This appears unique in millions of pacman updates, so without further information there is nothing we can do.
Comment by Alexander F. Rødseth (xyproto) - Friday, 21 January 2022, 22:41 GMT
I don't know if it's related or not, but I have an unusual issue with the gambit-c package, where /usr/bin/gsi is empty:

When building with `makepkg`, it's there, but when building with extra-x86_64-build from devtools 20211129-1 and installing the package with `pacman -U`, it's empty.

I tried different compilation flags for gcc, and stripping and not stripping, but I get the same result.

Could this be connected to devtools somehow?
Comment by Allan McRae (Allan) - Saturday, 22 January 2022, 01:52 GMT
That seems entirely unrelated.
Comment by Alexander F. Rødseth (xyproto) - Wednesday, 26 January 2022, 11:37 GMT
Which filesystems are involved here, is it ext4 for the entire /?
Comment by andrew (andrew-ld) - Wednesday, 26 January 2022, 15:58 GMT
Alexander F. Rødseth (xyproto), is a single xfs filesystem, no cryptography, no raid, no custom mount parameters.
Comment by Caleb Maclennan (alerque) - Friday, 04 February 2022, 23:25 GMT
Similar or same issue here last week on a BTRFS root file system (with dedup options enabled) that ran out of space during upgrade. It appeared to have space at the start of the operation but when it ran out pacman overwrote a couple hundred /usr/lib files with 0 size nothingness.
Comment by Joo Kia (Jookia) - Friday, 05 August 2022, 11:24 GMT
I hit this issue a few weeks ago, I had maybe 2GB left on my root partition on btrfs and did an update since pacman okay'd the size required. Evidently something else in my system was eating space.

It did indeed overwrite multiple files with empty files- pacman will not error after it fails to write one file.
Comment by Yauhen (actionless) - Thursday, 24 November 2022, 19:57 GMT
(sorry, didn't noticed that's an old thread already)