zguangj

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
统计
 

更多IT技术文章,欢迎关注微信公众号:运维之美,一个涨姿势的公众号

创建了一个docker,但是vim等基础命令都没有安装,使用apt-get update命令更新源出现如下报错
报错一

root@26eac251281c:/var/lib/apt#  apt-get update
Get:1 http://mirrors.sohu.com precise-updates InRelease [8 B]
Ign http://mirrors.sohu.com precise InRelease                                                                                                                                     
Get:2 http://mirrors.sohu.com precise-backports InRelease [8 B]                                                                                                                   
81% [1 InRelease gpgv 8 B] [Waiting for headers] [Waiting for headers]                                                                                                    1 B/s 0sSIgn http://mirrors.sohu.com precise-updates InRelease                                                                                                                             
E: GPG error: http://mirrors.sohu.com precise-updates InRelease: Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)

报错二

E: Some index files failed to download. They have been ignored, or old ones used instead.

最后修改成如下源解决

root@26eac251281c:/# cat /etc/apt/sources.list
# deb http://snapshot.debian.org/archive/debian/20200607T000000Z buster main
deb http://deb.debian.org/debian buster main
# deb http://snapshot.debian.org/archive/debian-security/20200607T000000Z buster/updates main
deb http://security.debian.org/debian-security buster/updates main
# deb http://snapshot.debian.org/archive/debian/20200607T000000Z buster-updates main
deb http://deb.debian.org/debian buster-updates main

由于docker中暂时没有安装vim,我们可以先通过cat命令追加的方式添加源

root@26eac251281c:/# cat >/etc/apt/sources.list <<EOF
> # deb http://snapshot.debian.org/archive/debian/20200607T000000Z buster main
> deb http://deb.debian.org/debian buster main
> # deb http://snapshot.debian.org/archive/debian-security/20200607T000000Z buster/updates main
> deb http://security.debian.org/debian-security buster/updates main
> # deb http://snapshot.debian.org/archive/debian/20200607T000000Z buster-updates main
> deb http://deb.debian.org/debian buster-updates main
> EOF

也可以尝试修改为如下源

# deb http://snapshot.debian.org/archive/debian/20200607T000000Z buster main
deb http://deb.debian.org/debian buster main
# deb http://snapshot.debian.org/archive/debian-security/20200607T000000Z buster/updates main
deb http://security.debian.org/debian-security buster/updates main
# deb http://snapshot.debian.org/archive/debian/20200607T000000Z buster-updates main
deb http://deb.debian.org/debian buster-updates main

最后在执行apt-get update成功,此时你可以通过apt-get install vim进行命令的安装了。

posted on   运维之美^_^  阅读(74)  评论(0编辑  收藏  举报  
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App
· 张高兴的大模型开发实战:(一)使用 Selenium 进行网页爬虫
 
点击右上角即可分享
微信分享提示