Msys2-packages: MSYS2 windows install missing means to decompress ZST archives

Created on 18 May 2020  路  30Comments  路  Source: msys2/MSYS2-packages

I am starting with a fresh install installing MSYS2 on windows 10. After the install is complete I run "pacman -Syuu" to start updating it but it will fail with the error "Unrecognized archive format" for any archives that are a zst file.

Any solution I have found online to help fix it does not apply to windows.

Most helpful comment

@mati865 with this last update, for some reason, closing the mintty window didn't close pacman.
I had to go look for pacman in task manager and then kill it.

All 30 comments

I think got a different error under Win7 using the msys2-x86_64-20190524.exe installer.
I am now trying the nightly build installer msys2-x86_64-latest.exe

Tim S.

I think something is wrong with the "msys2-runtime-3.1.4-1-x86_64.pkg.tar.zst" package.
The lastest.exe installed it; but, is refusing to run again after that.

Tim S.

@stahta01 I tried to fix the issue, via putting binary zstd.exe into msys2 bin folders (took it from mingw-w64-x86_64-zstd-1.4.4-1-any.pkg.tar.xz), but somehow everything broke in different way.

Same issue -- I thought it was fixed by using nightly installer in that i was able to install GCC. However, my first pacman -Syuu that updated msys-runtime made the Msys2 window not open properly again. It just flickers open and disappears almost instantly.

You can fix this issue by upgrading pacman first:

pacman -Sy pacman
pacman -Su

As always, close the terminal and make sure there are no open processes when you see message like that in the terminal.

@mati865 after using this, msys2 stops launching without any errors.

@mamontov-cpp that happens when you haven't closed all remaining MSYS2 processes after upgrading.
I have just tested it on fresh "install" with msys2-base-x86_64-20190524.tar.xz.

@mati865 Thank you! This fixed my issues.

@mati865 with this last update, for some reason, closing the mintty window didn't close pacman.
I had to go look for pacman in task manager and then kill it.

Why switch to zstd for critical packages is beyond me. This broke MSYS2 on my workstation beyond repair...

For me doing a partial update of just pacman leads to segfaults on an older msys2-base package, and updating to a newer base leads to a problem where I can't exit the terminal programmatically after the "you must close your terminal" message pops up (running things from automation).

When ArchLinux enabled zstd compression they provided a statically linked version of pacman with the zstd library so users could break the loop and update the system from an older state with no zstd support. Maybe MSYS2 could do the same?

@reuben

For me doing a partial update of just pacman leads to segfaults on an older msys2-base package

Latest stable installer from 2019-05-24 has recent enough runtime to keep working with that partial upgrade.

updating to a newer base leads to a problem where I can't exit the terminal programmatically after the "you must close your terminal" message pops up (running things from automation).

This was always the case when upgrading runtime because of Windows limitations.
Various parties (like chocolatey msys2 package) have found workarounds over it.

When ArchLinux enabled zstd compression they provided a statically linked version of pacman with the zstd library so users could break the loop and update the system from an older state with no zstd support. Maybe MSYS2 could do the same?

MSYS2 pacman is as much statically compiled as possible. The only dependency apart from Windows DLLs is msys2-runtime.dll. It's based on Cygwin runtime library which does not support static linking.

@mati865 thanks for the pointers. I'll try the Chocolatey self-kill recipe to avoid the hang.

This was always the case when upgrading runtime because of Windows limitations.

FWIW this hang does not happen with the base I'm currently using, msys2-base-x86_64-20180531.

I'm still new to this, but if I use the latest exe then I run into the the zst unrecognized archive files.

If I use the installer from the website then I do NOT get the error upon installation, but I cannot reopen MSYS2 after that. After closing the window (when prompted to do so), I checked in task manager and nothing else was running under "pacman" or "msys2" to close.

@kolt54321 they can have different names like gpgme or dir. The best way to find them is looking for msys-2.0.dll handles with tools like process explorer.

@mati865 Thank you - this worked. Searching for "msys" found all the processes.

Is there a better way to close MSYS2 after initial installation so users do not run into this issue? Say, through the terminal?

I verified using the installer on msys2.org here that updating afterwards via pacman -Syuu works without running into zst archive errors.

FWIW a colleague debugged it and finally was able to get the following setup working to work around the first run hang problem, using msys2-base-x86_64-20200517.tar.xz. This is the first command we run after extracting the archive:

.\msys64\usr\bin\bash.exe --login -cx "export THIS_BASH_PID=$$; ps -ef | grep '[?]' | awk '{print $2}' | grep -v $THIS_BASH_PID | xargs -r kill; exit 0"

Thanks again for pointing to Chocolatey for the inspiration!

You can fix this issue by upgrading pacman first:

pacman -Sy pacman
pacman -Su

As always, close the terminal and make sure there are no open processes when you see message like that in the terminal.

This work around worked for me yesterday. But now I am getting-

error: could not open file /var/cache/pacman/pkg/pacman-5.2.1-7-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.

Background info-
Our installation scripts install msys2 using chocolatey, which pulls msys2 20190524.0.0.20191030 bundled with Pacman v5.1.3. Yesterday I followed this work around and added pacman -Sy pacman, 'pacman -Su'. Thereafter ridk install 2 3 worked perfectly.

@goalkeeper007 pacman was updated in meantime and is now archived with zstd. You can either use newer installer or download libzstd, pacman and zstd from http://repo.msys2.org/msys/x86_64/ and install it with pacman -U.

thanks @mati865. I couldnt find command line version of new installer. And ran into other issues getting downgraded versions to work. Ultimately what worked for me was-

ridk exec pacman -Sy pacman --noconfirm # this fails as my pacman is older, but installs libraries like zstd
ridk exec pacman -U C:\guser\pacman-5.2.1-6-x86_64.pkg.tar.xz --noconfirm
ridk exec pacman -Sy pacman --noconfirm # works this time, as 5.2.1.6->5.2.1.7 works
ridk exec pacman -Su --noconfirm
ridk install 2 3

That completed the installation error-free. Hopefully will help others.

all core packages are .xz again now, so this should be fixed. (see #1969)

all core packages are .xz again now, so this should be fixed. (see #1969)

The main problem is that we are using a build framework and I think that it's not feasible to fix locally the problem.
It's now our build is not working and we should wait for the fix from the framework that using this dependency.

I think that it's not a good idea to break the build for everyone and provide a manual solution of how to fix it.

Please generate the package with the old extension.

@sn-lurman I don鈥檛 want to switch back really.

It was a message that all core packages are .xz again now, so this should be fixed.
And now again it's not working.

@sn-lurman wait when fix will be in repo.

When it will be available?

Try update

@nu8 see https://www.msys2.org/news/#2020-05-31-update-fails-with-could-not-open-file

FYI appveyor now has an image with an up-to-date preinstalled msys2:

image: Visual Studio 2019
Was this page helpful?
0 / 5 - 0 ratings

Related issues

jlinse picture jlinse  路  4Comments

hiroakit picture hiroakit  路  5Comments

Dwitee picture Dwitee  路  7Comments

StarWolf3000 picture StarWolf3000  路  5Comments

transtone picture transtone  路  8Comments