提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
文章目录
前言一、备份原来的源二、更换源Ubuntu20.04(focal)阿里云软件源Ubuntu20.04清华软件源 三、更新软件(源)总结
前言
安装好ubuntu20.04后,在下载软件等安装包的时候,速度特别的慢,为此就想着更换一下镜像源,以此来增加下载的速度!!!
下面是换源的具体流程!!!
提示:以下是本篇文章正文内容,下面案例可供参考
一、备份原来的源
sudo cp /etc/apt/sources.list /etc/apt/sources_init.list
将以前的源备份一下,以防以后可以用的。
二、更换源
sudo gedit /etc/apt/sources.list
使用gedit打开文档,将下边的阿里源复制进去,然后点击保存关闭。
Ubuntu20.04(focal)阿里云软件源
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
Ubuntu20.04清华软件源
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse# 预发布软件源,不建议启用# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
三、更新软件(源)
更新软件列表
sudo apt-get update//执行这个命令之后会访问源列表里的每个网址,并读取软件列表,更新软件源
更新软件
sudo apt-get upgrade//将本地已安装的软件与刚更新的软件列表里对应软件惊醒对比,如果发现已安装的软件版本太低就会提示更新
总结
以上到这里就更换完软件源了,如有不足之处,请大家斧正!!!