Incorrect state if package archive is removed during the confirmation dialog
Steps to reproduce:
- Begin to install a package via
pacman -U some-package.pkg.tar.zstd
. - While
:: Proceed with installation? [Y/n]
dialog is waiting for input, delete the target package archive. - Continue the installation process.
Note: I guess same goes for pacman -S
if you delete existing package archive from the cache mid installation.
Pacman fails as expected:
error: could not open file some-package.pkg.tar.zstd: No such file or directory
error: could not commit transaction
error: failed to commit transaction (transaction aborted)
But installation process is not fully aborted, Pacman still creates an empty directory in /var/lib/pacman/local/
. We have a "ghost" package in the system now.
Which prevents further installation
error: could not open file /var/lib/pacman/local/some-package/desc: No such file or directory
warning: could not fully load metadata for package some-package
error: failed to prepare transaction (invalid or corrupted package)
and interferes with basically every other pacman
commands.
That "ghost" package can be deleted though. Pacman throws the error, but does delete it successfully after all.