Linux VPS一键更换软件源脚本(国内VPS换源)
![]() | ![]() | ![]() | ![]() |
| 【性价之王】 | 【线路之王】 | 【价格之王】 | 【配置之王】 |
| 【免费之王】 | 【香港首推】 | 【梯子之王】 | 【独服之王】 |
前言有时候会遇到Linux的源更新速度非常的缓慢,特别是在国内使用默认的源,因为国内的网络环境,经常会出现无法更新,更新缓慢的情况。在这种情况下,更换一个更适合或者说更近,更快的软件源,会为你的Linux安装更新操作更加的流畅和顺利。
系统要求:CentOS 5+、Ubuntu 14.04+、Debian 7+
使用命令:
| #下载脚本 | |
| wget git.io/superupdate.sh | |
| #或本站存储脚本 | |
| wget https://maobuni.com/wp-content/uploads/linux/superupdate.sh | |
| #运行脚本 | |
| bash superupdate.sh |
如果第一步你出现错误或执行后无任何输出,请检查是否安装wget和ca-certificates,使用命令:
| #Debian、Ubuntu | |
| apt-get install -y wget && apt-get install -y ca-certificates | |
| #CentOS | |
| yum install -y wget && yum install -y ca-certificates |
对于Debian默认换源为Fastly CDN的mirror这个源有Fastly的加持对境外主机都有不错的速度。对于Ubuntu和 CentOS系统都默认换为阿里云的mirror,这个源有阿里云全球CDN的加持,全球都有不错的速度。
对于Debian系统还设置了四套其他的源,阿里云,CloudFront CDN,网易163,中科大的源,请根据需要使用参数一键设置如:
| bash superupdate.sh cn | |
| bash superupdate.sh 163 | |
| bash superupdate.sh aliyun | |
| bash superupdate.sh aws |
如果配置的文件不满意,一键还原
bash superupdate.sh restore手动更换国内源1、备份现有源
sudo cp /etc/apt/sources.list /etc/apt/sources.list_bak2、一般情况下,将 /etc/apt/sources.list 文件中 Debian 默认的源地址 http://deb.debian.org/ 替换为国内源即可。
| #中国科技大学 | |
| sudo sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list | |
| #网易云163 | |
| sudo sed -i 's/deb.debian.org/mirrors.163.com/g' /etc/apt/sources.list | |
| #阿里云 | |
| sudo sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list | |
| #清华同方 | |
| sudo sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list | |
| #Debian10 源举例 | |
| # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 | |
| deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free | |
| # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free | |
| deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free | |
| # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free | |
| deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free | |
| # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free | |
| deb http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free | |
| # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free |
3、sudo apt-get update 更新索引以生效。
文章转载来源:一键更换Linux软件源脚本
[linux]历史优惠活动内容
猜你可能想看的VPS
- Hostigger→$2.99 月 3GB 内存 30GB SSD 空间虚拟空间(主机)
- 低价一般-virmach→$45 年 1T 硬盘 10T 流量 10Gb美国VPS[主机]
- Hostigger→$11.94 年 1GB 内存 10GB SSD 空虚拟空间(主机)
- soladrive→视频切片服务器等多用途 $395 40 核+80 超全球[VPS测评]
- 劳动节促销 华为云→云服务器 1 折优惠中 1 核 2G 1M 套餐年付全球[VPS测评]
- 小伞云→5 元 月 256MB 内存 3GB 空间 5GB 流量 5Mb虚拟空间(主机)
- 双十二 raksmart→I3 独服仅$46 月 10G 口 不限买 1全球[VPS测评]
- 按时计费 $2.8 月 512M 内存 10G 硬盘 1T 流量@1Gb全球[VPS测评]
- 国人商家慎重-ManSora→港深 IPLC NAT 2 核 256M 全球[VPS测评]
- 共勉关于带宽 满速 专线等的实在话全球[VPS测评]
- INXY→提供 Leaseweb ahCDN UCDN Highwind香港VPS[主机]
- Bootstrap-datepicker 设置开始时间及结束时间可选范围全球[VPS测评]
- 忘记WordPress后台密码要如何找回或修改密码全球[VPS测评]
- CloudCone双十二促销 768MB内存VPS年付低至8美元全球[VPS测评]
- Dvhosting-10$ 月 2核8G内存300G硬盘 32T流量20美国VPS[主机]
- HKServerSolution 4核心 4G内存 20G SSD 3T全球[VPS测评]
- 华凯易佰同比扭亏跨境电商行业回暖H2旺季将至中报追踪全球[VPS测评]
- 深圳市城市交通规划设计研究中心股份有限公司关于与腾讯云计算(北京)有限责全球[VPS测评]
- 亿速云“双11”上云狂欢大促 高防云服务器、裸金属服务器优惠套餐全球[VPS测评]
- 2022年最新的15个美容院抖音文案,美容院文案怎么写全球[VPS测评]
- 瓜云互联怎么样?香港/美国洛杉矶CN2高防vps 50G月付34元美国VPS[主机]
- 腾讯云香港/韩国/日本免备案服务器优惠促销活动日本VPS[主机]
- 江苏高防服务器哪里买?宿迁BGP、宿迁双线高防服务器的价格全球[VPS测评]
- 亿速互联怎么样?香港沙田vps,2核1G3M云主机仅98元/月,780元香港VPS[主机]
- 快云科技:香港CN2 GIA云服务器,全场7折终身优惠,带宽20M,20香港VPS[主机]
- 极光kvm怎么样,便宜大带宽香港cmi vps/美国gia vps低至1美国VPS[主机]
- 亿速云双12年终回馈:云服务器2折活动,订单满100元减50元全球[VPS测评]
- 用玩客云做打印服务器,让你在手机上轻松实现无线打印全球[VPS测评]
- HostXen:双十一新用户香港、日本vps,送20元代金券,充值300日本VPS[主机]
- 春天的风最容易温暖心灵,适合朋友圈和抖音的12条文案全球[VPS测评]
转载请注明原文地址:http://140.238.13.167:12355/read-228809.html











