Docker下安装vim 报错 E: Unable to locate package vim

Docker下安装vim 报错 E: Unable to locate package vim,第1张

Docker下安装vim 报错 E: Unable to locate package vim

1. Docker下安装vim报错如下:

1

2

3

4

5

root@1760b5b54639:/etc/mysql# apt-get install -y vim

Reading package lists... Done

Building dependency tree      

Reading state information... Done

E: Unable to locate package vim

2. 执行apt-get update

 很慢。。。。

3. 修改镜像  清华源

1

2

3

4

5

6

mv /etc/apt/sources.list /etc/apt/sources.list.bak

echo  "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free" >/etc/apt/sources.list

echo  "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free" >>/etc/apt/sources.list

echo  "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free" >>/etc/apt/sources.list

echo  "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free" >>/etc/apt/sources.list

4. 再次执行apt-get update

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

root@8d19061fa5fa:/# apt-get update

Get:1 http://mirrors.tuna.tsinghua.edu.cn/debian buster InRelease [122 kB]

Get:2 http://repo.mysql.com/apt/debian buster InRelease [21.5 kB]              

Get:3 http://mirrors.tuna.tsinghua.edu.cn/debian buster-updates InRelease [51.9 kB]

Get:4 http://mirrors.tuna.tsinghua.edu.cn/debian buster-backports InRelease [46.7 kB]

Get:5 http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates InRelease [65.4 kB]

Get:6 http://mirrors.tuna.tsinghua.edu.cn/debian buster/contrib amd64 Packages [50.1 kB]

Get:7 http://mirrors.tuna.tsinghua.edu.cn/debian buster/main amd64 Packages [7907 kB]

Get:8 http://repo.mysql.com/apt/debian buster/mysql-5.7 amd64 Packages [5686 B]

Get:9 http://mirrors.tuna.tsinghua.edu.cn/debian buster/non-free amd64 Packages [87.7 kB]

Get:10 http://mirrors.tuna.tsinghua.edu.cn/debian buster-updates/main amd64 Packages [15.2 kB]

Get:11 http://mirrors.tuna.tsinghua.edu.cn/debian buster-backports/main amd64 Packages [488 kB]

Get:12 http://mirrors.tuna.tsinghua.edu.cn/debian buster-backports/non-free amd64 Packages [34.1 kB]

Get:13 http://mirrors.tuna.tsinghua.edu.cn/debian buster-backports/contrib amd64 Packages [9084 B]

Get:14 http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates/non-free amd64 Packages [556 B]

Get:15 http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates/main amd64 Packages [305 kB]

Fetched 9204 kB in 3s (2867 kB/s)                         

Reading package lists... Done

 

5. 安装 apt-get install -y vim

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/4682142.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-07
下一篇 2022-11-07

发表评论

登录后才能评论

评论列表(0条)

保存