問題描述
docker容器中安裝vim報錯 執(zhí)行apt-get install vim后報錯:
E: Unable to locate package vim
更新安裝源也報錯 docker容器中執(zhí)行apt-get update后報錯:
#進入鏡像命令
#docker exec -it 鏡像Id或鏡像name /bin/bash
[root@tdengine ~]# docker exec -it xxxxx /bin/bash
#更新安裝源
root@b258a4f121b3:/# apt-get update
Ign http://security.debian.org jessie/updates InRelease
Ign http://deb.debian.org jessie InRelease
Ign http://security.debian.org jessie/updates Release.gpg
Ign http://deb.debian.org jessie-updates InRelease
Ign http://security.debian.org jessie/updates Release
Err http://security.debian.org jessie/updates/main amd64 Packages
Err http://security.debian.org jessie/updates/main amd64 Packages
Err http://security.debian.org jessie/updates/main amd64 Packages
Err http://security.debian.org jessie/updates/main amd64 Packages
Err http://security.debian.org jessie/updates/main amd64 Packages
404 Not Found [IP: 151.101.194.132 80]
Ign http://deb.debian.org jessie-backports InRelease
Ign http://deb.debian.org jessie Release.gpg
Ign http://deb.debian.org jessie-updates Release.gpg
Ign http://deb.debian.org jessie-backports Release.gpg
Ign http://deb.debian.org jessie Release
Ign http://deb.debian.org jessie-updates Release
Ign http://deb.debian.org jessie-backports Release
Err http://deb.debian.org jessie/main amd64 Packages
404 Not Found
Err http://deb.debian.org jessie-updates/main amd64 Packages
404 Not Found
Err http://deb.debian.org jessie-backports/main amd64 Packages
404 Not Found
W: Failed to fetch http://security.debian.org/dists/jessie/updates/main/binary-amd64/Packages 404 Not Found [IP: 151.101.194.132 80]
W: Failed to fetch http://deb.debian.org/debian/dists/jessie/main/binary-amd64/Packages 404 Not Found
W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages 404 Not Found
W: Failed to fetch http://deb.debian.org/debian/dists/jessie-backports/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
原因分析:
這個錯誤表明你使用的操作系統(tǒng)版本,即 Debian 8 (jessie) 已經(jīng)停止支持并已歸檔,因此官方軟件源已經(jīng)關(guān)閉。
所以更新操作系統(tǒng)包列表時就會遇到 404 錯誤。文章來源:http://www.zghlxwxcb.cn/news/detail-628410.html
解決方案:
如果要繼續(xù)使用這個操作系統(tǒng)版本,你需要使用歸檔的 Debian 鏡像源來更新包列表。
你可以在 /etc/apt/sources.list 文件中添加以下內(nèi)容,指定歸檔源地址(直接執(zhí)行一下命令即可)文章來源地址http://www.zghlxwxcb.cn/news/detail-628410.html
#備份原文件
mv /etc/apt/sources.list /etc/apt/sources.list.bak
#添加源地址
echo "deb http://archive.debian.org/debian/ jessie main" >>/etc/apt/sources.list
echo "deb-src http://archive.debian.org/debian/ jessie main" >>/etc/apt/sources.list
重新安裝
root@b258a4f121b3:/# apt-get update
root@b258a4f121b3:/# apt-get install -y vim
到了這里,關(guān)于【已解決】執(zhí)行apt-get update報錯404 Not Found的解決方案——docker 鏡像下安裝報錯的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!