解决yum没资源命令及解决因centos6官方yum关闭无法安装宝塔解决方案

今天重新安装centos6.6之后发现宝塔无法正常安装了。如下图:

查看原因是因为官方yum源停止更新支持了。所以导致centos6.8无法安装宝塔了。
固而写了这个结局方案代码。

第一步执行:跳转指定文件夹
cd /etc/yum.repos.d/

第二步执行:备份原文件
curl -o /etc/yum.repos.d/CentOS-Base.repo http://www.mir6.com/tool/centos6yum/Centos-6.txt

第三步执行:更新新都yum源
curl -o /etc/yum.repos.d/epel.repo http://www.mir6.com/tool/centos6yum/epel-6.txt

第四步执行:清理缓存
yum clean all

第六步执行:更新yum
yum makecache

 

如果需要更新已安装软件,执行第七步:
yum update

 

————————————————————————-
附带以上代码中下载地址 Centos-6.txt 代码:
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever – Base – mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/
http://mirrors.aliyuncs.com/centos-vault/6.10/os/$basearch/
http://mirrors.cloud.tencent.com/centos/$releasever/os/$basearch/
http://mirrors.tencentyun.com/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever – Updates – mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/
http://mirrors.aliyuncs.com/centos-vault/6.10/updates/$basearch/
http://mirrors.cloud.tencent.com/centos/$releasever/updates/$basearch/
http://mirrors.tencentyun.com/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-$releasever – Extras – mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/extras/$basearch/
http://mirrors.aliyuncs.com/centos-vault/6.10/extras/$basearch/
http://mirrors.cloud.tencent.com/centos/$releasever/extras/$basearch/
http://mirrors.tencentyun.com/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever – Plus – mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/centosplus/$basearch/
http://mirrors.aliyuncs.com/centos-vault/6.10/centosplus/$basearch/
http://mirrors.cloud.tencent.com/centos/$releasever/centosplus/$basearch/
http://mirrors.tencentyun.com/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

#contrib – packages by Centos Users
[contrib]
name=CentOS-$releasever – Contrib – mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/contrib/$basearch/
http://mirrors.aliyuncs.com/centos-vault/6.10/contrib/$basearch/
http://mirrors.cloud.tencent.com/centos/$releasever/contrib/$basearch/
http://mirrors.tencentyun.com/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

 

————————————————————————-
附带以上代码中下载地址 epel-6.txt 代码:

[epel]
name=Extra Packages for Enterprise Linux 6 – $basearch
baseurl=http://mirrors.aliyun.com/epel-archive/6/$basearch
http://mirrors.aliyuncs.com/epel-archive/6/$basearch
http://mirrors.cloud.tencent.com/epel/6/$basearch
http://mirrors.tencentyun.com/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 – $basearch – Debug
baseurl=http://mirrors.aliyun.com/epel-archive/6/$basearch/debug
http://mirrors.aliyuncs.com/epel-archive/6/$basearch/debug
http://mirrors.cloud.tencent.com/epel/6/$basearch/debug
http://mirrors.tencentyun.com/epel/6/$basearch/debug
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=0

[epel-source]
name=Extra Packages for Enterprise Linux 6 – $basearch – Source
baseurl=http://mirrors.aliyun.com/epel-archive/6/SRPMS
http://mirrors.aliyuncs.com/epel-archive/6/SRPMS
http://mirrors.cloud.tencent.com/epel/6/SRPMS
http://mirrors.tencentyun.com/epel/6/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=0

评论0

当前加入VIP价格优惠中,加入VIP会员即可免费下载本站所有资源!点击加入VIP
没有账号? 注册  忘记密码?

社交账号快速登录