ubantu可以上网但是拉取不到镜像
时间: 2023-11-29 22:04:43 浏览: 76
如果你能够上网但是拉取不到镜像,可能是因为你的Ubuntu系统没有设置正确的镜像源。你可以尝试更换镜像源,方法如下:
1. 打开终端,输入以下命令备份当前的源列表:
```
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
```
2. 编辑源列表:
```
sudo gedit /etc/apt/sources.list
```
3. 将原来的内容注释掉,添加以下内容:
```
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
```
4. 保存文件并退出。
5. 更新软件包列表:
```
sudo apt-get update
```
这样就可以更换Ubuntu系统的镜像源了,然后就可以尝试重新拉取镜像了。
阅读全文