Linux 之 Ubuntu apt-get 更换镜像
Ubuntu apt-get 镜像 大约 2309 字备份原先数据源
mv /etc/apt/sources.list /etc/apt/sources.list.bak
清华大学镜像(推荐)
以Ubuntu 20.04 LTS
版本为例。
查看不同版本可至清华大学开源软件镜像站:https://mirrors.cnnic.cn/help/ubuntu
注意:执行在shell
中执行即可,如果要自行编辑文件添加,记得去除首尾各一行的cat...
和EOF
cat > /etc/apt/sources.list << EOF
# 默认注释了源码镜像以提高 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
EOF
添加阿里源
cat > /etc/apt/sources.list << EOF
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
EOF
升级apt
apt-get update
阅读 3373 · 发布于 2019-03-27
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看
换一批
-
OpenLDAP 简介阅读 52
-
Spring Boot JPA 为数据表列 Column 添加注释阅读 1168
-
Windows 使用 Chrome 调试运行在 iOS 设备的网页阅读 3094
-
Windows 子系统 Ubuntu 启动 Docker 报错解决方法阅读 4849
-
算法每日一题20190623:最长公共前缀阅读 2459
-
Java 并发编程之 AQS ReentrantLock 公平锁源码解析阅读 1520
-
Linux uniq 命令简单使用阅读 3074
-
macOS Rust Cargo 添加镜像阅读 326
-
JavaScript 打开页面三种方式阅读 2628
-
Spring Boot 配置 logback 文件阅读 2793