ubuntu作为一个Linux发行版,自带桌面环境,成为许多linux初学者与借助linux平台开发研究者的共同选择。
到目前(2020.9),ubuntu最新版本为20.04,其桌面效果与windows基本没有区别,网络、显示、多媒体等也比较完善,linux桌面也可以设置得很好看。
一、更换apt源
ubuntu使用apt管理软件及包,默认搜索下载网址在国外,安装下载过程可能会十分痛苦。ubuntu桌面软件商店默认安装更新下载源也在官网,速度感人;软件商店体验极差,强烈建议使用命令行工具进行安装配置。所以将软件包下载源换为国内镜像站可能是安装好ubuntu后的首要工作。国内镜像站包括阿里,清华等等。
1.首先查看ubuntu发行版本,不同版本apt源地址是不同的!
uname -a
cat /proc/version
lsb_release -a

lsb_release -a命令会打印出Ubuntu具体版本(这里是16.04LTS);配置文件/proc/version里也有记录。
2.修改apt源配置文件
apt源配置文件是 /etc/apt/sources.list,原来文件里是软件包下载更新官方地址,我们只需要将其更换为清华镜像站地址或者阿里镜像站地址即可。二者地址见下面链接,这里以清华的为例。
清华源:
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
阿里源:
https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.3e221b11vI2pY3
sudo mv /etc/apt/sources.list /etc/aptsources.list.old # rename the original file
sudo vim /etc/apt/sources.list # create a new
将以下内容复制到vim编辑器中,wq保存退出。(不会vim去学学吧)
# ubuntu16.04
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
之后记得更新apt包列表,并更新可升级软件:
sudo apt update
sudo apt upgrade
3.enjoy it !
更换源之后再使用apt安装软件包速度会快很多,下载地址会从国外网站变为国内镜像站。