Remember a painful lesson - yum, rpm

Because of the need for system configuration hardware monitoring, when creating an rpm package, the system does not have the rpmbuild tool, so I use yum to install related packages, but during the installation process, it is found that there are version conflicts between some dependent packages, and the installation always fails, so I owe it. "rpm -e --nodeps -force libxml2-2.9.1-5.el7_1.2.i686" forcibly removed the package, so a series of problems started:
System environment: centos7

Opening: yum hangs up! ! !

[root@test ~]# yum 
There was a problem importing one of the Python modules 
required to run yum. The error leading to this problem was: 
 
   libxml2.so.2: cannot open shared object file: No such file or directory 
 
Please install a package which provides this module, or 
verify that the module is installed correctly. 
 
It's possible that the above module doesn't match the 
current version of Python, which is: 
2.4.3 (#1, Nov 11 2010, 13:30:19)  
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] 
 
If you cannot solve this problem yourself, please go to  
the yum faq at: 
  http://wiki.linux.duke.edu/YumFaq 

At this time, it is really called every day should not be, called the earth is not working. Baidu, Google, after some searching, I finally got some eyebrows: http://blog.51cto.com/hellosa/503672 , but this is just the beginning. . .

Medium: I "love" the local yum source

According to the information found above, find the corresponding rpm package to install, I thought the problem could be solved soon, but no, not because of the wrong method, but because of the local yum source! ! ! The recently reinstalled system used the local yum source when initializing the system environment, but found that many packages could not be installed successfully due to version conflicts, and then chose to manually install the hardware monitoring tool: http://book.open -falcon.org/zh/usage/hwcheck.html (making rpm packages), and as mentioned above, various problems follow. The specific questions are:

[root@rd2 rpm]#  rpm -ivh bzip2-libs-1.0.6-13.el7.i686.rpm elfutils-libelf-0.168-8.el7.i686.rpm 
警告:bzip2-libs-1.0.6-13.el7.i686.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
错误:依赖检测失败:
	libattr.so.1 被 libacl-2.2.51-12.el7.i686 需要
	libattr.so.1(ATTR_1.0) 被 libacl-2.2.51-12.el7.i686 需要
	libattr.so.1 被 libcap-2.22-9.el7.i686 需要
... ...(省略部分报错)

There are various dependencies between various rpm packages, as well as the "NOKEY" phenomenon, which is really big, and yum cannot be used. You can only manually download the corresponding rpm package and then use "rpm -ivh *.rpm --force ( --force to resolve nokey issues)" to install. Here I show the rpm package I downloaded (if your system uses the online yum source directly when deploying, it should not be so tragic):

bzip2-libs-1.0.6-13.el7.i686.rpm           nspr-4.13.1-1.0.el7_3.i686.rpm
elfutils-libelf-0.168-8.el7.i686.rpm       nss-3.28.4-8.el7.i686.rpm
file-libs-5.11-33.el7.i686.rpm             nss-pem-1.0.3-4.el7.i686.rpm
glibc-2.17-196.el7_4.2.i686.rpm            nss-softokn-3.28.3-6.el7.i686.rpm
glibc-2.17-196.el7.i686.rpm                nss-softokn-freebl-3.28.3-6.el7.i686.rpm
glibc-common-2.17-196.el7.x86_64.rpm       nss-util-3.28.4-3.el7.i686.rpm
libacl-2.2.51-12.el7.i686.rpm              pcre-8.32-17.el7.i686.rpm
libattr-2.4.46-12.el7.i686.rpm             popt-1.13-16.el7.i686.rpm
libcap-2.22-9.el7.i686.rpm                 readline-6.2-10.el7.i686.rpm
libdb-5.3.21-20.el7.i686.rpm               rpm-build-libs-4.11.3-25.el7.i686.rpm
libgcc-4.8.5-16.el7.i686.rpm               rpm-libs-4.11.3-25.el7.i686.rpm
libselinux-2.5-11.el7.i686.rpm             sqlite-3.7.17-8.el7.i686.rpm
libsepol-2.5-6.el7.i686.rpm                xz-libs-5.2.2-1.el7.i686.rpm
libstdc++-4.8.5-16.el7.i686.rpm            yum-3.4.3-154.el7.centos.noarch.rpm
libxml2-2.9.1-6.el7_2.3.i686.rpm           yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
libxml2-2.9.1-6.el7_2.3.x86_64.rpm         yum-plugin-fastestmirror-1.1.31-42.el7.noarch.rpm
lua-5.1.4-15.el7.i686.rpm                  zlib-1.2.7-17.el7.i686.rpm
ncurses-libs-5.9-13.20130511.el7.i686.rpm

