Ubuntu关闭图形界面

原创转载请注明出处:http://agilestyle.iteye.com/blog/2280880

 

针对16.04之前的版本

1. 修改 GRUB 配置文件

sudo vim /etc/default/grub

Ubuntu关闭图形界面
 

2. 保存后,更新grub

sudo update-grub

Ubuntu关闭图形界面
 

3.重启reboot

sudo reboot

Ubuntu关闭图形界面
 

4. 重启后,就进入了文字界面(之前更改过hostname,所以hostname不再是ubuntu)

Ubuntu关闭图形界面
 

针对Ubuntu16.04 关闭图形界面

查看Ubuntu版本

lsb_release -a

Ubuntu关闭图形界面
 

关掉图形界面启动

systemctl disable lightdm.service

Ubuntu关闭图形界面
 

重启

sudo reboot

Ubuntu关闭图形界面
 

重新回到图形界面,使用如下命令

sudo systemctl start lightdm.service