使用命令 systemctl start iptables 开启防火墙, 出现以下错误.
Failed to start iptables.service: Unit iptables.service failed to load: No such file or directory.
搜了下错误提示貌似因为没有安装 iptables-services.
使用 yum install iptables-services 报错 xxxxx [Errno 256] No more mirrors to try.
查到了一个解决办法于是尝试一下, 执行以下命令
1: yum clean all 完成
2: yum makecache 出现以下错误:
[Errno 14] curl#37 - "Couldn't open file /mnt/repodata/repomd.xml
因为这个错误, 查了将近两个小时各种方法无解, 最后仔细看错误信息发现. 请求的路径是 /mnt/repodata/repomd.xml. 而我的redhat系统盘挂载的路径是 /mnt/cdrom/repodata/
有可能是之前修改了fstab.
报错时候的fstab文件信息.
使用命令 vim /etc/fstab 修改fstab文件 inster 键插入模式, 修改完成后 按ESC后, 输入 :wq 保存
修改后的fstab文件:
修改fstab文件后, 执行 umount -a 解除挂载 , 执行 mount -a 重新挂载.
重新执行 yum makecache 成功了.
因为这个问题 折腾了我两个小时, 无奈的都想重装redhat了. 这么容易解决的路径问题, 居然搜来搜去搜了两个小时. 以后遇到报错一定要认真看错误信息.