CentOS 7 中执行:yum remove iptables 后,一般不会在意输出信息,不好意思,你错过了重点,输出信息中包含了如下一段内容:
这里提示我们不仅卸载了 iptables 服务,同时还卸载了15个软件包,这包含了网卡驱动、kexec内核组件软件包、iproute网络管理工具包、系统初始化软件包initscripts 等,我们会发现 ip、service等命令丢失了,重启服务器后网卡也没有了
Dependencies Resolved
===========================================================================================
Package Arch Version Repository Size
===========================================================================================
Removing:
iptables x86_64 1.4.21-18.0.1.el7.centos @anaconda 1.5 M
Removing for dependencies:
abrt-addon-vmcore x86_64 2.1.11-48.el7.centos @anaconda 41 k
abrt-cli x86_64 2.1.11-48.el7.centos @anaconda 0.0
abrt-console-notification x86_64 2.1.11-48.el7.centos @anaconda 1.3 k
dhclient x86_64 12:4.2.5-58.el7.centos @anaconda 472 k
dracut-network x86_64 033-502.el7 @anaconda 144 k
firewalld noarch 0.4.4.4-6.el7 @anaconda 1.8 M
initscripts x86_64 9.49.39-1.el7 @anaconda 1.4 M
iproute x86_64 3.10.0-87.el7 @anaconda 1.4 M
kbd x86_64 1.15.5-13.el7 @anaconda 1.3 M
kexec-tools x86_64 2.0.14-17.el7 @anaconda 739 k
libstoragemgmt x86_64 1.4.0-3.el7 @anaconda 639 k
libstoragemgmt-python noarch 1.4.0-3.el7 @anaconda 798 k
libstoragemgmt-python-clibs x86_64 1.4.0-3.el7 @anaconda 24 k
plymouth x86_64 0.8.9-0.28.20140113.el7.centos @anaconda 227 k
plymouth-scripts x86_64 0.8.9-0.28.20140113.el7.centos @anaconda 22 k
Transaction Summary
===========================================================================================
Remove 1 Package (+15 Dependent packages)
系统恢复正常方法:
1. VNC方式登陆服务器,先手动配置服务器网络:
root@BJ-CentOS7 ~ # ifconfig eth0 内网ip netmask 子网掩码
root@BJ-CentOS7 ~ # route add default gw 网关地址
2. 服务器网络配置好之后,使用 yum install 方式将被卸载的安装包再安装回来,当然这时如果不需要 iptables 服务可以不用再安装iptables
root@BJ-CentOS7 ~ # yum -y install iptables abrt-addon-vmcore abrt-cli abrt-console-notification dhclient dracut-network firewalld initscripts iproute kbd kexec-tools libstoragemgmt libstoragemgmt-python libstoragemgmt-python-clibs plymouth plymouth-scripts
注意:
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有