首页 > 编程源码 > 【技术分享】加速宝塔安装,更换yum源

【技术分享】加速宝塔安装,更换yum源

楼主:占幸子 [1级] · 2020-2-25 ·  浏览1554 · 编程源码 · ID:
前言:
楼主给服务器安装宝塔,发现下载文件有时莫名其妙变得很慢,10Mbps的带宽用出了0.几Mbps的感觉,很恼火,特意寻找了一下解决方法。

发现宝塔控制面板安装慢的解决方法有两种。

方法一:只需充钱,世界可及。
方法二:更换默认YUM源。

下面教程正式开始。

1、先备份,输入下方命令,再按回车。
「mv /etc/yum/repos.d/CentOS-Base.repo{,.date -I}」

2、下载新的CentOS-Base.repo

CentOS 6用这个命令↓
curl -o /etc/yum.repos.d/CentOS-Base.repo
 此处内容已被隐藏,请评论后查看!


CentOS 7用这个命令↓
curl -o /etc/yum.repos.d/CentOS-Base.repo
 此处内容已被隐藏,请评论后查看!


3、添加EPEL

CentOS 6用这个命令↓

wget -O /etc/yum.repos.d/epel-6.repo
 此处内容已被隐藏,请评论后查看!


CentOS 7用这个命令↓

wget -O /etc/yum.repos.d/epel.repo
 此处内容已被隐藏,请评论后查看!


4、清理缓存并生成新的缓存

先输入下面的这个命令,回车
yum clean all

再输入这个命令,按回车,等待处理完成
yum makecache
- 版权声明 - 1、本帖所有言论和图片等纯属网友个人意见,与流星社区立场无关;
2、其他单位或个人使用、转载或引用本帖时必须同时征得该帖子作者占幸子流星社区的同意;
3、备注原文地址:https://bbs.liuxingw.com/t/23824.html,可忽略第2条;
4、帖子作者需承担一切因本文发表而直接或间接导致的相关责任;
5、如本帖内容或部分内容转载自其它媒体,这并不代表本站赞同其观点和对其真实性负责;
6、如本帖若为资源类,将仅限用于学习和研究目的,您必须在下载后的24个小时之内,从您安装或使用的设备中彻底删除上述内容;
7、如果您喜欢该程序,请支持正版软件,购买注册,可以得到更好的正版服务;
8、如本帖侵犯到任何版权或违法问题,请立即邮件告知我们,我们将及时予以处理。
3条回复 |  最后回复于2020-6-17

占幸子 [1级]

步骤一

mv /etc/yum/repos.d/CentOS-Base.repo{,.date -I}
发布于2020-2-25

回复列表

  • 内容加载中...

说点什么...

占幸子 [1级]

步骤二

CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo [hide]http://mirrors.aliyun.com/repo/Centos-5.repo[/hide]' target='_blank'>[hide]http://mirrors.aliyun.com/repo/Centos-5.repo[/hide][/hide]
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo [hide]http://mirrors.aliyun.com/repo/Centos-5.repo[/hide]' target='_blank'>[hide]http://mirrors.aliyun.com/repo/Centos-5.repo[/hide][/hide]

CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo [hide]http://mirrors.aliyun.com/repo/Centos-6.repo[/hide]' target='_blank'>[hide]http://mirrors.aliyun.com/repo/Centos-6.repo[/hide][/hide]
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo [hide]http://mirrors.aliyun.com/repo/Centos-6.repo[/hide]' target='_blank'>[hide]http://mirrors.aliyun.com/repo/Centos-6.repo[/hide][/hide]

CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo [hide]http://mirrors.aliyun.com/repo/Centos-7.repo[/hide]' target='_blank'>[hide]http://mirrors.aliyun.com/repo/Centos-7.repo[/hide][/hide]



curl -o /etc/yum.repos.d/CentOS-Base.repo [hide]http://mirrors.aliyun.com/repo/Centos-7.repo[/hide]' target='_blank'>[hide]http://mirrors.aliyun.com/repo/Centos-7.repo[/hide][/hide]
发布于2020-2-25

回复列表

  • 内容加载中...

说点什么...

[]

冒泡
发布于2020-6-17

回复列表

  • 内容加载中...

说点什么...
登录注册 后才可进行评论
签到
8人签到
已签0天
  • 46611帖子
  • 1936533热点量
  • 184839火热值