CentOS7安装宝塔的方法

迅恒数据中心
因为mirrorlist.centos.org被官网停止了默认镜像源
所以Centos6和Centos7都无法连接系统默认的镜像源
Centos6和Centos7在没修改正常的镜像源是无法安装宝塔系统
我们需要对已安装Centos7的系统修改镜像源
我们可以换为国内阿里或者是新浪、163、腾讯云的
我们这里以将镜像源换为阿里的来操作
1、先备份CentOS-Base.repo
cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.backup
2、下载CentOS 7的对应的新镜像源repo文件到服务器覆盖:
选择一个国内镜像站的yum源
华为镜像站:
https://mirrors.huaweicloud.com 选择操作系统类下的Centos
阿里镜像站:
https://developer.aliyun.com/mirror
清华大学镜像站:
https://mirrors.tuna.tsinghua.edu.cn
这里我选择华为的镜像源,你也可以选择例如阿里、清华的yum源
选择正确的版本号,网页上有提示操作步骤
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.huaweicloud.com/repository/conf/CentOS-7-anon.repo
3、安装wget(为了刷新系统镜像源等用途):
wget --version    #如果已有wget,则跳过安装、直接进行第二步
yum install -y wget
wget --version
4、刷新镜像源:
yum clean all //彻底清理系统中的缓存和临时文件
yum makecache //软件包信息缓存到本地,,以提高搜索和安装软件的速度
yum -y update //升级所有包同时,也升级软件和系统内核
5、剩下就是完美的安装宝塔了

分类:IDC资讯 百度收录 必应收录