拉取软件源报错:
E: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/jammy/main/binary-arm64/Packages 404 Not Found [IP: 140.249.32.239 80]
E: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/jammy-security/main/binary-arm64/Packages 404 Not Found [IP: 140.249.32.239 80]
E: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/jammy-updates/main/binary-arm64/Packages 404 Not Found [IP: 140.249.32.239 80]
E: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/jammy-proposed/main/binary-arm64/Packages 404 Not Found [IP: 140.249.32.239 80]
E: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/jammy-backports/main/binary-arm64/Packages 404 Not Found [IP: 140.249.32.239 80]
最终排查到的原因:本机器的cpu是arm架构,各种教程基本默认教你配x86的源,用错源自然找不到所需的包裹信息,报404错误。
解决方法:把阿里源or清华源的url里的ubuntu全部替换成ubuntu-ports,然后重新apt-get update,比如Ubuntu 22.04的清华源改成如下:
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-security main restricted universe multiverse