阻止X.Org在Ubuntu中启动

If you’ve got an Ubuntu machine that you initially installed with Ubuntu Desktop, but would like to run as a server, you can just disable the graphical environment from starting up in order to save resources. This is also useful for doing system maintenance from the command line that needs to be performed outside of the GUI.

如果您有一台最初与Ubuntu桌面一起安装的Ubuntu计算机,但想作为服务器运行,则可以仅禁用图形环境以节省资源。 这对于需要在GUI外部执行的命令行进行系统维护也很有用。

The only reason to do this instead of removing the packages would be because you might want to still sometimes use the box through the GUI.

这样做而不是删除软件包的唯一原因是因为您可能有时仍希望通过GUI使用该框。

Disable X.Org

禁用X.Org

In order to disable the graphical environment, we’ll need to disable GDM, the Gnome Display Manager. In order to do this, you’ll need to run the following command at the terminal:

为了禁用图形环境,我们需要禁用GDM(Gnome显示管理器)。 为此,您需要在终端上运行以下命令:

sudo update-rc.d -f gdm remove

sudo update-rc.d -f gdm删除

image

When you restart your computer, you’ll be presented with a text-mode login prompt instead of the graphical environment.

重新启动计算机时,将显示文本模式登录提示,而不是图形环境。

image

Run X.Org While Disabled

禁用时运行X.Org

If you want to run the graphical environment, all you have to do is type the following command from the prompt, making sure to run it as your normal user account.

如果要运行图形环境,只需在提示符下键入以下命令,并确保以普通用户帐户运行它。

startx

初学者

The annoying gray screen will go away once Gnome is fully started.

一旦Gnome完全启动,烦人的灰色屏幕就会消失。

Enable X.Org

启用X.Org

If you want to re-enable X11 it’s a simple matter of running this command from the terminal:

如果要重新启用X11,只需在终端上运行以下命令即可:

sudo update-rc.d -f gdm defaults

sudo update-rc.d -f gdm默认

image

When you restart, you’ll be presented with the graphical prompt again.

重新启动时,将再次显示图形化提示。

翻译自: https://www.howtogeek.com/howto/ubuntu/prevent-xorg-from-starting-in-ubuntu/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值