ubuntu apt 更新清华园镜像

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/dty306034831/article/details/79188808

  • 备份源文件

cd /etc/apt/

源文件为sources.list ,输入命令 

sudo cp sources.list sources.list.bak 

就是将sources.list备份到sources.list.bak

  • 替换源文件

清华大学源 --> https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

# 默认注释了源码镜像以提高 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

sudo gedit sources.list

用编辑器打开文件,将里面的代码替换成上面的代码即可

  • 更新源

   sudo apt-get update 更新源  
   sudo apt-get upgrade 更新软件

你可能感兴趣的:(ubuntu apt 更新清华园镜像)