Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pacman does not work (hangs) on Windows 10 #82

Closed
mangh opened this issue Sep 29, 2020 · 15 comments
Closed

pacman does not work (hangs) on Windows 10 #82

mangh opened this issue Sep 29, 2020 · 15 comments

Comments

@mangh
Copy link

mangh commented Sep 29, 2020

I was using msys2 for over 2 years with no problem. Until (about) 5th of September.

From that moment I cannot update/upgrade it with pacman. When started (with e.g. pacman -Syu) it hangs, CPU utilization goes up to 30% (no disk, network or memory activity), nothing is happening so I kill pacman with Task Manager.
image

On September 7th I have installed fresh msys2 anew (using msys2-x86_64-20200903.exe installer). Pacman hangs already during installation but somehow (after several attempts) I could manage to run it with an additional command option "--noconfirm" (pacman -Syu --noconfirm). I have no idea how this option can make pacman working (or not) but finally I had it installed.

From that time on, until today, I was updating msys2 with the above command. Today pacman itself has been updated and now it always hangs (with and without "--noconfirm" option) and I have no way to update msys2.

Windows 10 Pro, version 2004, OS Build 19041.508 + Webroot SecureAnywhere Antivirus

@Biswa96
Copy link
Member

Biswa96 commented Sep 29, 2020

Disable the antivirus.

@mangh
Copy link
Author

mangh commented Sep 29, 2020

No way.
It always was and it will be working under antivirus control. Otherwise it will be not installed at all.

@lazka
Copy link
Member

lazka commented Sep 29, 2020

You can add a directory exception for C:\msys64 to your antivirus. And if it doesn't solve the problem you can enable it again.

@mangh
Copy link
Author

mangh commented Sep 29, 2020

What's the difference? I told you: it has to be installed and work under antivirus control! As it was working well for previous 2 years!

@Biswa96
Copy link
Member

Biswa96 commented Sep 29, 2020

Nothing is changed in the code that can do malicious act in someone's PC. All the projects here are free and open source. You can look into it. The issue may be in the antivirus software. To make sure, you can scan the /usr/bin/pacman binary in VirusTotal.

@mangh
Copy link
Author

mangh commented Sep 29, 2020

... and my antivirus is not complaining about msys2! So where did you get the idea that the antivirus is causing the problem? It still the same as it was for last several months. It is pacman that changes frequently last time.

@mingwandroid
Copy link
Member

Many people have different opinions on antivirus software ranging from essential to basically spyware / fearware junk that slows computers down. Personally I use Windows Defender and find that good enough. It has never caused me any problems with MSYS2 at least.

@lazka recommended you exclude MSYS2 from your virus scanner. It is not our fault if your chosen virus scanner suddenly decides it does not like something in our software. The team are implementing some advanced techniques to make our libraries more secure at the moment. It is likely these changes cause problems for some virus scanners. We are not in control of these 3rd party products and you should not take out your anger regarding their mis-functioning on MSYS2 volunteers.

@lazka
Copy link
Member

lazka commented Sep 29, 2020

We are not trying to blame random virus scanners, it's just a common problem that they interfere with cygwin based software like our pacman package, so it's usually the first thing that needs to be ruled out before going further.

See https://cygwin.com/faq/faq.html#faq.using.bloda

@mangh
Copy link
Author

mangh commented Sep 29, 2020

I have disabled antivirus and tried to run pacman. No success. It hangs the same as previously.

MSYS2 software that I installed earlier (emacs, vim, Midnight Commander, grep, sed etc.) is still working without any problem. But not pacman: it is simply hangs. It hangs even on simple command "pacman --help"!

Below you can see several most recent entries from pacman.log: as you can see the last successfull entry was the pacman updating itself. After that it is dead.

