Pacman -Syuu: 错误:检索文件失败(“操作过于缓慢”和“SSL证书问题”)

12

我尝试在Win 10下使用pacman -Syuu升级我的Portable Msys2时遇到了问题,详情如下。之前我做过这个没有问题。

问题可能出在哪里?该怎么解决?

$ pacman -Syuu
:: Synchronizing package databases...
 mingw32 is up to date
 mingw64 is up to date
 msys is up to date
:: Starting core system upgrade...
 there is nothing to do
:: Starting full system upgrade...
warning: grep: downgrading from version 3.1-1 to version 3.0-2
warning: libgc: downgrading from version 8.0.0-1 to version 7.6.8-1
warning: mingw-w64-x86_64-binutils: downgrading from version 2.31.1-2 to version 2.30-5
:: Replace mingw-w64-x86_64-minizip with mingw64/mingw-w64-x86_64-zlib? [Y/n] y
:: Replace mingw-w64-x86_64-vulkan with mingw64/mingw-w64-x86_64-vulkan-loader? [Y/n] y
resolving dependencies...
looking for conflicting packages...

Packages (217) autogen-5.18.16-1  bison-3.3.2-1  brotli-1.0.7-1  ca-certificates-20180409-1  cmake-3.13.2-1  curl-7.64.0-2  diffutils-3.7-1  doxygen-1.8.15-1
...

Total Download Size:   1400.65 MiB
Total Installed Size:  9648.15 MiB
Net Upgrade Size:       261.06 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
error: failed retrieving file 'mingw-w64-x86_64-qt5-5.12.1-5-any.pkg.tar.xz' from repo.msys2.org : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
error: failed retrieving file 'mingw-w64-x86_64-qt5-5.12.1-5-any.pkg.tar.xz' from sourceforge.net : SSL certificate problem: unable to get local issuer certificate
error: failed retrieving file 'mingw-w64-x86_64-qt5-5.12.1-5-any.pkg.tar.xz' from www2.futureware.at : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
error: failed retrieving file 'mingw-w64-x86_64-qt5-5.12.1-5-any.pkg.tar.xz' from mirror.yandex.ru : SSL certificate problem: unable to get local issuer certificate
warning: failed to retrieve some files
error: failed to commit transaction (download library error)
Errors occurred, no packages were upgraded.

根据这个链接,我的软件库配置似乎没问题:

$ pacman-conf.exe
[options]
RootDir = /
DBPath = /var/lib/pacman/
CacheDir = /var/cache/pacman/pkg/
HookDir = /etc/pacman.d/hooks/
GPGDir = /etc/pacman.d/gnupg/
LogFile = /var/log/pacman.log
HoldPkg = pacman
Architecture = i686
CheckSpace
UseDelta = 0.000000
CleanMethod = KeepInstalled
SigLevel = PackageRequired
SigLevel = PackageTrustedOnly
SigLevel = DatabaseOptional
SigLevel = DatabaseTrustedOnly
LocalFileSigLevel = PackageOptional
LocalFileSigLevel = PackageTrustedOnly
[mingw32]
Usage = All
Server = http://repo.msys2.org/mingw/i686/
Server = https://sourceforge.net/projects/msys2/files/REPOS/MINGW/i686/
Server = http://www2.futureware.at/~nickoe/msys2-mirror/mingw/i686/
Server = https://mirror.yandex.ru/mirrors/msys2/mingw/i686/
[mingw64]
Usage = All
Server = http://repo.msys2.org/mingw/x86_64/
Server = https://sourceforge.net/projects/msys2/files/REPOS/MINGW/x86_64/
Server = http://www2.futureware.at/~nickoe/msys2-mirror/mingw/x86_64/
Server = https://mirror.yandex.ru/mirrors/msys2/mingw/x86_64/
[msys]
Usage = All
Server = http://repo.msys2.org/msys/i686/
Server = https://sourceforge.net/projects/msys2/files/REPOS/MSYS2/i686/
Server = http://www2.futureware.at/~nickoe/msys2-mirror/msys/i686/
Server = https://mirror.yandex.ru/mirrors/msys2/msys/i686/

相关链接:

https://github.com/msys2/MINGW-packages/issues/1887

https://bbs.archlinux.org/viewtopic.php?id=199693

https://sourceforge.net/p/msys2/discussion/general/thread/8427aab0/


编辑 有人在评论中建议我执行pacman-mirrors ...命令,但是我的系统上好像没有这个可执行文件(也不是脚本、别名等)。另一方面,我已经有了pacman-mirrors,但是它好像没有提供任何可执行文件(至少在msys2中),这正确吗?

$ updatedb
$ locate pacman-mirrors
/var/cache/pacman/pkg/pacman-mirrors-20180604-2-any.pkg.tar.xz
/var/lib/pacman/local/pacman-mirrors-20180604-2
/var/lib/pacman/local/pacman-mirrors-20180604-2/desc
/var/lib/pacman/local/pacman-mirrors-20180604-2/files
/var/lib/pacman/local/pacman-mirrors-20180604-2/mtree
$ pacman -Ql pacman-mirrors
pacman-mirrors /etc/
pacman-mirrors /etc/pacman.d/
pacman-mirrors /etc/pacman.d/mirrorlist.mingw32
pacman-mirrors /etc/pacman.d/mirrorlist.mingw64
pacman-mirrors /etc/pacman.d/mirrorlist.msys
$ pacman --needed -S bash pacman pacman-mirrors msys2-runtime
warning: bash-4.4.023-1 is up to date -- skipping
warning: pacman-5.1.2-2 is up to date -- skipping
warning: pacman-mirrors-20180604-2 is up to date -- skipping
warning: msys2-runtime-2.11.2-1 is up to date -- skipping

