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?
-
Official documentation for changing and restoring file manager: [Ubuntu documentation for Default File Manager ](help.ubuntu.com/community/DefaultFileManager)– Sohail xIN3NFeb 27, 2014 at 10:28
-
3Opposite of this question: askubuntu.com/questions/260244/…– WilfJun 22, 2015 at 23:38
5 Answers
This did it for me, after I google for a while:
xdg-mime default nautilus.desktop inode/directory application/x-gnome-saved-search
I also typed:
gsettings set org.gnome.desktop.background show-desktop-icons true
-
After that my Linux Mint failed to log in with X-session error
g_key_file_free: assertion 'key_file != NULL' failed
. To recover use Ctrl-Alt-F1 &sudo apt-get cinnamon
andsudo reboot
– ZonJul 18, 2018 at 4:26 -
The
xdg-mime
command worked for me in Ubuntu 16.04. I replacednautilus.desktop
withpcmanfm.desktop
since I wanted to use that as my default file manager. You can find the name of the file manager you want to use by using the following commandls /usr/share/applications
and finding its corresponding.desktop
file.– OwNJun 19, 2019 at 3:08 -
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
-
-
1Is there any reason not to install exo-utils? (I use Ubuntu 16.04 and this method of changing the File Manager back to Nautilus, from Nemo, was the only method that worked, out of several I tried.) Apr 8, 2017 at 12:42
-
-
1This is the only way I could make
xdg-open
open directories withnautilus
in Debian, thanks.– jojmanMay 24, 2017 at 5:40 -
1
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
-
1
-
@nick It's a good question because it can stump people who've used Debian/Ubuntu for even longer; and 7 years later the answer(s) can/will change. You should never hesitate to answer a question regardless of its age; especially if the question exists already - and the historic answer doesn't work any longer. People are encouraged not to repeat questions; stack has evolved its products so that answers may stack according to most recent upvotes (recent preference changes, you may have noticed). In a sense revival isn't really a thing, because ongoing support is supported/expected.– RikAug 31, 2022 at 14:11
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.
-
1
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/nautilus
there 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.