请前往 模块插件 激活 UI Manage 然后刷新
CloudIPLC

会员中心

技术支持

  1. 门户首页
  2. 帮助中心
  3. 教程文档
  4. 解决Linux主机yum/apt-get速度慢&报错
用户登录
帮助中心

解决Linux主机yum/apt-get速度慢&报错

简要说明:
这个问题来源于系统的源设置。由于我们并不太信任国内资源,因此全部直接使用美国源。
平时有碰到太多运营商利用DNS,做到私自替换同名文件经历,特别是http的链接尤为严重。

 

解决方案:
如您觉得系统更新/安装软件速度慢,请替换使用中国内地源地址(阿里或163,二选一)。
阿里源:https://opsx.alibaba.com/mirror
163源:https://mirrors.163.com/

备注:
1:如果替换源后发现更新会超时或失败,请编辑源文件,将里面的源地址连接由http改成https
2:国内服务器建议使用163源或阿里云源。海外服务器也可以使用阿里云源(阿里源有海外节点)
3:查询系统版本号命令:lsb_release -a


CentOS系统:
1、先安装wget命令及备份原文件:
yum install -y wget && mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/
备注:海外节点用阿里云,国内节点阿里或163都可以.
CentOS 6
阿里源:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
163源:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
CentOS 7
阿里源:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
163源:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

3:下载完成后,修改源文件连接为https
编辑/etc/yum.repos.d/CentOS-Base.repo,将里面所有的http修改为https

4:最后清理升级并重新生成缓存
yum clean all && yum makecache

 


Debian系统:
1、先安装
apt-get update && apt-get install -y apt-transport-https
2、编辑 /etc/apt/sources.list , 删除所有默认的源并替换为以下内容(操作前请做好相应备份)
2、替换完成后需要清理并刷新源rm -rf /var/lib/apt/lists/* && apt-get update

 

Debian 10(buster):
阿里源:
deb https://mirrors.aliyun.com/debian/ buster main
deb-src https://mirrors.aliyun.com/debian/ buster main
deb https://mirrors.aliyun.com/debian/ buster-updates main
deb-src https://mirrors.aliyun.com/debian/ buster-updates main
deb https://mirrors.aliyun.com/debian/ buster-backports main
deb-src https://mirrors.aliyun.com/debian/ buster-backports main
deb https://mirrors.aliyun.com/debian-security buster/updates main
deb-src https://mirrors.aliyun.com/debian-buster stretch/updates main

163源:
deb https://mirrors.163.com/debian/ buster main
deb-src https://mirrors.163.com/debian/ buster main
deb https://mirrors.163.com/debian/ buster-updates main
deb-src https://mirrors.163.com/debian/ buster-updates main
deb https://mirrors.163.com/debian/ buster-backports main
deb-src https://mirrors.163.com/debian/ buster-backports main
deb https://mirrors.163.com/debian-security/ buster/updates main
deb-src https://mirrors.163.com/debian-security/ buster/updates main

 

Debian 9(stretch)
阿里源:
deb https://mirrors.aliyun.com/debian/ stretch main
deb-src https://mirrors.aliyun.com/debian/ stretch main
deb https://mirrors.aliyun.com/debian/ stretch-updates main
deb-src https://mirrors.aliyun.com/debian/ stretch-updates main
deb https://mirrors.aliyun.com/debian/ stretch-backports main
deb-src https://mirrors.aliyun.com/debian/ stretch-backports main
deb https://mirrors.aliyun.com/debian-security stretch/updates main
deb-src https://mirrors.aliyun.com/debian-security stretch/updates main

163源:
deb https://mirrors.163.com/debian/ stretch main
deb-src https://mirrors.163.com/debian/ stretch main
deb https://mirrors.163.com/debian/ stretch-updates main
deb-src https://mirrors.163.com/debian/ stretch-updates main
deb https://mirrors.163.com/debian/ stretch-backports main
deb-src https://mirrors.163.com/debian/ stretch-backports main
deb https://mirrors.163.com/debian-security/ stretch/updates main
deb-src https://mirrors.163.com/debian-security/ stretch/updates main

 

Debian 8(jessie)
阿里源:
deb https://mirrors.aliyun.com/debian/ jessie main
deb-src https://mirrors.aliyun.com/debian/ jessie main
deb https://mirrors.aliyun.com/debian-security/ jessie/updates main
deb-src https://mirrors.aliyun.com/debian-security/ jessie/updates main

163源:
deb https://mirrors.163.com/debian/ jessie main
deb-src https://mirrors.163.com/debian/ jessie main
deb https://mirrors.163.com/debian-security/ jessie/updates main
deb-src https://mirrors.163.com/debian-security/ jessie/updates main

 

Debian 7(wheezy)
阿里源:
deb https://mirrors.aliyun.com/debian/ wheezy main
deb-src https://mirrors.aliyun.com/debian/ wheezy main
deb https://mirrors.aliyun.com/debian-security/ wheezy/updates main
deb-src https://mirrors.aliyun.com/debian-security/ wheezy/updates main

163源:
deb https://mirrors.163.com/debian/ wheezy main
deb-src https://mirrors.163.com/debian/ wheezy main
deb https://mirrors.163.com/debian-security/ wheezy/updates main
deb-src https://mirrors.163.com/debian-security/ wheezy/updates main

 

Ubuntu或其他系统参考:
阿里源:https://opsx.alibaba.com/mirror (找到对应系统,找到操作那列点后面的"帮助")
163源:https://mirrors.163.com/.help/ubuntu.html



补充说明:
国内主机请谨慎使用BBR,在连接条件好的情况下可能会反过来导致减速效果。

 

  • 1 用户发现这个很有用
此文章对您是否有帮助?

Related Articles

<加强安全> 一键防止SSH密码被暴力破解

原理Fail2ban会通过检查日志来匹配错误信息,从而使用iptables来防止暴力破解。理论上只要是能够在服务器本地输出错误日志和访问日志的程序都可以使用Fail2ban来保驾护航。...

<TCP Speeder>系统实例与标准系统的区别

Google BBR 优化算法是2016年9月份才开源的一个优化网络的TCP拥堵算法。 开源地址:https://github.com/google/bbr...

锐速lotServer一键脚本[解决断流问题]及优化

据说91yun锐速会有断流。断流的根本原因是没有完全破解验证机制.虽然延迟启动是个解决办法,但现已经完全解决了这个问题。奉上!...

关于VNC的使用帮助,通过JAVA连接VNC桌面

Firefox51.01:http://dl.cloudiplc.com/tools/Firefox51.01-x86.zip...

屏蔽邮件,PPTP,L2TP端口的说明及解决方案

一:关于屏蔽邮件端口世界那么大,每个国家的法律都有着巨大差异。美国地区是特别严管垃圾邮件(SPAM)我们的服务条款也提到,禁止发送垃圾电子邮件,诈骗/钓鱼、侵犯版权的行为内容;...