debian9使用安装命令apt-get install时遇错误404
问题如下图
错误:1 http://security.debian.org/debian-security stretch/updates/main amd64 poppler-utils amd64 0.48.0-2+deb9u4
404 Not Found [IP: 151.101.194.132 80]
E: 无法下载 http://security.debian.org/debian-security/pool/updates/main/p/poppler/poppler-utils_0.48.0-2+deb9u4_amd64.deb 404 Not Found [IP: 151.101.194.132 80]
解决办法:
第一步:先备份/etc/apt/sources.list
第二步:根据系统版本(命令hostnamectl 查看系统版本)在阿里巴巴镜像源找到合适的镜像源
以下是系统debian9的示例
编辑/etc/apt/sources.list文件(需要使用sudo), 在文件最前面添加以下条目
deb https://mirrors.aliyun.com/debian-archive/debian stretch main contrib non-free
#deb https://mirrors.aliyun.com/debian-archive/debian stretch-proposed-updates main non-free contrib
deb https://mirrors.aliyun.com/debian-archive/debian stretch-backports main non-free contrib
deb https://mirrors.aliyun.com/debian-archive/debian-security stretch/updates main contrib non-free
deb-src https://mirrors.aliyun.com/debian-archive/debian stretch main contrib non-free
#deb-src https://mirrors.aliyun.com/debian-archive/debian stretch-proposed-updates main contrib non-free
deb-src https://mirrors.aliyun.com/debian-archive/debian stretch-backports main contrib non-free
deb-src https://mirrors.aliyun.com/debian-archive/debian-security stretch/updates main contrib non-free
第三步:执行sudo apt-get update
如果update时遇见下图一直卡主的情况
解决办法:将/etc/apt/sources.list文件中的https改成http;然后再执行sudo apt-get update,能顺利执行下去就可以再试一次安装了