你尝试重新加载证书了吗 - sudo pacman -U /var/cache/pacman/pkg/ca-certificates* - jimmy8ball
可能还有镜像的问题吗?你可以更换镜像 - sudo pacman-mirrors -f5 && sudo pacman -Syyu - jimmy8ball
一些命令可能会有所帮助。1. pacman-key --init 2. pacman-key --populate - Biswapriyo
@jimmy8ball - pacman -U ... 没有帮助。 - sancho.s ReinstateMonicaCellio
@Biswapriyo - 我尝试了两个命令,结果是一样的。 - sancho.s ReinstateMonicaCellio
@jimmy8ball - 我似乎已经安装了 pacman-mirrors,但没有可执行文件、脚本等。 - sancho.s ReinstateMonicaCellio
4个回答

17
您可以使用参数 --disable-download-timeout 禁用 pacman 的超时。然后您应该能够下载这个文件:http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-qt5-5.12.1-5-any.pkg.tar.xz。在 pacman 的 man 手册 中有描述。
此外,使用参数 --gpgdir 来指定 GnuPG 用于验证软件包签名的文件目录可能会有所帮助。
另外,您还可以考虑使用参数 --noconfirm 来跳过任何“确定吗?”消息。
至于证书方面,我不确定,也许本地路径配置不正确。无论如何,您仍然可以通过两个仍然通过http提供服务的域来下载。
另外,通过浏览器下载是可以的,屏幕截图仍在显示下载进度: enter image description here

5
加上 --disable-download-timeout 就足以让它正常工作。 - sancho.s ReinstateMonicaCellio

1
我也遇到了这个问题,但我找到了解决办法:打开“添加或删除软件”,进入“偏好设置”,将官方软件源更改为“加拿大”,然后“刷新镜像列表”。可能现在可以正常工作了。

0

MinGW FAQ涵盖了当您的公司MitMs TLS/SSL证书的情况:

  1. 从浏览器中提取https://repo.msys2.org的证书
  2. 将其放置在/etc/pki/ca-trust/source/anchors
  3. 运行update-ca-trust

然而,这可能还不够。MSYS问题指出您还必须复制文件如下:

cp -f /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /usr/ssl/certs/ca-bundle.crt
cp -f /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /usr/ssl/cert.pem
cp -f /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt /usr/ssl/certs/ca-bundle.trust.crt

-1
以下是我用来解决问题的步骤:
  1. sudo nano /etc/pacman.d/mirrorlist(在Manjaro或任何基于Arch的发行版上打开镜像列表)

  2. 在镜像列表中,所有源服务器都将处于活动状态。在所选活动服务器的每行开头放置一个井号,以防止在下载过程中联系该服务器。您不需要所有服务器都处于活动状态,因此只允许靠近您的国家,并在其他未激活的服务器前面放置井号。

## Generated on 2022-08-16 12:13
##
## Please use 'pacman-mirrors -f [NUMBER] [NUMBER]' to modify mirrorlist
## (Use 0 for all mirrors)
##
## Country : Poland
#   Server = https://mirror.tuchola-dc.pl/manjaro/stable/$repo/$arch

## Country : Hungary
#  Serve<p>r = http://mirror.infotronik.hu/mirrors/pub/manjaro/stable/$repo/$arch

## Country : Germany
Server = http://ftp.tu-chemnitz.de/pub/linux/manjaro/stable/$repo/$arch

## Country : Brazil
#   Server = http://linorg.usp.br/manjaro/stable/$repo/$arch

## Country : Costa_Rica
#   Server = https://mirrors.ucr.ac.cr/manjaro/stable/$repo/$arch

## Country : Australia
Server = http://mirror.ventraip.net.au/Manjaro/stable/$repo/$arch
## Country : Australia
Server = http://mirror.ventraip.net.au/Manjaro/stable/$repo/$arch

## Country : Germany
Server = http://ftp.rz.tu-bs.de/pub/mirror/manjaro.org/repos/stable/$repo/$arch

## Country : Germany
Server = https://repo.rhindon.net/manjaro/stable/$repo/$arch

## Country : Brazil
#Server = https://manjaro.c3sl.ufpr.br/stable/$repo/$arch

## Country : United_States
Server = https://mirror.math.princeton.edu/pub/manjaro/stable/$repo/$arch

## Country : Poland
#Server = http://mirror.chmuri.net/manjaro/stable/$repo/$arch

## Country : China
#Server = https://mirrors.sjtug.sjtu.edu.cn/manjarostable/$repo/$arch

## Country : China</p>
#Server = https://mirrors.ustc.edu.cn/manjaro/stable/$repo/$arch

## Country : Germany
Server =https://mirror.netzspielplatz.de/manjaro/packages/stable/$repo/$arch```


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接