更换debian镜像方法

1. Docker下安装vim报错如下

root@72822008d953:/usr/share/nginx/html# apt-get install vim
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package vim

2. 更换镜像

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

3.再次执行apt-get update

Get:1 https://mirrors.tuna.tsinghua.edu.cn/debian buster InRelease [122 kB]
Get:2 https://mirrors.tuna.tsinghua.edu.cn/debian buster-updates InRelease [56.6 kB]
Get:3 https://mirrors.tuna.tsinghua.edu.cn/debian buster-backports InRelease [51.4 kB]
Get:4 https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates InRelease [34.8 kB]
Get:5 https://mirrors.tuna.tsinghua.edu.cn/debian buster/contrib amd64 Packages [50.1 kB]
Get:6 https://mirrors.tuna.tsinghua.edu.cn/debian buster/main amd64 Packages [7911 kB]
Get:7 https://mirrors.tuna.tsinghua.edu.cn/debian buster/non-free amd64 Packages [87.7 kB]
Get:8 https://mirrors.tuna.tsinghua.edu.cn/debian buster-updates/main amd64 Packages [8788 B]
Get:9 https://mirrors.tuna.tsinghua.edu.cn/debian buster-backports/main amd64 Packages [489 kB]
Get:10 https://mirrors.tuna.tsinghua.edu.cn/debian buster-backports/non-free amd64 Packages [37.3 kB]
Get:11 https://mirrors.tuna.tsinghua.edu.cn/debian buster-backports/contrib amd64 Packages [9184 B]
Get:12 https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates/main amd64 Packages [338 kB]
Get:13 https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates/non-free amd64 Packages [556 B]
Fetched 9195 kB in 4s (2139 kB/s)
Reading package lists... Done

4.安装 apt-get install -y vim

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值