一个yum源安装问题引发的工作态度的思考

记录下安装pg过程中遇到的一个小问题:

[root@db-server1 yum.repos.d]# yum install readline-devel   
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package readline-devel.x86_64 0:6.2-10.el7 will be installed
--> Processing Dependency: readline = 6.2-10.el7 for package: readline-devel-6.2-10.el7.x86_64
--> Processing Dependency: ncurses-devel for package: readline-devel-6.2-10.el7.x86_64
--> Running transaction check
---> Package ncurses-devel.x86_64 0:5.9-14.20130511.el7_4 will be installed
---> Package readline-devel.x86_64 0:6.2-10.el7 will be installed
--> Processing Dependency: readline = 6.2-10.el7 for package: readline-devel-6.2-10.el7.x86_64
--> Finished Dependency Resolution
Error: Package: readline-devel-6.2-10.el7.x86_64 (base)
           Requires: readline = 6.2-10.el7
           Installed: readline-6.2-11.el7.x86_64 (@base)
               readline = 6.2-11.el7
           Available: readline-6.2-10.el7.x86_64 (base)
               readline = 6.2-10.el7
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
[root@db-server2 yum.repos.d]# yum install ncurses-devel.x86_64
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package ncurses-devel.x86_64 0:5.9-14.20130511.el7_4 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================================================================
 Package                                 Arch                             Version                                            Repository                      Size
==================================================================================================================================================================
Installing:
 ncurses-devel                           x86_64                           5.9-14.20130511.el7_4                              base                           712 k

Transaction Summary
==================================================================================================================================================================
Install  1 Package

Total download size: 712 k
Installed size: 2.1 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : ncurses-devel-5.9-14.20130511.el7_4.x86_64                                                                                                     1/1 
  Verifying  : ncurses-devel-5.9-14.20130511.el7_4.x86_64                                                                                                     1/1 

Installed:
  ncurses-devel.x86_64 0:5.9-14.20130511.el7_4                                                                                                                    

Complete!

  手工安装好ncurses-devel后还是报错,如下:

[root@db-server1 ~]# yum install readline-devel.x86_64
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
base                                                                                                                                       | 3.6 kB  00:00:00     
Resolving Dependencies
--> Running transaction check
---> Package readline-devel.x86_64 0:6.2-10.el7 will be installed
--> Processing Dependency: readline = 6.2-10.el7 for package: readline-devel-6.2-10.el7.x86_64
--> Finished Dependency Resolution
Error: Package: readline-devel-6.2-10.el7.x86_64 (base)
           Requires: readline = 6.2-10.el7
           Installed: readline-6.2-11.el7.x86_64 (@base)
               readline = 6.2-11.el7
           Available: readline-6.2-10.el7.x86_64 (base)
               readline = 6.2-10.el7
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

  遇到报错,本能进行度娘,网上基本都在讲是yum配置问题,一度怀疑自己配置的本地yum真的存在问题。按照网上的各种尝试无果,便重新看报错的字面意思:

提示要安装readline-devel.x86_64需要先安装readline-6.2,目前可以从配置的yum中可以获得的版本是readline-6.2-10.el7.x86_64 (base)  readline-devel-6.2-10.el7.x86_64 (base)。

已经安装的版本为readline-6.2-11.el7.x86_64,再安装readline-devel-6.2-10.el7.x86_64这个版本无法安装上。

[root@db-server1 yum.repos.d]# rpm -aq  readline*            
readline-6.2-11.el7.x86_64

  知道了原因,问题就好解决了,第一种思路是对已经安装的readline-6.2-11.el7.x86_64进行降级到6.2.10版本,第二种思路是安装readline-devel的6.2.11版本。比较奇怪的一点是操作系统是centos7.6版本的,自己配置的本地yum源也是用的7.6版本的,至于为什么存在版本问题就不去深究了,从官网上下载对应的rpm包后成功解决。

https://centos.pkgs.org/7/centos-x86_64/readline-devel-6.2-11.el7.x86_64.rpm.html

[root@db-server1 postgres]# rpm -ivh readline-devel-6.2-11.el7.x86_64.rpm 
Preparing...                          ################################# [100%]
Updating / installing...
   1:readline-devel-6.2-11.el7        ################################# [100%]

  总结:其实解决方法没有啥难度,关键是处理问题的方向,不能遇到问题拿到手就去网上搜,有时候仔细看下报错,自主思考一下,就很容易解决了。

 

posted @ 2021-06-08 10:37  鹏哥飘飘  阅读(708)  评论(0编辑  收藏  举报