I've tried looking online for someone with the same problem as me but couldn't find anything, so I hope this is an original question.

I'm very new to the Raspberry Pi so I tried fooling around by changing the desktop environment from the default one (I use the Raspbian one). Specifically, I googled it and found an answer on this website, How do I switch to a new desktop environment?

The person who originally asked the question had already downloaded a new desktop, but when I ran the command I didn't download anything, and ran it just to see if anything would happen. The command I ran was:

sudo update-alternatives --config x-session-manager

Running it was a bit foolish because I didn't know what the command does (I still don't) but when it asked for input (the options were something like auto or manual), I chose manual. Now when I reboot the Pi, it shows the starting text (the long list that has the [OK]), but after it just shows a black screen with a cursor and nothing else.

1 Answer 1


You can find the documentation for the update-alternatives online (or use man update-alternatives in your terminal) which explains what the tool does:

update-alternatives creates, removes, maintains and displays information about the symbolic links comprising the Debian alternatives system.

It is possible for several programs fulfilling the same or similar functions to be installed on a single system at the same time. For example, many systems have several text editors installed at once. This gives choice to the users of a system, allowing each to use a different editor, if desired, but makes it difficult for a program to make a good choice for an editor to invoke if the user has not specified a particular preference.

Debian's alternatives system aims to solve this problem. A generic name in the filesystem is shared by all files providing interchangeable functionality. The alternatives system and the system administrator together determine which actual file is referenced by this generic name. For example, if the text editors ed(1) and nvi(1) are both installed on the system, the alternatives system will cause the generic name /usr/bin/editor to refer to /usr/bin/nvi by default. The system administrator can override this and cause it to refer to /usr/bin/ed instead, and the alternatives system will not alter this setting until explicitly requested to do so.

Later on it explains about the --config option you used:

When using the --config option, update-alternatives will list all of the choices for the link group of which given name is the master alternative name. The current choice is marked with a '*'. You will then be prompted for your choice regarding this link group. Depending on the choice made, the link group might no longer be in auto mode. You will need to use the --auto option in order to return to the automatic mode (or you can rerun --config and select the entry marked as automatic).

Hopefully that clarifies it a little bit, but the gist is that you've changed the X session manager to be something else, and that appears to have broken your system horribly. Your goal is to set it back to what it was originally, and hopefully that should restore any problems.

If you are unable to get to a terminal to fix any damage done, you might need to follow the steps listed here to add init=/bin/bash to the end of your cmdline.txt. Before doing that though, see if Ctrl+Alt+F2 takes you to a terminal—if so, don't bother with the steps listed there and just run the commands below.

Once you've got a shell running and the file system is writeable, you then need to figure out how to reset what you've changed. This will probably be done by running:

sudo update-alternatives --auto x-session-manager

then remove init=/bin/bash as instructed in the steps linked above and reboot. If that fixes it, great. If not, re-add init=/bin/bash and try:

 sudo update-alternatives --config x-session-manager

then set the option back to the alternative that had been selected before you changed it. Good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.