Java教程

yum -y update 报错: YumRepo Error: All mirror URLs are not using ftp, http[s] or file.

本文主要是介绍yum -y update 报错: YumRepo Error: All mirror URLs are not using ftp, http[s] or file.,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

 

yum更新报错:YumRepo Error: All mirror URLs are not using ftp, http[s] or file.

 

1、检查网络是否接通 ping www.baidu.com,如果没有ping成功请先检查网络问题

 

 

 

2、检查 /etc/yum.repos.d/CentOS-Base.repo文件问题

如果发现文件中 http://mirror.centos.org/centos/releasever/updates/releasever/updates/releasever/updates/basearch/无法访问

 

 

3、解决404问题,把源站点配置改为国内清华大学站点 https://mirrors.tuna.tsinghua.edu.cn/centos-vault 访问

 

 

修改yum源站点配置:vim /etc/yum.repos.d/CentOS-Base.repo


对照清华大学镜像站中的目录修改后如下:

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.8/os/x86_64/
gpgcheck=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.8/os/x86_64/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.8/updates/x86_64/
gpgcheck=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.8/os/x86_64/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.8/extras/x86_64/
gpgcheck=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.8/os/x86_64/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.8/centosplus/x86_64/
gpgcheck=1
enabled=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.8/os/x86_64/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.8/contrib/x86_64/
gpgcheck=1
enabled=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.8/os/x86_64/RPM-GPG-KEY-CentOS-6

 

 4、验证 执行

 

yum -y update

yum -y install wget

 

了解以下操作:

通过 执行 man yum 查看yum的帮助信息 可以知道
yum makecache 是 将服务器上的软件包信息 现在本地缓存,以提高 搜索 安装软件的速度
yum 主要的一下命令如下:
yum search 软件包 搜索软件包
yum install 软件包 安装软件包
yum remove 软件包
yum update 更新系统

 

这篇关于yum -y update 报错: YumRepo Error: All mirror URLs are not using ftp, http[s] or file.的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!