Linux教程

Oracle Linux7.8配置本地yum源:报错Loaded plugins: ulninfo

本文主要是介绍Oracle Linux7.8配置本地yum源:报错Loaded plugins: ulninfo,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

Linux配置本地yum源

1、将oracle-linux-ol7.repo配置文件备份

cp /etc/yum.repos.d/oracle-linux-ol7.repo /etc/yum.repos.d/oracle-linux-ol7.repo.bak

#删除原文件:
rm -rf /etc/yum.repos.d/oracle-linux-ol7.repo

2、编辑配置文件仅添加以下内容:

vi /etc/yum.repos.d/oracle-linux-ol7.repo

[ol7_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=file:///mnt/cdrom
gpgcheck=0						#0表示关闭gpgkey检查,1是开启
enabled=1						#0表示关闭本地yum源,1是开启

3、创建挂载点:

mkdir /mnt/cdrom

4、挂载光盘镜像:

#服务器或虚拟机已经连接光盘镜像
mount /dev/sr0 /mnt/cdrom

#如果服务器或虚拟机没有连接光盘镜像,将镜像上传到机器,手动指定本地路径挂载镜像
#/u01/software/OracleLinux-R7-U8-Server-x86_64-dvd.iso为我的镜像所在目录
mount -o loop -t iso9660 /u01/software/OracleLinux-R7-U8-Server-x86_64-dvd.iso /mnt/cdrom

5、清除YUM缓存

# yum clean all
Loaded plugins: ulninfo
Cleaning repos: ol7_latest
# 

6、列出所有可安装的安装包
报错:

# yum list
Loaded plugins: ulninfo
https://yum.oracle.com/repo/OracleLinux/OL7/UEKR5/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: yum.oracle.com; Unknown error"
Trying other mirror.


 One of the configured repositories failed (Latest Unbreakable Enterprise Kernel Release 5 for Oracle Linux 7Server (x86_64)),
 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. Run the command with the repository temporarily disabled
            yum --disablerepo=ol7_UEKR5 ...

     4. Disable the repository permanently, 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 ol7_UEKR5
        or
            subscription-manager repos --disable=ol7_UEKR5

     5. 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=ol7_UEKR5.skip_if_unavailable=true

failure: repodata/repomd.xml from ol7_UEKR5: [Errno 256] No more mirrors to try.
https://yum.oracle.com/repo/OracleLinux/OL7/UEKR5/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: yum.oracle.com; Unknown error"
# 

报错说是因为ol7_UEKR没有配置的问题

#查看/etc/yum.repos.d目录下
# ll /etc/yum.repos.d
total 16
-rw-r--r--  1 root root  110 Apr 27 10:26 oracle-linux-ol7.repo
-rw-r--r--. 1 root root 3835 Apr 27 09:37 oracle-linux-ol7.repo.bak
-rw-r--r--. 1 root root 2587 Apr  2  2020 uek-ol7.repo				#uek.repo文件
-rw-r--r--. 1 root root  226 Apr  2  2020 virt-ol7.repo

该Oracle Linux版本在/etc/yum.repos.d目录下有一个uek-ol7.repo文件,这个文件并没有配置,也用不到,就改名做了一个备份

mv uek-ol7.repo uek-ol7.repo.bak

再次执行yum list

# yum list
...
zlib.i686                                                                                                1.2.7-18.el7                                                                               ol7_latest   
zlib-devel.i686                                                                                          1.2.7-18.el7                                                                               ol7_latest   
zlib-devel.x86_64                                                                                        1.2.7-18.el7                                                                               ol7_latest   
zsh.x86_64                                                                                               5.0.2-34.el7                                                                               ol7_latest   
zziplib.i686                                                                                             0.13.62-12.el7                                                                             ol7_latest   
zziplib.x86_64                                                                                           0.13.62-12.el7                                                                             ol7_latest   
#

将需要的安装包使用yum install -y 包名安装即可,卸载使用yum remove -y 包名
有什么问题欢迎留言,谢谢。

这篇关于Oracle Linux7.8配置本地yum源:报错Loaded plugins: ulninfo的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!