首先参考:https://blog.csdn.net/u012843189/article/details/80964287
sources.list格式:
deb: 二进制包仓库
deb-src: 二进制包的源码库
URI:库所在的地址,可以是网络地址,也可以是本地的镜像地址
codename: Ubuntu版本的代号。可以用命令lsb_release -sc来查看当前系统的代号;一定要和当前系统版本代号匹配上
components: 软件的性质(free或non-free等)
eg:
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb: deb
URI:https://mirrors.tuna.tsinghua.edu.cn/ubuntu/
codename: bionic
components: main restricted universe multiverse
常见错误:
(1)ubuntu版本错误
用命令lsb_release -sc来查看当前系统,替换源中的所有codename字段
(2)AMD处理器换源失败
添加处理器架构,对于64位AMD CPU,添加[arch=amd64]
eg:deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
(3)AppStream system cache was updated, but problems were found: Metadata files have errors: /var/cache/app-info/xmls/fwupd.xml
执行命令:
rm /var/cache/app-info/xmls/fwupd.xml
sudo appstreamcli refresh --force
然后从新:
sudo apt update
sudo apt upgrade