Ubuntu 内网镜像
时间: 2023-06-10 17:07:02 浏览: 51
在 Ubuntu 中使用内网镜像可以提高软件包下载速度,减少对外网的依赖。以下是在 Ubuntu 中配置内网镜像的步骤:
1. 打开终端,输入以下命令,备份原有的镜像源文件:
```
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
```
2. 编辑新的镜像源文件,使用以下命令:
```
sudo nano /etc/apt/sources.list
```
3. 在编辑器中添加你选择的内网镜像源,比如清华大学的镜像源:
```
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
```
注意:根据你使用的 Ubuntu 版本选择相应的镜像源。
4. 保存并退出编辑器,运行以下命令更新软件包列表:
```
sudo apt update
```
5. 完成后,你可以使用 `apt` 命令来安装软件包,它将从内网镜像源中下载软件包。
例如,要安装 `vim`:
```
sudo apt install vim
```
如果你还有其他的软件包需要安装,也可以使用类似的命令来安装它们。
希望以上步骤可以帮助你在 Ubuntu 中配置内网镜像。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![application/x-zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)