arch安装包请求404错误的问题

arch安装包请求404错误的问题

报错
[root@archlinux pkg]# pacman -S git

resolving dependencies...
looking for conflicting packages...

Packages (4) perl-error-0.17029-3  perl-mailtools-2.21-5  perl-timedate-2.33-3  git-2.32.0-1

Total Download Size:    5.86 MiB
Total Installed Size:  32.52 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 git-2.32.0-1-x86_64.pkg.tar.zst failed to download
error: failed retrieving file 'git-2.32.0-1-x86_64.pkg.tar.zst' from mirrors.bfsu.edu.cn : The requested URL returned error: 404
error: failed retrieving file 'git-2.32.0-1-x86_64.pkg.tar.zst' from mirrors.cqu.edu.cn : The requested URL returned error: 404
error: failed retrieving file 'git-2.32.0-1-x86_64.pkg.tar.zst' from mirrors.dgut.edu.cn : The requested URL returned error: 404
error: failed retrieving file 'git-2.32.0-1-x86_64.pkg.tar.zst' from mirrors.hit.edu.cn : The requested URL returned error: 404
error: failed retrieving file 'git-2.32.0-1-x86_64.pkg.tar.zst' from mirrors.hit.edu.cn : The requested URL returned error: 404
error: failed retrieving file 'git-2.32.0-1-x86_64.pkg.tar.zst' from mirror.lzu.edu.cn : The requested URL returned error: 404
error: failed retrieving file 'git-2.32.0-1-x86_64.pkg.tar.zst' from mirrors.neusoft.edu.cn : The requested URL returned error: 404
error: failed retrieving file 'git-2.32.0-1-x86_64.pkg.tar.zst' from mirrors.neusoft.edu.cn : The requested URL returned error: 404
error: failed retrieving file 'git-2.32.0-1-x86_64.pkg.tar.zst' from mirrors.nju.edu.cn : The requested URL returned error: 404
error: failed retrieving file 'git-2.32.0-1-x86_64.pkg.tar.zst' from mirrors.nju.edu.cn : The requested URL returned error: 404
error: failed retrieving file 'git-2.32.0-1-x86_64.pkg.tar.zst' from mirror.redrock.team : The requested URL returned error: 404
error: failed retrieving file 'git-2.32.0-1-x86_64.pkg.tar.zst' from mirrors.163.com : The requested URL returned error: 404
warning: failed to retrieve some files
error: failed to commit transaction (failed to retrieve some files)
Errors occurred, no packages were upgraded.
[root@archlinux pkg]# 

参考资料: 官网pacman说明

安装清理工具
[root@archlinux pkg]# pacman -S pacman-contrib
可以正常安装。
但是paccache -r 没有清理掉任何文件

[xy@archlinux ~]$ cd /var/cache/pacman/pkg
[root@archlinux pkg]# paccache -r
==> no candidate packages found for pruning
[root@archlinux pkg]# paccache -rf
==> no candidate packages found for pruning
[root@archlinux pkg]# ls|wc -l
177

pacman也有一些内建参数用于清除缓存和那些不再在/etc/pacman.conf配置文件中列出的软件仓库残留数据库文件。然而pacman并不提供保留一定数量的过去版本的功能,因此它比paccache的默认选项更加激进。
要删除目前没有安装的所有缓存的包,和没有被使用的同步数据库,执行:

# pacman -Sc

要删除缓存中的全部文件,使用两次-c开关。这是最为激进的方式,将会清空缓存文件夹:

# pacman -Scc
[root@archlinux pkg]# pacman -Scc

Cache directory: /var/cache/pacman/pkg/
:: Do you want to remove ALL files from cache? [y/N] y
removing all files from cache...

Database directory: /var/lib/pacman/
:: Do you want to remove unused repositories? [Y/n] y
removing unused sync repositories...
[root@archlinux pkg]# ls|wc -l
0
[root@archlinux pkg]#

还是无法安装

Arch是滚动版本,可能是软件库更新了,但没有找到对应命令;只能更新一下系统,把系统的所有包都更新到最新。
pacman -Syu
:: Proceed with installation? [Y/n] n
这里选择n可以更新库
再次安装git正常。

如果遇到下载慢的问题,
error: failed retrieving file ‘core.db’ from mirrors.163.com : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds

调整网站的前后
/etc/pacman.d/mirrorlist
比如,调整后的

[root@archlinux pacman.d]# cat mirrorlist
## China
Server = https://mirrors.cqu.edu.cn/archlinux/$repo/os/$arch
Server = https://mirrors.163.com/archlinux/$repo/os/$arch
...
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值