MSYS2-packages: Update package database and core system packages: Cannot open package file

Hi there. I’m new to MSYS2 and would like to evaluate it to build some software on windows which needs to be built with gcc.

Unfortunately I get an error on a fresh MSYS2 installation when running pacman -Suy. Sorry, can’t tell if I did something stupid.

zub@space MSYS ~
$ pacman -Syu
:: Synchronizing package databases...
 mingw32 is up to date
 mingw64 is up to date
 msys is up to date
:: Starting core system upgrade...
warning: terminate other MSYS2 programs before proceeding
resolving dependencies...
looking for conflicting packages...

Packages (8) bash-4.4.023-2  filesystem-2020.02-2  libzstd-1.4.4-2  mintty-1~3.1.4-1  msys2-runtime-3.1.4-1  pacman-5.2.1-6  pacman-mirrors-20200329-1  zstd-1.4.4-2

Total Installed Size:  65.76 MiB
Net Upgrade Size:      -3.96 MiB

:: Proceed with installation? [Y/n] Y
(8/8) checking keys in keyring                                                                                [#################################################################] 100%
(8/8) checking package integrity                                                                              [#################################################################] 100%
(8/8) loading package files                                                                                   [#################################################################] 100%
error: could not open file /var/cache/pacman/pkg/msys2-runtime-3.1.4-1-x86_64.pkg.tar.zst: Child process exited with status 127
error: failed to commit transaction (cannot open package file)
Errors occurred, no packages were upgraded.

zub@space MSYS ~
$ ps
      PID    PPID    PGID     WINPID   TTY         UID    STIME COMMAND
     2172    2171    2172      18456  pty0     1049767 17:09:46 /usr/bin/bash
     2171       1    2171      18704  ?        1049767 17:09:46 /usr/bin/mintty
     1729       1    1729      27052  ?        1049767 17:00:47 /usr/bin/gpg-agent
     2285    2172    2285      31244  pty0     1049767 17:10:25 /usr/bin/ps

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 42 (15 by maintainers)

Commits related to this issue

Most upvoted comments

You can fix this issue by upgrading pacman first:

pacman -Sy pacman
pacman -Su

What about scripted installations – will MSYS2 processes be auto-closed with --noconfirm?

Still not solved…

I guess you are planning to filter out the terminal’s process, otherwise it would be a bit confusing for the user if gets suddenly closed.

I was thinking about something like

:: To complete the update all MSYS2 processes including this terminal need to be closed. Confirm to proceed [Y/n]

No it’s definitely possible, this is what I do for appveyor

Here’s another alternate way to clean up all the zombie processes

taskkill /f /fi "MODULES eq msys-2.0.dll"

core packges are .xz again now and pacman will autokill all msys packages on a runtime update.

I’ll release a new installer later today which includes the new pacman version.

What about scripted installations – will MSYS2 processes be auto-closed with --noconfirm?

sure. I still need to figure out how to make those cases not report a non-error exit status. Maybe skip pacman itself and the parent process if it is a bash and we are noconfirm.

edit: SIGTERM and finally taskkill seems to do the trick edit2: somehow not needed if I skip the calling process, shrug

I wouldn’t recommend killing GnuPG daemons with taskkill since it does not discriminate by image (executable/library) path and will mess with unrelated MSYS2 installations (e.g. https://github.com/microsoft/vcpkg/issues/9427).

Here’s another alternate way to clean up all the zombie processes

taskkill /f /fi "MODULES eq msys-2.0.dll"

This seems like a good solution to me. What about we run this at the end of every core update? (with confirmation in the tty case)

Or you can kill them “natively”:

/usr/bin/gpgconf --homedir /etc/pacman.d/gnupg --kill all

@ZuBsPaCe it should be printed in the terminal that you should close all remaining MSYS2 processes (or simply reboot) after the update before opening the shell again.

This issue is also affecting AppVeyor builds