通过yum离线安装keepalived
文件准备
通过指令下载keepalived及依赖包
yum install -y keepalived --downloadonly --downloaddir /local/keepalived
查看运行结果
[root@localhost ~]# yum install -y keepalived --downloadonly --downloaddir /local/keepalived
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.bfsu.edu.cn
* epel: ftp.riken.jp
* extras: mirrors.bfsu.edu.cn
* updates: mirrors.bfsu.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package keepalived.x86_64 0:1.3.5-19.el7 will be installed
--> Processing Dependency: libnetsnmpmibs.so.31()(64bit) for package: keepalived-1.3.5-19.el7.x86_64
--> Processing Dependency: libnetsnmpagent.so.31()(64bit) for package: keepalived-1.3.5-19.el7.x86_64
--> Processing Dependency: libnetsnmp.so.31()(64bit) for package: keepalived-1.3.5-19.el7.x86_64
--> Running transaction check
---> Package net-snmp-agent-libs.x86_64 1:5.7.2-49.el7_9.2 will be installed
--> Processing Dependency: libsensors.so.4()(64bit) for package: 1:net-snmp-agent-libs-5.7.2-49.el7_9.2.x86_64
---> Package net-snmp-libs.x86_64 1:5.7.2-49.el7_9.2 will be installed
--> Running transaction check
---> Package lm_sensors-libs.x86_64 0:3.4.0-8.20160601gitf9185e5.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================
Installing:
keepalived x86_64 1.3.5-19.el7 base 332 k
Installing for dependencies:
lm_sensors-libs x86_64 3.4.0-8.20160601gitf9185e5.el7 base 42 k
net-snmp-agent-libs x86_64 1:5.7.2-49.el7_9.2 updates 707 k
net-snmp-libs x86_64 1:5.7.2-49.el7_9.2 updates 752 k
Transaction Summary
=====================================================================================================================================================================================================
Install 1 Package (+3 Dependent packages)
Total download size: 1.8 M
Installed size: 6.0 M
Background downloading packages, then exiting:
(1/4): lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el7.x86_64.rpm | 42 kB 00:00:00
(2/4): keepalived-1.3.5-19.el7.x86_64.rpm | 332 kB 00:00:00
(3/4): net-snmp-libs-5.7.2-49.el7_9.2.x86_64.rpm | 752 kB 00:00:00
(4/4): net-snmp-agent-libs-5.7.2-49.el7_9.2.x86_64.rpm | 707 kB 00:00:03
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 468 kB/s | 1.8 MB 00:00:03
exiting because "Download Only" specified
下载的文件有4个
lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el7.x86_64.rpm
keepalived-1.3.5-19.el7.x86_64.rpm
net-snmp-libs-5.7.2-49.el7_9.2.x86_64.rpm
net-snmp-agent-libs-5.7.2-49.el7_9.2.x86_64.rpm
将这四个文件放入离线库中,并更新本地源或私有源
createrepo --update /yum/local
测试安装
yum install keepalived
欢喜的期待成功,可是太顺利了怎么写博客呢😁
[root@localhost ~]# yum install keepalived
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* local:
local | 2.9 kB 00:00:00
正在解决依赖关系
--> 正在检查事务
---> 软件包 keepalived.x86_64.0.1.3.5-19.el7 将被 安装
--> 正在处理依赖关系 libnetsnmpmibs.so.31()(64bit),它被软件包 keepalived-1.3.5-19.el7.x86_64 需要
--> 正在处理依赖关系 libnetsnmpagent.so.31()(64bit),它被软件包 keepalived-1.3.5-19.el7.x86_64 需要
--> 正在处理依赖关系 libnetsnmp.so.31()(64bit),它被软件包 keepalived-1.3.5-19.el7.x86_64 需要
--> 正在检查事务
---> 软件包 net-snmp-agent-libs.x86_64.1.5.7.2-49.el7_9.2 将被 安装
--> 正在处理依赖关系 libmysqlclient.so.18(libmysqlclient_18)(64bit),它被软件包 1:net-snmp-agent-libs-5.7.2-49.el7_9.2.x86_64 需要
--> 正在处理依赖关系 libsensors.so.4()(64bit),它被软件包 1:net-snmp-agent-libs-5.7.2-49.el7_9.2.x86_64 需要
--> 正在处理依赖关系 libmysqlclient.so.18()(64bit),它被软件包 1:net-snmp-agent-libs-5.7.2-49.el7_9.2.x86_64 需要
---> 软件包 net-snmp-libs.x86_64.1.5.7.2-49.el7_9.2 将被 安装
--> 正在检查事务
---> 软件包 lm_sensors-libs.x86_64.0.3.4.0-8.20160601gitf9185e5.el7 将被 安装
---> 软件包 net-snmp-agent-libs.x86_64.1.5.7.2-49.el7_9.2 将被 安装
--> 正在处理依赖关系 libmysqlclient.so.18(libmysqlclient_18)(64bit),它被软件包 1:net-snmp-agent-libs-5.7.2-49.el7_9.2.x86_64 需要
--> 正在处理依赖关系 libmysqlclient.so.18()(64bit),它被软件包 1:net-snmp-agent-libs-5.7.2-49.el7_9.2.x86_64 需要
--> 解决依赖关系完成
错误:软件包:1:net-snmp-agent-libs-5.7.2-49.el7_9.2.x86_64 (local)
需要:libmysqlclient.so.18(libmysqlclient_18)(64bit)
错误:软件包:1:net-snmp-agent-libs-5.7.2-49.el7_9.2.x86_64 (local)
需要:libmysqlclient.so.18()(64bit)
您可以尝试添加 --skip-broken 选项来解决该问题
您可以尝试执行:rpm -Va --nofiles --nodigest
缺少libmysqlclient.so.18,这玩艺不能自动下载?OH,原来是没配MYSQL的源,下载的时候没下载下来
到官网(https://dev.mysql.com/downloads/mysql/)下载mysql-community-libs-compat-8.0.30-1.el7.x86_64.rpm
具体下载哪个版本建议和你的mysql版本一致,聪明的程序员都知道,右边这个链接后面的版本是可以改的,https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-libs-compat-8.0.28-1.el7.x86_64.rpm
下载完成后,将其放入离线库中,并更新本地源或私有源
createrepo --update /yum/local
#需要执行一下更新操作,否则无法找到刚刚更新的包
yum makecache
测试安装
yum install keepalived
这回是真成功了