centos 7.1-错误存储库

centos 7.1-错误存储库,centos,yum,Centos,Yum,您好,我已在此url下载CENTOS 7的最低版本 所有工作正常…PING和网络正常。例如,我ping到外部主机 但当我说: [root@localhost ~]# yum update Loaded plugins: fastestmirror One of the configured repositories failed (Unknown), and yum doesn't have enough cached data to continue. At this point t

您好,我已在此url下载CENTOS 7的最低版本

所有工作正常…PING和网络正常。例如,我ping到外部主机

但当我说:

[root@localhost ~]# yum update
Loaded plugins: fastestmirror


 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Disable the repository, so yum won't use it by default. Yum will then
        just ignore the repository until you permanently enable it again or use
        --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>

     4. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: base/7/x86_64
文件的内容/etc/yum.repos.d/CentOS Base.repo

[root@localhost ~]# cat /etc/yum.repos.d/CentOS-Base.repo
# 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
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#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/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#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/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#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/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[root@localhost ~]#

取消对此文件中的
baseurl
的注释:
/etc/yum.repos.d/CentOS Base.repo

#基本URL=http://mirror.centos.org/centos/$releasever/os/$basearch/

在该区块中:

[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/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

通过取消注释,我的意思是更改这个:
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
,发送至以下地址:
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
(删除
#
)。

问题是dhcp的配置,请尝试键入

dhclient

检查resolv.conf以查看名称服务器指向的位置。确保它是合法的,因为我指的是网络上的一个旧DNS服务器,该服务器已被清除。我用新的IP地址更新了它

首先,我能够通过使用“dhclient”解决上述问题。但每次重新启动时都必须运行此命令。
这可能是因为您的以太网已禁用,您必须显式启用它。为了永久修复,我编辑了/etc/sysconfig/networkscripts/ifcfg-{yourthernet}(在我的例子中是/etc/sysconfig/networkscripts/ifcfg-eth0),并更改了ONBOOT=yes和boom

这是在通过安装了ius-release.rpm之后,在
/etc/yum.repos.d/epel.repo
中的https连接中出现的错误

sudo yum install -y https://centos7.iuscommunity.org/ius-release.rpm
您需要在
/etc/yum.repos.d/epel.repo
中执行以下操作

baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch

取消注释
baseurl
和以
mirrorlist=

开头的注释行。我在这里登陆是因为我为不同的依赖项(乘客,对于Rails应用程序)添加了一个坏镜像,并通过删除坏镜像解决了这个问题:

rm/etc/yum.repos.d/YOUR-BAD-DEPENDENCY-NAME.repo

e、 g


rm/etc/yum.repos.d/passenger.repo

如果相关的yum存储库实际上处于脱机状态或响应不正确,也会发生此问题

这可能有点难以诊断,但yum-repo可能会响应ping并响应基本URL上的web请求,但无法正确提供包

为了找到有问题的回购,我发现最有效的方法是将每个回购文件移出
/etc/yum.repos.d
,并移动到一个临时保存文件夹(例如
/root/yum_-bak
)中,然后在删除每个回购文件后运行
yum update
。一旦您将有问题的repo移出
/etc/yum.repos.d
,然后
yum update
(以及其他yum命令将再次正常工作。将正在工作的yum repo移回
/etc/yum.repos.d
,您就可以重新开始工作了


请不要忘记在停机结束后将有问题的回购移回
/etc/yum.repos.d

sudo sed-i's/https/http/g'/etc/yum.repos.d/epel.repo
在公司环境中,在添加了

yum install epel-release
这以前不会发生(例如,在
yum update
)上)。我检查了所有答案,但没有一个解决了我的问题。 发现其他回购协议默认使用http,其中epel使用https:

# grep mirror /etc/yum.repos.d/epel.repo
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch&infra=$infra&content=$contentdir
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch&infra=$infra&content=$contentdir
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch&infra=$infra&content=$contentdir
因此,我在CentOS trust store中复制了我们公司的根CA并对其进行了更新:

cp /home/user/my-ca.crt /etc/pki/ca-trust/source/anchors/
update-ca-trust

添加证书后,从EPEL repo更新和安装程序包工作正常!

此文件的内容是什么?
/etc/yum.repos.d/CentOS Base.repo
更新了线程,其中的内容与此相同。CentOS 7 minimal.failure:repodata/repomd.xml from Base:[Errno 256]无更多镜像可供尝试。:[Errno-1]为base导入repomd.xml时出错:在取消对
baseurl
的注释时,repomd.xml文件已损坏,请将其注释掉
mirrorlist
。什么都没有…我已下载centos 6.7,结果相同:-(听起来这可能是由于镜像关闭造成的,您只需等待。有人能解释为什么在开始时会注释掉这一点吗?但我每次重新启动时都必须这样做。有什么更持久的解决方案吗?这是应该标记为绿色勾号的解决方案。每次重新启动时都会添加一个脚本来运行该解决方案!工作正常你像一个字符一样保存了我的dayworks!但是你有33个upvote,仍然有450个,你到底怎么了?谢谢。任何输出中都没有提到IUS,甚至没有报告列表。为什么你认为是IUS发布导致了问题?请扩展你的答案,包括你发布的命令如何解决原始海报的问题。我更改了o在
resolv.conf
上对名称服务器进行排序,并使
yum
正常工作。
cp /home/user/my-ca.crt /etc/pki/ca-trust/source/anchors/
update-ca-trust