2017年2月21日 星期二

取消 Ubuntu 圖形介面,改用文字介面

修改 GRUB

  1. 修改 /etc/default/grub,將 GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" 變成 GRUB_CMDLINE_LINUX_DEFAULT="text"
    # If you change this file, run 'update-grub' afterwards to update
    # /boot/grub/grub.cfg.
    # For full documentation of the options in this file, see:
    #   info -f grub -n 'Simple configuration'
    
    GRUB_DEFAULT=0
    GRUB_HIDDEN_TIMEOUT=0
    GRUB_HIDDEN_TIMEOUT_QUIET=true
    GRUB_TIMEOUT=10
    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    #GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
    GRUB_CMDLINE_LINUX_DEFAULT="text"
    GRUB_CMDLINE_LINUX=""
    
  2. 更新 GRUB
    root@cysrv:~# update-grub
    Generating grub configuration file ...
    Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
    Found linux image: /boot/vmlinuz-4.4.0-63-generic
    Found initrd image: /boot/initrd.img-4.4.0-63-generic
    Found linux image: /boot/vmlinuz-4.4.0-62-generic
    Found initrd image: /boot/initrd.img-4.4.0-62-generic
    Found linux image: /boot/vmlinuz-4.4.0-59-generic
    Found initrd image: /boot/initrd.img-4.4.0-59-generic
    Found memtest86+ image: /memtest86+.elf
    Found memtest86+ image: /memtest86+.bin
    done
    


修改 systemd

  1. sudo systemctl enable multi-user.target --force
  2. sudo systemctl set-default multi-user.target

還原 GUI 設定 systemd 的方法

  1. sudo systemctl unmask lightdm
  2. sudo systemctl enable lightdm
  3. sudo systemctl set-default graphical.target