msys2 / MSYS2-packages

Package scripts for MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
1.28k stars 483 forks source link

MSYS2 on Windows 10 - cannot update the package database using pacman #2589

Open Sprinkles44 opened 2 years ago

Sprinkles44 commented 2 years ago

I tried to update my MSYS2 on Windows 10 (as per the instructions on https://www.msys2.org/) and I got this error:

OscarAlvarez@Lambda-Station-OA MINGW64 ~
$ pacman -Syu
error: config file /etc/pacman.d/mirrorlist.mingw could not be read: No such file or directory

So I did a fresh install of MSYS2 on Windows 10. I got the binaries from the MSYS2 website and installed it successfully. Now, I am getting the same error.

I went into the /etc/pacman.d/ directory and this is what was inside:

OscarAlvarez@Lambda-Station-OA MINGW64 /etc/pacman.d
$ ls
gnupg  mirrorlist.clang64  mirrorlist.mingw32  mirrorlist.mingw64  mirrorlist.msys  mirrorlist.ucrt64

I didn't find the file so I created an empty file with the name "mirrorlist.mingw" and ran the update but to no avail. So I just deleted the empty file I created. No other flags like -S, -Su, or -Syy, etc. work and produce the same error.

Thank you.

Biswa96 commented 2 years ago

There is something wrong in your pc setup. Antivirus software may delete files without any reason. To workaround this situation

Sprinkles44 commented 2 years ago

I only have the Windows 10 antivirus that comes with the OS. I do not have any other antivirus software.

I downloaded the file then opened MSYS2 and ran the command. I get the same error:

OscarAlvarez@Lambda-Station-OA MSYS ~
# pacman -U --overwrite=* pacman-mirrors-20210706-1-any.pkg.tar.zst
error: config file /etc/pacman.d/mirrorlist.mingw could not be read: No such file or directory

It seems to me that I can't run any pacman command.

You say to run that command but where do I run it, in MSYS2? If I run it with MSYS2, do I move the downloaded file to a specific directory or will the downloaded file just be detected automatically anywhere on my system? It's in my download folder right now.

Thank you.

Biswa96 commented 2 years ago

error: config file /etc/pacman.d/mirrorlist.mingw could not be read: No such file or directory

Create that empty file as you have said in original post. Then run the pacman -U command.

You say to run that command but where do I run it, in MSYS2?

Any msys2/mingw window.

will the downloaded file just be detected automatically anywhere on my system?

You need to specify the full path of that .pkg.tar.zst file in that pacman -U command. Or drag and drop the .pkg.tar.zst file in msys2 window, it will automatically show the full path.

HolyBlackCat commented 2 years ago

Another user had the same problem: https://stackoverflow.com/q/68562503

Sprinkles44 commented 2 years ago

error: config file /etc/pacman.d/mirrorlist.mingw could not be read: No such file or directory

Create that empty file as you have said in original post. Then run the pacman -U command.

You say to run that command but where do I run it, in MSYS2?

Any msys2/mingw window.

will the downloaded file just be detected automatically anywhere on my system?

You need to specify the full path of that .pkg.tar.zst file in that pacman -U command. Or drag and drop the .pkg.tar.zst file in msys2 window, it will automatically show the full path.

Thank you that seems to have worked (sort of). Now I only get this error:

OscarAlvarez@Lambda-Station-OA MSYS ~
$ pacman -Syu
:: Synchronizing package databases...
error: failed to synchronize all databases (no servers configured for repository)

I think I have to add to the repository or something like that but I am not too sure. Thank you again for helping.

jeremyd2019 commented 2 years ago

mv /etc/pacman.d/mirrorlist.mingw.pacnew /etc/pacman.d/mirrorlist.mingw ?

Sprinkles44 commented 2 years ago

Thank you so much, it works perfectly now.