[2020-09-25T08:56:02+0200] [PACMAN] Running 'pacman -Syu --noconfirm'
[2020-09-25T08:56:02+0200] [PACMAN] synchronizing package lists
[2020-09-25T08:56:05+0200] [PACMAN] starting core system upgrade
[2020-09-25T08:56:08+0200] [ALPM] transaction started
[2020-09-25T08:56:08+0200] [ALPM] upgraded msys2-runtime (3.1.7-1 -> 3.1.7-2)
[2020-09-25T08:56:08+0200] [ALPM] transaction completed
[2020-09-25T08:56:31+0200] [PACMAN] Running 'pacman -Syu --noconfirm'
[2020-09-25T08:56:31+0200] [PACMAN] synchronizing package lists
[2020-09-25T08:56:32+0200] [PACMAN] starting core system upgrade
[2020-09-25T08:56:32+0200] [PACMAN] starting full system upgrade
[2020-09-25T08:57:47+0200] [ALPM] transaction started
[2020-09-25T08:57:48+0200] [ALPM] upgraded mingw-w64-x86_64-libwinpthread-git (8.0.0.5906.c9a21571-1 -> 8.0.0.6001.98dad1fe-2)
[2020-09-25T08:58:16+0200] [ALPM] upgraded mingw-w64-x86_64-openssl (1.1.1.g-1 -> 1.1.1.h-1)
[2020-09-25T08:58:16+0200] [ALPM] transaction completed
[2020-09-26T08:41:18+0200] [PACMAN] Running 'pacman -Syu --noconfirm'
[2020-09-26T08:41:18+0200] [PACMAN] synchronizing package lists
[2020-09-26T08:41:19+0200] [PACMAN] starting core system upgrade
[2020-09-26T08:41:19+0200] [PACMAN] starting full system upgrade
[2020-09-27T09:29:11+0200] [PACMAN] Running 'pacman -Syu --noconfirm'
[2020-09-27T09:29:11+0200] [PACMAN] synchronizing package lists
[2020-09-27T09:29:12+0200] [PACMAN] starting core system upgrade
[2020-09-27T09:29:12+0200] [PACMAN] starting full system upgrade
[2020-09-28T09:03:03+0200] [PACMAN] Running 'pacman -Syu --noconfirm'
[2020-09-28T09:03:03+0200] [PACMAN] synchronizing package lists
[2020-09-28T09:03:04+0200] [PACMAN] starting core system upgrade
[2020-09-28T09:03:05+0200] [PACMAN] starting full system upgrade
[2020-09-29T08:42:08+0200] [PACMAN] Running 'pacman -Syu --noconfirm'
[2020-09-29T08:42:08+0200] [PACMAN] synchronizing package lists
[2020-09-29T08:42:11+0200] [PACMAN] starting core system upgrade
[2020-09-29T08:42:17+0200] [ALPM] transaction started
[2020-09-29T08:42:20+0200] [ALPM] upgraded pacman (5.2.2-3 -> 5.2.2-4)
[2020-09-29T08:42:20+0200] [ALPM] transaction completed

@lazka
Copy link
Member

lazka commented Oct 1, 2020

Thanks. Can you try running pacman -Syu --noconfirm --debug which should give you more output?

@mangh
Copy link
Author

mangh commented Oct 1, 2020

Thanks for your interest but I have already uninstalled msys2 as - in the light of the earlier responses - I found no other way to go.

@lazka lazka closed this as completed Oct 1, 2020
@MichaelDipperstein
Copy link

I have the same issue after upgrading from version 5.2.2-16 to version 5.2.2-22.

pacman -Syu --noconfirm --debug does not write anything to the terminal window or /var/log/pacman.log. It does however continue to use 26% to 27% of my CPU for as long as I'm willing to allow it.

I'm fairly confident that the virus scanner isn't an issue, but I don't have admin privileges on the PC, so I can't disable it.

The original poster's solution was to uninstall msys2, I'd kind of like msys2 and would rather not go that route. I'd rather a solution that results in a working version of pacman.

@dizzisound
Copy link

@MichaelDipperstein Though the issue is closed, I am exactly in your situation (Win10, updating to 5.2.2-22, no control on my Webroot SA antivirus software), and I just needed a quick solution to let me compile some stuff, so I applied a temporary workaround.
I back-upped my msys2/home folder and the previous msys2 install, then I reinstalled msys2 and launched the sync task forcing it to skip pacman auto-updates, this way:
pacman -Syu --verbose --debug --confirm --ignore pacman
In my case, the --ignore pacman option prevents the updates to hang at the moment, until I will find some time to investigate what's the issue with my system, or whether someone else will find a patch should it reveal to be a more general compatibility issue (or I'll just find a way to bypass my anti-virus, I am working on a corporate machine, you know).

@MichaelDipperstein
Copy link

@dizzisound the virus scanner on my PC is also Webroot. It's possible that's the culprit. In my experimenting, I used a slightly different approach to solve my problem. I'm leaving the solution here to help any future victims of the same problem. I found that pacman-5.2.2-19-x86_64 was the most recent version to not cause any problems. so that's the version that I will use in these instructions.

wget http://repo.msys2.org/msys/x86_64/pacman-5.2.2-19-x86_64.pkg.tar.zst
zstd -d pacman-5.2.2-19-x86_64.pkg.tar.zst -o pacman-5.2.2-19-x86_64.pkg.tar
tar -xvf pacman-5.2.2-19-x86_64.pkg.tar --strip-components 2 usr/bin/pacman.exe
cp pacman.exe /usr/bin/pacman.exe

These instructions just overwrite the offending version of pacman with a working version of pacman. It's not the best thing to do, but it has the advantage of causing the system to think that it still has the version of pacman that caused all the grief, preventing the need for using the --ignore pacman argument when performing updates.

@pojntfx
Copy link

pojntfx commented Dec 26, 2021

I also ran into this issue trying to run MSYS2 on WINE and the --ignore pacman argument (so that the command looks like wine64 bash.exe -c 'pacman --verbose --debug --noconfirm --ignore pacman -S base-devel gcc') + using the stable release (https://github.com/msys2/msys2-installer/releases/tag/2021-11-30) instead of the nightly release has solved it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants