ubuntu 替换清华源遇到的问题-不能更新,无法拉取 https 源解决

本文涉及的产品
云数据库 Redis 版,社区版 2GB
推荐场景:
搭建游戏排行榜
简介: ubuntu 替换清华源遇到的问题-不能更新,无法拉取 https 源解决

在ubuntu中替换清华源时候遇到的问题

清华源https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/839886cd3c004deb9abdba851aa48a4c.png

先备份默认的官方源

sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak

sudo vi /etc/apt/sources.list

把上面的链接拷贝到文件中去:

# 默认注释了源码镜像以提高 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 multiverse
deb 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 multiverse
deb 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 multiverse
deb 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

apt-get update

发现更新失败

E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal Release' does not have 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.
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates Release' does not have 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.
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports Release' does not have 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.
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security Release' does not have 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.

839886cd3c004deb9abdba851aa48a4c.png

因为默认的源是 http 的,但是准备使用的镜像源是 https 的,所以需要额外的安装有关 HTTPS 的包

所以安装这两个包之后就可以正常拉取https的源了:

sudo apt install apt-transport-https839886cd3c004deb9abdba851aa48a4c.png

sudo apt install ca-certificates839886cd3c004deb9abdba851aa48a4c.png

相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore     ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
目录
相关文章
|
2月前
|
网络协议 Java 应用服务中间件
Springboot+ubuntu+Let‘s Encrypt配置https
Springboot+ubuntu+Let‘s Encrypt配置https
35 0
|
8月前
|
Ubuntu
Ubuntu系统镜像下载,国内镜像站大全(山大/清华/阿里/浙大/中科大...)
装Ubuntu,是很多理工科同学入门的第一个挑战,首先我们就需要找到一个能用的iso镜像,根据你的网络环境的不同,不同的站点下载速度会不一样,下面列举一下几个比较好用的,都是来自Ubuntu官方推荐镜像站链接导航国内分区
2314 0
|
存储 Ubuntu
Ubuntu用Apache2快速搭建一个HTTP文件服务器
Ubuntu用Apache2快速搭建一个HTTP文件服务器
418 0
|
Ubuntu 容器 Docker
ubuntu 22/21/20/18/16/14 自动切换 apt 阿里云/清华 源
执行脚本选择对应的 apt 源码,下面 aptubuntu22 为apt 源 内容修改写入到:/etc/apt/sources.list 然后执行 sudo apt update 进行更新 修复:docker 可用,bug :在docker 中 $USER 不识别,改用: `id -un` 命令查看当前用户 。 root 用户下 执行完脚本,使用 su - 用户 切换后,继续重复执行脚本
3111 1
|
Ubuntu
ubuntu配置清华源
ubuntu配置清华源
143 0
|
Web App开发 安全 Ubuntu
Ubuntu下Apache2增加HTTPS站点
总览/背景介绍 谷歌一直在推动HTTPS协议的普及从Chrome 56就开始向HTTP网页列为不安全标识说明,Chrome 70把凡是HTTP普通协议的站点都标记红色“不安全”(不安全)警告。在Chrome浏览器的影响下,像火狐,Safari等浏览器也都逐步弃用HTTP了,也把HTTP页面标记“不安全”,像这样的浏览器还不少,而从安全的角度来说使用HTTPS也非常有必要,网站采用HTTPS协议是大势所趋。
2791 0
|
Ubuntu 应用服务中间件 网络安全
|
Ubuntu Linux 网络安全