重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 923|回复: 0
打印 上一主题 下一主题

[安装] linux centos yum 报错「Errno 256」No more mirrors to try 解决方法

[复制链接]
跳转到指定楼层
楼主
发表于 2023-9-1 09:59:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
报错现象:
[root@ods ~]# yum install chrony
Loaded plugins: fastestmirror
Determining fastest mirrors
file:///mnt/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /mnt/repodata/repomd.xml"
Trying other mirror.
Resolving Dependencies
--> Running transaction check
---> Package chrony.x86_64 0:3.2-2.el7 will be installed
--> Processing Dependency: libseccomp.so.2()(64bit) for package: chrony-3.2-2.el7.x86_64
--> Running transaction check
---> Package libseccomp.x86_64 0:2.3.1-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================================================================================
Package                                          Arch                                         Version                                             Repository                                  Size
====================================================================================================================================================================================================
Installing:
chrony                                           x86_64                                       3.2-2.el7                                           base                                       243 k
Installing for dependencies:
libseccomp                                       x86_64                                       2.3.1-3.el7                                         base                                        56 k

Transaction Summary
====================================================================================================================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 299 k
Installed size: 773 k
Is this ok [y/d/N]: y
Downloading packages:


Error downloading packages:
  libseccomp-2.3.1-3.el7.x86_64: [Errno 256] No more mirrors to try.
  chrony-3.2-2.el7.x86_64: [Errno 256] No more mirrors to try.

方法一:
yum clean all    '清空yum缓存
'yum list    '重新加载'


如果还是无法安装,建议使用方法二

方法二:
挂载iso
[root@ods ~]# mount -o loop /home/oracle/dbcheck/rhel-server-7.6-x86_64-dvd.iso /mnt
mount: /dev/loop0 is write-protected, mounting read-only

[root@ods ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root  100G  7.0G   93G   7% /
devtmpfs                  63G     0   63G   0% /dev
tmpfs                     63G     0   63G   0% /dev/shm
tmpfs                     63G  4.0G   59G   7% /run
tmpfs                     63G     0   63G   0% /sys/fs/cgroup
/dev/sda2               1014M  145M  870M  15% /boot
/dev/mapper/data-data    2.5T  1.7T  666G  72% /oradata
/dev/mapper/centos-u01    82G   36G   42G  46% /u01
tmpfs                     13G     0   13G   0% /run/user/0
tmpfs                     13G     0   13G   0% /run/user/1000
/dev/loop0               4.2G  4.2G     0 100% /mnt

[root@ods ~]# cd /etc/yum.repos.d/
[root@ods yum.repos.d]# ll
total 4
drwxr-xr-x. 2 root root 187 Jun 27 09:30 back
-rw-r--r--  1 root root 590 Jun 29 16:08 CentOS-Base.repo
[root@ods yum.repos.d]# more 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=file:///mnt
gpgcheck=0
enabled=1
[root@ods yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak
[root@ods yum.repos.d]# ll
total 8

drwxr-xr-x. 2 root root 187 Jun 27 09:30 back
-rw-r--r--  1 root root 590 Jun 29 16:08 CentOS-Base.repo.bak


重新编辑repo文件[root@ods yum.repos.d]# vi mnt.repo
[mnt]
name=added from: file:///mnt
baseurl=file:///mnt
enabled=1
gpgcheck=0

~

再清空缓存后,建立缓存

[root@ods yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: mnt
Cleaning up list of fastest mirrors
Other repos take up 18 M of disk space (use --verbose for details)
[root@ods yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
mnt                                                                                                                                                                          | 4.3 kB  00:00:00     
(1/4): mnt/group_gz                                                                                                                                                          | 146 kB  00:00:00     
(2/4): mnt/primary_db                                                                                                                                                        | 4.2 MB  00:00:00     
(3/4): mnt/filelists_db                                                                                                                                                      | 3.4 MB  00:00:00     
(4/4): mnt/other_db                                                                                                                                                          | 1.6 MB  00:00:00     
Metadata Cache Created

再次安装成功:

[root@ods ~]# yum install chrony
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package chrony.x86_64 0:3.2-2.el7 will be installed
--> Processing Dependency: libseccomp.so.2()(64bit) for package: chrony-3.2-2.el7.x86_64
--> Running transaction check
---> Package libseccomp.x86_64 0:2.3.1-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================================================================================
Package                                          Arch                                         Version                                              Repository                                 Size
====================================================================================================================================================================================================
Installing:
chrony                                           x86_64                                       3.2-2.el7                                            mnt                                       243 k
Installing for dependencies:
libseccomp                                       x86_64                                       2.3.1-3.el7                                          mnt                                        56 k

Transaction Summary
====================================================================================================================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 299 k
Installed size: 773 k
Is this ok [y/d/N]: y
Downloading packages:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                42 MB/s | 299 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libseccomp-2.3.1-3.el7.x86_64                                                                                                                                                    1/2
  Installing : chrony-3.2-2.el7.x86_64                                                                                                                                                          2/2
  Verifying  : libseccomp-2.3.1-3.el7.x86_64                                                                                                                                                    1/2
  Verifying  : chrony-3.2-2.el7.x86_64                                                                                                                                                          2/2

Installed:
  chrony.x86_64 0:3.2-2.el7                                                                                                                                                                        

Dependency Installed:
  libseccomp.x86_64 0:2.3.1-3.el7                                                                                                                                                                  

Complete!


[root@ods ~]# rpm -qa | grep chrony
chrony-3.2-2.el7.x86_64




分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-5-18 12:51 , Processed in 0.085454 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表