ubuntu配置清华镜像文件

Ubuntu 的软件源配置文件是 /etc/apt/sources.list。在修改之前,先将系统自带的该文件做个备份,将该文件替换为清华源官网提供的内容,即可使用 TUNA 的软件源镜像。最重要的是使用清华源可以走ipv6~
清华源官网:https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/

1、首先需要使用root用户

sudo -s


2、进行源码备份.

cp /etc/apt/sources.list /etc/apt/sources.list.bak


3、进行源列表的修改

vi /etc/apt/sources.list

4、将sources.list中的内容提换如下

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src 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-src 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-src 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
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse


5、如图所示:

å¨è¿éæå¥å¾çæè¿°

6、查看是否已经修改

cat /etc/apt/sources.list


å¨è¿éæå¥å¾çæè¿°

可以看到已经修改成功~
7、执行更新列表

sudo apt-get update 


如图所示:

å¨è¿éæå¥å¾çæè¿°

至此,已经将源更换为清华源~~
--------------------- 
作者:阿呀么耀 
来源:CSDN 
原文:https://blog.csdn.net/CAU_Ayao/article/details/83507338 
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自blog.csdn.net/lxlong89940101/article/details/83868651