mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
translated
This commit is contained in:
parent
3469c614d6
commit
f8f56a5a5b
@ -1,66 +0,0 @@
|
||||
Translating----geekpi
|
||||
|
||||
Linux FAQs with Answers--How to boot into command line on Ubuntu or Debian
|
||||
================================================================================
|
||||
> **Question**: I am running Ubuntu desktop, but I want to boot straight into text-mode console temporarily. What is a convenient way to disable desktop GUI and boot into a terminal?
|
||||
|
||||
Linux desktop comes with a display manager (e.g., GDM, KDM, LightDM), which lets the desktop machine automatically boot into a GUI-based login environment. However, what if you want to disable GUI and boot straight into a text-mode console? For example, you are troubleshooting desktop related issues, or want to run a heavy-duty application that does not require desktop GUI.
|
||||
|
||||
Note that you can temporarily switch from desktop GUI to a virtual console by pressing Ctrl+Alt+F1 to F6. However, in this case your desktop GUI will be still running in the background, and thus is different from pure text-mode booting.
|
||||
|
||||
On Ubuntu or Debian desktop, you can enable text-mode booting by passing appropriate kernel parameters.
|
||||
|
||||
### Boot into Command-line Temporarily ###
|
||||
|
||||
If you want to disable desktop GUI and boot in text-mode just one-time, you can use GRUB menu interface.
|
||||
|
||||
First, power on your desktop. When you see the initial GRUB menu, press 'e'.
|
||||
|
||||
![](https://farm8.staticflickr.com/7490/16112246542_bc1875a397_z.jpg)
|
||||
|
||||
This will lead you to the next screen, where you can modify kernel booting parameters. Scroll down the screen to look for a line that begins with "linux", which indicates a list of kernel parameters. Remove from the list "quiet" and "splash". Add "text" in the list instead.
|
||||
|
||||
![](https://farm8.staticflickr.com/7471/15493282603_8a70f70af2_z.jpg)
|
||||
|
||||
The updated kernel parameter list looks like the following. Press Ctrl+x to continue booting. This will enable one-time console booting in verbose mode.
|
||||
|
||||
![](https://farm8.staticflickr.com/7570/15925676530_b11af59243_z.jpg)
|
||||
|
||||
Boot into Command-line Permanently
|
||||
|
||||
If you want to boot into command-line permanently, you need to [update GRUB configuration][1] which defines kernel booting parameters.
|
||||
|
||||
Open a default GRUB config file with a text editor.
|
||||
|
||||
$ sudo vi /etc/default/grub
|
||||
|
||||
Look for a line that starts with GRUB_CMDLINE_LINUX_DEFAULT, and comment out that line by prepending # sign. This will disable the initial splash screen, and enable verbose mode (i.e., showing the detailed booting procedure).
|
||||
|
||||
Then change GRUB_CMDLINE_LINUX="" to:
|
||||
|
||||
GRUB_CMDLINE_LINUX="text"
|
||||
|
||||
Next, uncomment the line that says "#GRUB_TERMINAL=console".
|
||||
|
||||
The updated GRUB defult configuration looks like the following.
|
||||
|
||||
![](https://farm9.staticflickr.com/8673/16107564442_9345d94491_b.jpg)
|
||||
|
||||
Finally, invoke update-grub command to re-generate a GRUB2 config file under /boot, based on these changes.
|
||||
|
||||
$ sudo update-grub
|
||||
|
||||
At this point, your desktop should be switched from GUI booting to console booting. Verify this by rebooting.
|
||||
|
||||
![](https://farm8.staticflickr.com/7518/16106378151_81ac6b5a49_b.jpg)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/boot-into-command-line-ubuntu-debian.html
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://xmodulo.com/add-kernel-boot-parameters-via-grub-linux.html
|
@ -0,0 +1,64 @@
|
||||
Linux 有问必答:如何在Ubuntu或者Debian中启动进入命令行
|
||||
================================================================================
|
||||
> **提问**:我运行的是Ubuntu桌面,但是我希望启动后临时进入命令行。有什么简便的方法可以启动进入终端?
|
||||
|
||||
Linux桌面自带了一个显示管理器(比如:GDM、KDM、LightDM),它们可以让计算机启动自动进入一个基于GUI的登录环境。然而,如果你要直接启动进入终端怎么办? 比如,你在排查桌面相关的问题或者想要运行一个不需要GUI的发行程序。
|
||||
|
||||
注意你可以通过按下Ctrl+Alt+F1到F6临时从桌面GUI切换到虚拟终端。然而,在本例中你的桌面GUI仍在后台运行,这不同于纯文本模式启动。
|
||||
|
||||
在Ubuntu或者Debian桌面中,你可以通过传递合适的内核参数在启动时启动文本模式。
|
||||
|
||||
### 启动临时进入命令行 ###
|
||||
|
||||
如果你想要禁止桌面GUI并只有一次进入文本模式,你可以使用GRUB菜单。
|
||||
|
||||
首先,打开你的电脑。当你看到初始的GRUB菜单时,按下‘e’。
|
||||
|
||||
![](https://farm8.staticflickr.com/7490/16112246542_bc1875a397_z.jpg)
|
||||
|
||||
接着会进入下一屏,这里你可以修改内核启动选项。向下滚动到以“linux”开始的行,这里就是内核参数的列表。删除列表中的“quiet”和“splash”。在列表中添加“text”。
|
||||
|
||||
![](https://farm8.staticflickr.com/7471/15493282603_8a70f70af2_z.jpg)
|
||||
|
||||
升级的内核选项列表看上去像这样。按下Ctrl+x继续启动。这会一次性以详细模式启动控制台。
|
||||
|
||||
![](https://farm8.staticflickr.com/7570/15925676530_b11af59243_z.jpg)
|
||||
|
||||
永久启动进入命令行。
|
||||
|
||||
如果你想要永久启动进入命令行,你需要[更新定义了内核启动参数GRUB设置][1]。
|
||||
|
||||
在文本编辑器中打开默认的GRUB配置文件。
|
||||
|
||||
$ sudo vi /etc/default/grub
|
||||
|
||||
查找以GRUB_CMDLINE_LINUX_DEFAULT开头的行,并用“#”注释这行。这会禁止初始屏幕,而启动详细模式(也就是说显示详细的的启动过程)。
|
||||
|
||||
更改GRUB_CMDLINE_LINUX="" 成:
|
||||
|
||||
GRUB_CMDLINE_LINUX="text"
|
||||
|
||||
接下来取消“#GRUB_TERMINAL=console”的注释。
|
||||
|
||||
更新后的GRUB配置看上去像下面这样。
|
||||
|
||||
![](https://farm9.staticflickr.com/8673/16107564442_9345d94491_b.jpg)
|
||||
|
||||
最后,使用update-grub命令来基于这些更改重新生成/boot下的GRUB2配置文件。
|
||||
|
||||
$ sudo update-grub
|
||||
|
||||
这时,你的桌面应该从GUI启动切换到控制台启动了。可以通过重启验证。
|
||||
|
||||
![](https://farm8.staticflickr.com/7518/16106378151_81ac6b5a49_b.jpg)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/boot-into-command-line-ubuntu-debian.html
|
||||
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://xmodulo.com/add-kernel-boot-parameters-via-grub-linux.html
|
Loading…
Reference in New Issue
Block a user