强制启动到 Linux 命令行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8439221/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 03:34:18  来源:igfitidea点击:

Force boot into Linux command line

linuxshellubuntucommand-line

提问by Kevin

I am trying a number of settings on my Ubuntu 11.10 box. Unfortunately, I messed up some settings and the X window does not boot up.

我正在我的 Ubuntu 11.10 机器上尝试一些设置。不幸的是,我搞砸了一些设置,X 窗口无法启动。

I need to boot into command line to restore some settings.

我需要启动到命令行来恢复一些设置。

However, everytime I boot, the system hangs at the Ubuntu welcome screen. All I can do is to reboot the machine.

但是,每次启动时,系统都会在 Ubuntu 欢迎屏幕上挂起。我所能做的就是重新启动机器。

Is there anyway I can boot into the command line directly?

无论如何我可以直接启动到命令行吗?

Many thanks

非常感谢

回答by Basile Starynkevitch

Normally the grubboot loader offers you to boot in recovery mode

通常,grub引导加载程序会提供您以恢复模式引导

回答by amrfaissal

To switch back and forth from X to CLI is by using the virtual terminals. You can boot into X and then hit Ctrl+Alt+<Fn>where Fn is a function key from F2to F6. To return to X is with Ctrl+Alt+F7

从 X 到 CLI 来回切换是使用虚拟终端。您可以启动到 X,然后点击Ctrl+Alt+<Fn>Fn 是从F2到的功能键F6。回到 X 是与Ctrl+Alt+F7

回答by paulsm4

Even if the GUI console is messed up, you can probably to get to text mode) virtual console 1. Similarly, bring you to text-mode virtual consoles 2, 3, 4, ... You can log on to any of them - or any combination of them:

即使 GUI 控制台一团糟,您也可以进入文本模式)虚拟控制台 1。同样,将您带到文本模式虚拟控制台 2、3、4,...您可以登录其中任何一个 -或它们的任意组合:

http://en.wikipedia.org/wiki/Virtual_console

http://en.wikipedia.org/wiki/Virtual_console

PS: To boot into text-only mode (instead of the GUI), you can do this (provided, of course, you can log on!):

PS:要启动到纯文本模式(而不是 GUI),您可以这样做(当然,前提是您可以登录!):

http://ubuntuforums.org/showthread.php?t=1480813

in /etc/init/rc-sysinit.conf:
env DEFAULT_RUNLEVEL=3

in /etc/init/gdm.conf:
start on (filesystem
and started hal
and tty-device-added KERNEL=tty7
and (graphics-device-added or stopped udevtrigger)
and runlevel [!3])
stop on runlevel [016]
tech78i is offline 

PPS: On most other Linux variants, you'd set "default runlevel 3" by editing /etc/inittab.

PPS:在大多数其他 Linux 变体上,您可以通过编辑 /etc/inittab 来设置“默认运行级别 3”。