FS#72228 - Packman update failed when /var/cache/pacman/pkg is a symlink to other location.

Attached to Project: Pacman
Opened by Patryk Kowalczyk (patryk) - Friday, 24 September 2021, 13:39 GMT
Last edited by Allan McRae (Allan) - Friday, 24 September 2021, 22:52 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To No-one
Architecture All
Severity Critical
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description:
Packman system update failed when /var/cache/pacman/pkg is a symlink to other location.

Additional info:
* package version(s): pacman 6.0.1-2

Steps to reproduce:
I have performed update of the system via command pacman -Syu
Durign the installation process I have got error like :

( 79/711) upgrading pacman-mirrorlist [######################################################################] 100%
warning: /etc/pacman.d/mirrorlist installed as /etc/pacman.d/mirrorlist.pacnew
error: could not open file /var/cache/pacman/pkg/pacman-6.0.1-2-armv7h.pkg.tar.xz: No such file or directory
error: could not commit transaction
error: failed to commit transaction (transaction aborted)
Errors occurred, no packages were upgraded.

That same problem on the x86_64. Problem not occured when I used bind in the fstab.

I the log we can see
[2021-09-24T14:51:57+0200] [ALPM] warning: /etc/pacman.d/mirrorlist installed as /etc/pacman.d/mirrorlist.pacnew
[2021-09-24T14:51:57+0200] [ALPM] upgraded pacman-mirrorlist (20210307-1 -> 20210918-1)
[2021-09-24T14:52:00+0200] [ALPM] transaction failed

I can see that during update of the pacman package scripts removed /var/cache/pacman/pkg symlink to the location on other partition.

I think pacman installation hooks should check location and if it's a symlink check target location before remove it. During system update pacman will cut off access to the packages.

best regards,
This task depends upon

Closed by  Allan McRae (Allan)
Friday, 24 September 2021, 22:52 GMT
Reason for closing:  Not a bug
Comment by Allan McRae (Allan) - Friday, 24 September 2021, 22:51 GMT
Replacing directories that are owned by a package with symlinks is not supported. Use a bind mount, or just configure the directory in /etc/pacman.conf.

Loading...