Execute the following command to clear the cache and update your package list.
sudo apt clean all && sudo apt update
Execute the following command to install the software packages required for the desktop environment. Including system panel, window manager, file browser, terminal and other desktop applications.
sudo apt install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal ubuntu-desktop
The system enters command line mode or graphical user interface by default when booting:
sudo systemctl set-default multi-user.target # 命令行
sudo systemctl set-default graphical.target # 图形用户界面
Restart to take effect.
Temporarily return to the graphical interface and enter the command: startx
Switch back to the command line from the graphical interface: Ctrl+Alt+F7
Temporarily return to command line mode: Ctrl+Alt+F1
Switch from the command line to the graphical interface: Ctrl+Alt+F7