nautilus (files app) takes long time to start on Ubuntu 18.04

I found that in my Ubuntu 18.04, nautilus takes a long time to start. Here is the trace of running it on the command line:

$ time nautilus
Initializing nautilus-dropbox 2015.10.28
Error creating proxy: Error calling StartServiceByName for org.gtk.vfs.UDisks2VolumeMonitor: Timeout was reached (g-io-error-quark, 24)

real    0m40.316s
user    0m0.765s
sys 0m0.141s

I hope it might provide some clues to experts.

I also notice nautilus also causing other apps to start slow, such as gedit and chrome. I tried removing gvfs as well as nautilus will make starting other apps such chrome much faster. But I need a file manager.


Solution 1:

Update:

Problem solved, After some try and error I found the guilty package.

Starting from ubuntu 18.04.3 a package named xdg-desktop-portal-gtk has been added to the release.

I don't know what is the package used for. No other packages depend on it; And I did't need it. Purging it using purge command apt-get purge xdg-desktop-portal-gtk solved the issue. Below you can find the output for time command like time nautilus for opening and closing it ASAP which shows it take about 29 seconds to open before purge and about 2 seconds after purging it.

Before
real    0m28.818s
user    0m0.678s
sys 0m0.402s

After
real    0m1.943s
user    0m0.885s
sys 0m0.156s

P.S: purging the package had no side effect on my system and Ubuntu works smoothly as expected.


History:

Suffering from same issue in 18.04.3,

To get rid of the problem and still have 18.04, you might downgrade to 18.04.2.

I did that, 18.04.2 works smoothly as expected and I have 18.04 as you asked.

Solution 2:

I had similar issues after updating to Ubuntu 18.04. The solution for me was

  • Install net with sudo apt install samba-common-bin
  • then sudo mkdir -p /var/lib/samba/usershares/
  • and sudo chmod go+rwx /var/lib/samba/usershares/