Ubuntu更换国内源

Posted Pray

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu更换国内源相关的知识,希望对你有一定的参考价值。

Ubuntu更换国内源

备份初始源

  • sudo cp /etc/apt/sources.list{,.bak}
  • 为了方便,也可以直接切换到root进行操作:sudo su - root 

更换源

  • vim /etc/apt/sources.list
  • 删除全部内容之后,添加上新的源

1)阿里源:

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

2)清华源:

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

更新

  • 更新软件列表
    • sudo apt-get update 
  • 更新软件(将已安装的软件与刷新的软件列表中的软件版本进行对比,如果发现已安装的软件版本太低,就会提示更新)
    • sudo apt-get upgrade

 

以上是关于Ubuntu更换国内源的主要内容,如果未能解决你的问题,请参考以下文章

ubuntu apt 更换为国内的源

Ubuntu更换国内源

Ubuntu 18.04桌面可视化更换国内源!!!(图文并茂详细版!!!)

Ubuntu更换国内源

ubuntu20.04 LTS 更换国内163源、阿里源、清华源、中科大源

Ubuntu16.04更换国内源