The ending: perfect!

After the above package is downloaded, execute the rpm -ivh command and finally no longer prompt the dependency problem, but there are still some version conflicts, so:

[root@rd2 rpm]# rpm -ivh bzip2-libs-1.0.6-13.el7.i686.rpm elfutils-libelf-0.168-8.el7.i686.rpm file-libs-5.11-33.el7.i686.rpm glibc-2.17-196.el7_4.2.i686.rpm glibc-2.17-196.el7.i686.rpm glibc-common-2.17-196.el7.x86_64.rpm libacl-2.2.51-12.el7.i686.rpm libattr-2.4.46-12.el7.i686.rpm libcap-2.22-9.el7.i686.rpm libdb-5.3.21-20.el7.i686.rpm libgcc-4.8.5-16.el7.i686.rpm libselinux-2.5-11.el7.i686.rpm libsepol-2.5-6.el7.i686.rpm libstdc++-4.8.5-16.el7.i686.rpm libxml2-2.9.1-6.el7_2.3.i686.rpm libxml2-2.9.1-6.el7_2.3.x86_64.rpm lua-5.1.4-15.el7.i686.rpm ncurses-libs-5.9-13.20130511.el7.i686.rpm nspr-4.13.1-1.0.el7_3.i686.rpm nss-3.28.4-8.el7.i686.rpm nss-pem-1.0.3-4.el7.i686.rpm nss-softokn-3.28.3-6.el7.i686.rpm nss-softokn-freebl-3.28.3-6.el7.i686.rpm nss-util-3.28.4-3.el7.i686.rpm pcre-8.32-17.el7.i686.rpm popt-1.13-16.el7.i686.rpm readline-6.2-10.el7.i686.rpm rpm-build-libs-4.11.3-25.el7.i686.rpm rpm-libs-4.11.3-25.el7.i686.rpm sqlite-3.7.17-8.el7.i686.rpm xz-libs-5.2.2-1.el7.i686.rpm yum-3.4.3-154.el7.centos.noarch.rpm yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-plugin-fastestmirror-1.1.31-42.el7.noarch.rpm zlib-1.2.7-17.el7.i686.rpm --force

After executing the above command, try yum quickly, the result:

[root@rd2 rpm]# yum
已加载插件:fastestmirror, priorities, versionlock
您需要给出命令
Usage: yum [options] COMMAND

List of Commands:

check          检查 RPM 数据库问题
check-update   检查是否有可用的软件包更新
clean          删除缓存数据
deplist        列出软件包的依赖关系
... ...

Repair done!
It's too tiring to download rpm packages one by one, here is a private download link for more than one rpm: https://pan.baidu.com/s/1vF8nnwlUc0PCBeXYxuRHVw Password: pnjs

lesson:

Do not arbitrarily forcibly delete the system basic library files! ! !

Physical server temperature monitoring

Reference documents:
Git source code: https://github.com/51web/hwcheck
open-falcon: http://book.open-falcon.org/zh/usage/hwcheck.html
sensor: http://www.antrol. com/archives/202
Supplement:
After creating the rpm package according to chapter 3.1 of the above reference materials, you need to use "rpm -ivh" to install it before you can use the "hwcheck" command!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325140356&siteId=291194637