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
- msys2: upgrade pacman before update [skip travis] A suggested workaround for msys2 upgrade breakage: https://github.com/msys2/MSYS2-packages/issues/1962#issuecomment-630315437 — committed to mypaint/mypaint by jplloyd 4 years ago
- chore: fix Windows CI Switch to a `setup-msys2` fork working around https://github.com/msys2/MSYS2-packages/issues/1962 — committed to leanprover/lean4 by Kha 4 years ago
- Fix Windows CI failure (#2868) Works around https://github.com/msys2/MSYS2-packages/issues/1962. — committed to UIUC-PPL/charm by matthiasdiener 4 years ago
- Upgrade pacman before update. Fixed https://github.com/msys2/MSYS2-packages/issues/1962 — committed to punesemu/puNES by punesemu 4 years ago
- [workflows] msys2 pacman update bug workaround https://github.com/msys2/MSYS2-packages/issues/1962 — committed to sumogr/sumokoin by sumogr 4 years ago
- [workflows] msys2 pacman update bug workaround https://github.com/msys2/MSYS2-packages/issues/1962 — committed to sumogr/sumokoin by sumogr 4 years ago
- [workflows] msys2 pacman update bug workaround https://github.com/msys2/MSYS2-packages/issues/1962 — committed to sumogr/sumokoin by sumogr 4 years ago
- [workflows] msys2 pacman update bug workaround https://github.com/msys2/MSYS2-packages/issues/1962 — committed to sumogr/sumokoin by sumogr 4 years ago
- [workflows] msys2 pacman update bug workaround https://github.com/msys2/MSYS2-packages/issues/1962 — committed to sumogr/sumokoin by sumogr 4 years ago
- [workflows] msys2 pacman update bug workaround https://github.com/msys2/MSYS2-packages/issues/1962 — committed to sumogr/sumokoin by sumogr 4 years ago
- [workflows] msys2 pacman update bug workaround https://github.com/msys2/MSYS2-packages/issues/1962 — committed to sumogr/sumokoin by sumogr 4 years ago
- [workflows] msys2 pacman update bug workaround https://github.com/msys2/MSYS2-packages/issues/1962 — committed to sumogr/sumokoin by sumogr 4 years ago
- [workflows] msys2 pacman update bug workaround https://github.com/msys2/MSYS2-packages/issues/1962 — committed to sumogr/sumokoin by sumogr 4 years ago
- [workflows] msys2 pacman update bug workaround https://github.com/msys2/MSYS2-packages/issues/1962 — committed to sumogr/sumokoin by sumogr 4 years ago
- [workflows] msys2 pacman update bug workaround https://github.com/msys2/MSYS2-packages/issues/1962 — committed to sumogr/sumokoin by sumogr 4 years ago
- [workflows] msys2 pacman update bug workaround https://github.com/msys2/MSYS2-packages/issues/1962 — committed to sumogr/sumokoin by sumogr 4 years ago
- [workflows] msys2 pacman update bug workaround https://github.com/msys2/MSYS2-packages/issues/1962 — committed to sumogr/sumokoin by sumogr 4 years ago
- [workflows] msys2 pacman update bug workaround https://github.com/msys2/MSYS2-packages/issues/1962 — committed to sumogr/sumokoin by sumogr 4 years ago
- [workflows] msys2 pacman update bug workaround https://github.com/msys2/MSYS2-packages/issues/1962 — committed to sumogr/sumokoin by sumogr 4 years ago
- [workflows] msys2 pacman update bug workaround https://github.com/msys2/MSYS2-packages/issues/1962 — committed to sumogr/sumokoin by sumogr 4 years ago
You can fix this issue by upgrading pacman first:
What about scripted installations – will MSYS2 processes be auto-closed with
--noconfirm
?Still not solved…
I was thinking about something like
No it’s definitely possible, this is what I do for appveyor
Here’s another alternate way to clean up all the zombie processes
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.
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 unrelatedMSYS2
installations (e.g. https://github.com/microsoft/vcpkg/issues/9427).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”:
@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