完美解决readlinereadline.h No such file.以及Entering emergency mode. Exit the shell to continue. type...

it2026-01-12  8

环境: win10 + CentOS_7.7、ubuntu18

报错种类:

fatal error : readline/readline.h : No such file or directory…Entering emergency mode, exit the shell to continue. Type “journalctl” to view systems logs…

一、解决报错问题: “fatal error : readline/readline.h : No such file or directory…”

前言: 鄙人是在编译某个开源C/C++工程的时候遇到此问题的,并且先后在XShell和CentOS上踩雷,很是令我欣慰。

解决方案:

1、ubuntu环境下:

sudo apt-get install libreadline-dev // 回车后,输入root密码即可

2、CentOS环境下:

sudo yum -y install readline-devel // 回车后,输入root密码即可

因为CentOS没有apt-get命令,感谢 来自地狱的cat猫

二、解决报错问题:“Entering emergency mode, exit the shell to continue. Type “journalctl” to view systems logs…”

前言: 报错信息长这样 ↓ ,这个问题起因有好几种,很多情况都因强制虚拟机断开/关机所引起。

解决方案:

遇到此问题莫慌,在 “#” 号后面键入相应命令即可解决此问题。

xfs_repair -v -L /dev/dm-0 // 注意最后面是数字“0”

回车,等系统自修复好后,继续键入重启命令以重启虚拟机即可:

reboot

问题二之所以能解决,还是感谢 只会CV 的无私奉献。

最新回复(0)