ubuntu18.04 更换源及源问题,github问题

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 #刷新数据
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值