A while back, I set my default file manager to Nemo. I like it a lot, but it constantly crashes. I remember editing a text file to set it as default, but I forgot which file it was. How do I switch back to the Nautilus file manager?
5 Answers
I spent AGES trying to find a method that would work. Eventually I found this advice, which is incredibly easy, and worked for me:
Install exo-utils (this package contains the Xfce settings plugin and the utility files for libexo-2-0). Open a terminal and type:
sudo apt install exo-utils
Then run:
exo-preferred-applications
then switch to Utilities tab and select File Manager you prefer.
exo-preferred-applications was dropped entirely in version 4.15.3-1. Install xfce4-settings with sudo apt install xfce4-settings and use this instead:
xfce4-mime-settings
- 122,292
- 133
- 301
- 332
- 327
The answers here didn't work for me on Debian Bookworm - so after figuring it out myself:
Premise
Every time I attempt to leverage xdg-open on a directory (typically through an application; like Keybase's "open in file explorer" option, or something similar in Steam), what opens is Visual Studio Code.
What doesnt work
Attempting to "Open with other application" a directory via the context menu in "Files" [Nautilus] (file explorer when using Gnome on Debian) and then "Forget association" on Visual Studio Code (right click on it in the list of applications), subsequently choosing "Files" to open the directory with - does not fix what is used for directories when xdg-open is invoked; it only changes what opens a directory from within "Files" [Nautilus].
What does work
Run the following:
xdg-mime default org.gnome.Nautilus.desktop inode/directory
The standard, as explained, is as follows:
xdg-mime default- We're setting a default application
org.gnome.Nautilus.desktop- We're setting the default application to be Nautilus, by its fully-qualified desktop menu name; It's registered as
org.gnome.Nautilus.desktop.
- We're setting the default application to be Nautilus, by its fully-qualified desktop menu name; It's registered as
inode/directory- For the mimetype
inode/directory(found usingxdg-mime query filetype /path/to/target, with target in my case being a directory.)
- For the mimetype
The accepted answer results in Nautilus.desktop and application/x-gnome-saved-search becoming the default application(s); which is not correct, it must needs be org.gnome.Nautilus.desktop.
Also, setting desktop icons to be shown won't set the default application when opening directories via xdg-open.
Alternatively, you can also set it as follows:
nano ~/.config/mimeapps.list
Scroll down to inode/directory under [Added Associations], as well under [Default Applications], and ensure that the line(s) read:
inode/directory=org.gnome.Nautilus.desktop
You can additionally add, under [Removed Associations]:
inode/directory=code.desktop;
This is just the manual, longer, way of doing what I suggested first - together with the "Forget association" bit I portrayed I had attempted
Restore Behavior in Terminal
A user provided edit surmises that one should source the default list of file associations "for immediate effect". This answer, however, focuses on file associations for when xdg-open is invoked by another application.
With that in mind, and in reviewing the default file associations (on Debian and Ubuntu) at /usr/share/applications/defaults.list;
The default file does not seem to provide the aforementioned association. However, in the event that it did, and/or in the event that you wanted an immediate reflection of the default file associations in terminal (i.e. you're xdg-open'ing something in terminal) - you could source the default list in your current terminal session:
source /usr/share/applications/defaults.list
- 261
The file manager choice is handled by a file in ~/.local/share/applications. They are mimeapps.list and mimeinfo.cache, deleting both of those files will reset your file manager to the default, which is Nautilus.
- 374
- 51,797
sudo mv /usr/bin/nemo /usr/bin/nemo.backup- Open any folder. You could use
xdg-open /path/to/folder/while in the command line, for example. Or you could use a X application that requests a file. - A dialog should appear to you requesting a default application to be your file manager. Type
/usr/bin/nautilusthere and confirm.
After that, as long as you don't rename nemo to its original name/location, nautilus will be your default file manager again.
- 865