CentOS/RHEL:yum命令重新安装软件包
时间:2020-01-09 10:34:14 来源:igfitidea点击:
我不小心删除了存储在/etc /目录中的配置文件,并且昨天进行了最新备份。
如何在RHEL/CentOS Linux服务器下使用yum命令重新安装软件包?
您可以使用带有重新安装选项的yum命令。
这将重新安装与当前安装的版本相同的软件包。
语法如下:
yum reinstall packageName yum reinstall packageName1 packageName2
在此示例中,重新安装名为keepalived的软件包,键入:
# yum reinstall keepalived
输出示例:
Loaded plugins: product-id, rhnplugin, subscription-manager Updating certificate-based repositories. Setting up Reinstall Process Resolving Dependencies --> Running transaction check ---> Package keepalived.x86_64 0:1.2.2-2.el6 will be reinstalled --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================================= Package Arch Version Repository Size ================================================================================================================================================= Reinstalling: keepalived x86_64 1.2.2-2.el6 epel 147 k Transaction Summary ================================================================================================================================================= Reinstall 1 Package(s) Total download size: 147 k Installed size: 380 k Is this ok [y/N]: y Downloading Packages: keepalived-1.2.2-2.el6.x86_64.rpm | 147 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : keepalived-1.2.2-2.el6.x86_64 1/1 Installed products updated. Installed: keepalived.x86_64 0:1.2.2-2.el6
注意:这不适用于仅安装软件包,例如RHEL内核软件包。