Please indicate the source of the original reprint: http://agilestyle.iteye.com/blog/2280880
For versions prior to 16.04
1. Modify the GRUB configuration file
sudo vim /etc/default/grub
2. After saving, update grub
sudo update-grub
3. Restart reboot
sudo reboot
4. After restarting, you will enter the text interface (the hostname has been changed before, so the hostname is no longer ubuntu)
Turn off the graphical interface for Ubuntu 16.04
Check out the Ubuntu version
lsb_release -a
Turn off the GUI startup
systemctl disable lightdm.service
reboot
sudo reboot
Go back to the graphical interface and use the following command
sudo systemctl start lightdm.service