您现在的位置是: 首页 > 运维 Debian apt 使用国内镜像
Debian apt 使用国内镜像
2020-05-20 【运维】 9434人已围观 19522次浏览
简介Debian apt 使用国内镜像
首先是要找到适合自己当前版本的镜像配置
我这里是用的清华大学开源软件镜像站
如果不知道当前对应的 Debian 版本,可以通过查看默认的 apt 源来判断版本
cat /etc/apt/sources.list
返回内容如下
deb http://deb.debian.org/debian buster main
deb http://deb.debian.org/debian buster-updates main
deb http://security.debian.org/debian-security/ buster/updates main
deb http://ftp.debian.org/debian buster-backports main
可以发现 Debian 版本为 buster ,所以直接选择版本为 buster 即可
因为默认的源是 http 的,但是准备使用的镜像源是 https 的,所以需要额外的安装有关 HTTPS 的包
官网要求的是安装
sudo apt install apt-transport-https
实际上只安装这一个是不够的,会提示下面的报错
Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification.
No system certificates available. Try installing ca-certificates.
根据报错和提示信息,发现还需要继续安装 ca-certificates
sudo apt install ca-certificates
以上的包先提前安装,然后备份原始的源的文件,或者是注释掉原有的源,然后在下面新增镜像源,比如
#deb http://deb.debian.org/debian buster main
#deb http://deb.debian.org/debian buster-updates main
#deb http://security.debian.org/debian-security/ buster/updates main
#deb http://ftp.debian.org/debian buster-backports main
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
保存退出,最后更新源,使配置生效
sudo apt update
等待验证,通过后,可以尝试安装之前比较慢的包,试试看效果,可以发现速度有质的提升
很赞哦! (0)
相关文章
- Redis 提示 MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk 解决方案
- 解决Lost connection to MySQL server at 'reading initial communication packet' 的方法
- Linux 常用命令 持续更新中...
- docker mysql 导入 SQL 脚本
- Docker 批量操作命令
- Linux 修改默认的 ssh 22 端口
- sentinel directive while not in sentinel mode 问题解决
- ElasticSearch安装踩坑指南
- linux下各文件夹的结构说明及用途介绍
- Windows CMD 常用命令
点击排行
- Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR DISABLE You can't write or read against a disable instance
- Debian apt 使用国内镜像
- RocketMQ 出现 sendDefaultImpl call timeout 问题
- 类 BASE64Decoder 程序包 sun.misc 找不到符号
- SpringBoot @NotBlank 不生效问题
- 记一次 Mybatis-Plus 自动填充无效问题解决
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
- nuxt 项目完整部署方案
站长推荐
猜你喜欢
- Laravel Dingo/api 出现 The version given was unknown or has no registered routes.报错
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
- 解决Lost connection to MySQL server at 'reading initial communication packet' 的方法
- LNMP 手动更新 SSL 证书
- CentOS 安装 Docker
- 记一次 Mybatis-Plus 自动填充无效问题解决
- win10 cmder Debian 安装配置 oh-my-zsh
- 在更新python时出现dyld: Library not loaded: /usr/local/opt/libpsl/lib/libpsl.5.dylib,Reason: image not found错误解决方案
- start.spring.io访问太慢,构建SpringBoot项目失败
- mybatis中大于等于小于等于的写法