1 系统源
备份源
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
替换清华源
gedit /etc/apt/sources.list
# 默认注释了源码镜像以提高 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
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
更新
sudo apt-get update
报错
Ign:1 http://mirrors.ustc.edu.cn/ros/ubuntu bionic InRelease
Err:3 http://mirrors.ustc.edu.cn/ros/ubuntu bionic Release
404 Not Found [IP: 202.141.160.110 80]
Hit:4 https://packages.microsoft.com/repos/edge stable InRelease
Hit:2 https://packages.microsoft.com/repos/code stable InRelease
Hit:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease
Hit:6 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease
Hit:7 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease
Hit:8 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease
Reading package lists… Done
E: The repository ‘http://mirrors.ustc.edu.cn/ros/ubuntu bionic Release’ no longer has a Release file.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
修改:
更换update源时,先换了mirrors.ustc.edu.cn,但是没有更新完全,于是没有 Release 文件。
之后,我又完全更换源为mirrors.nju.edu.cn
而添加ROS源时输入的是:
sudo sh -c 'echo “deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $(lsb_release -sc) main” > /etc/apt/sources.list.d/ros-latest.list
处理:
cd /etc/apt/sources.list.d
ls
sudo gedit /etc/apt/ros-latest.list
将之前的内容deb http://mirrors.ustc.edu.cn/ros/ubuntu/ bionic main
更换为deb http://mirrors.nju.edu.cn/ros/ubuntu/ bionic main
保存并更新
sudo apt-get update
2 更新源报错
1、解决问题:W: Failed to fetch https://dl.google.com/linux/chrome/deb/dists/stable/InRelease
方法:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6494C6D6997C215E
sudo apt-get update
3 github加速
github ubuntu加速
nslookup github.com
nslookup github.global.ssl.fastly.net
sudo gedit /etc/hosts
运行程序后将前两个的命令获取的数据填入文件最下面
sudo /etc/init.d/networking restart #刷新数据