UOS (Ubuntu)系统更换国内源

2022-01-10 10:17:45 浏览数 (2)

今天在uos官网上下载UOS服务器版的操作系统,需要更换一下国内的源,下面就和大家一起分享一下。

备份配置文件

代码语言:javascript复制
sudo cp /etc/apt/sources.list{,.bak}

更还源

代码语言:javascript复制
## 删除全部内容之后,添加上新的源
vim /etc/apt/sources.list

下面是常用的国内源

1)阿里源:

代码语言:javascript复制
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 速度,如有需要可自行取消注释

代码语言:javascript复制
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

更新源

  • 更新软件列表
代码语言:javascript复制
sudo apt-get update

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

0 人点赞