有时候会遇到 Linux 的源更新速度非常的缓慢,特别是在国内使用默认的源,因为国内的网络环境,经常会出现无法更新,更新缓慢的情况。在这种情况下,更换一个更适合或者说更近,更快的软件源,会为你的 Linux 安装更新操作更加的流畅和顺利。

脚本适合 CentOS 5、6、7,Ubuntu 14.04、16.04、18.04,Debian 7、8、9,一键匹配换源。

手动更换源也非常的简单,只需要按几步即可完成,这个脚本只是把这简单的几步用一键完成,为你更换更快的软件源。虽然比较简单,但对管理多台 Linux 服务器的人,或是经常重装系统的人来说能方便不少。

安装脚本

wget  git.io/superupdate.sh
bash superupdate.sh
  • 1.
  • 2.

也可使用一键换源

wget -qO- git.io/superupdate.sh | bash
  • 1.

如果第一步你出现错误或执行后无任何输出,请检查是否安装 wget 和 ca-certificates,请使用

Debian/Ubuntu

apt-get install -y wget && apt-get install -y ca-certificates
  • 1.

Centos

yum install -y wget && yum install -y ca-certificates
  • 1.

对于 Debian 默认换源为 Fastly CDN 的 mirror 这个源有 Fastly

对于 Ubuntu 和 CentOS 系统都默认换为阿里云的 mirror 这个源有阿里云全球 CDN

对于 Debian 系统还设置了四套其他的源,阿里云,CloudFront CDN,网易163,中科大的源,请根据需要使用参数一键设置如

#中科大
bash superupdate.sh cn

#网易163
bash superupdate.sh 163

#阿里云
bash superupdate.sh aliyun

#亚马逊CloudFront
bash superupdate.sh aws
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.

如果配置的文件不满意,一键还原

bash superupdate.sh restore
  • 1.

 

作者:Alone°李道长ご