I forgot to install the desktop environment while installing Debian 12.
I'm stuck in tty1 when installing, no GUI, only text. I've asked on a Facebook group, and people there say I forgot to install the desktop environment.
What should I do?
Assuming you want to continue from where you are now, these instructions will help you get the graphical interface installed. However, since you are using a freshly installed system you might find it easier simply to rerun the installation from scratch, this time remembering to include the desired graphical interface.
Log in using the username and password you set up earlier. You will not see anything when you type in the password. No stars. Nothing. Remember to hit Enter at the end of the username and password rather than Tab. You cannot use either the mouse or cursor keys at this point (if you make a mistake, delete what you've typed with Backspace, do not try to move back with the cursor.)
Username: ari
Password: _
Linux pi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
ari:~$ _
You now have a prompt (it will typically end with $) at which you can enter commands. I've shown the cursor as _. In your case it may be a flashing line or block.
Run su -c tasksel (and hit Enter). Enter the root password you set for the root account during installation when prompted (remember you'll see nothing happen while you type the password):
ari:~$ su -c tasksel
Password: _
Alternatively, if you have already installed sudo or definitely did not set a root password, try using sudo tasksel (and hit Enter). Enter your password if/when prompted:
ari:~$ sudo tasksel
Sudo password for ari: _
Either way, you should start the Task Selection tool, which will look something like this:
Package configuration
┌───────────────────────┤ Software selection ├────────────────────────┐
│ You can choose to install one or more of the following predefined │
│ collections of software. │
│ │
│ Choose software to install: │
│ │
│ [*] Debian desktop environment │
│ [ ] ... GNOME │
│ [ ] ... Xfce │
│ [ ] ... GNOME Flashback │
│ [ ] ... KDE Plasma │
│ [ ] ... Cinnamon │
│ [*] ... MATE │
│ [ ] ... LXDE │
│ [ ] ... LXQt │
│ [ ] web server │
│ [ ] SSH server │
│ [ ] laptop │
│ │
│ │
│ <Ok> <Cancel> │
│ │
└─────────────────────────────────────────────────────────────────────┘
Using the cursor keys ↑ ↓ to move up and down and Space to select/deselect, choose the Debian desktop environment. By default this will automatically include GNOME, but you might prefer Cinnamon or MATE. You'll see * alongside the two items you select.
Use Tab to move to the <Ok> item and hit Space once more to accept
The best way is to use tasksel as said @Chris Davies.
Alternatively, you can display the available desktop env by looking to Recommends packages in apt show task-desktop:
Recommends: task-gnome-desktop | task-xfce-desktop | task-kde-desktop | task-lxde-desktop |
task-gnome-flashback-desktop | task-cinnamon-desktop | task-mate-desktop | task-lxqt-desktop,...
Then install the desired desktop env with its dependencies, e,g:
sudo apt install task-gnome-desktop
Note : On Debian 12, caret ^ at the end of task-name in apt install isn't allowed.
Using tasksel non interactively. To list tasks:
tasksel --list-tasks
i desktop Debian desktop environment
u gnome-desktop GNOME
u xfce-desktop Xfce
u gnome-flashback-desktop GNOME Flashback
u kde-desktop KDE Plasma
u cinnamon-desktop Cinnamon
u mate-desktop MATE
u lxde-desktop LXDE
u lxqt-desktop LXQt
u web-server web server
u ssh-server SSH server
i laptop laptop
To install:
sudo tasksel install gnome-desktop
desktop-task and task-desktop are not the same.
While the above are good answers, suggest we reduce this to just:
sudo apt install task-desktop
That is it. When you are new to Linux, the default desktop is fine. It seems that Chris's excellent instructions got you logged in. Use the above command once logged in.
I am a few decades since new, and found the default desktop fine. :)
The other choices are just noise - when you are new.
(Also, I did not know about the "task-*" targets in apt. Thanks GAD.)
su -c apt install gnome