Search code examples
vagrantatom-editorgvfs

Is gvfs-trash installed? in Atom


When I tried to remove a file in local machine to check files are synchronous with vagrant development server it pops up an error:

The following file couldn't be moved to the trash.
Is gvfs-trash installed?

For solving it I created a trash directory that can be accessed from outside the user’s home directory:

# Create a Trash directory (with some subdirectories) in root
sudo mkdir -p /.Trash-1000/{expunged,files,info}

# Give ownership of this to your user:
sudo chown -R $USER /.Trash-1000

Still I can't remove the file from local machine. But If I delete a file at vagrant development server it automatically deletes at local machine, opposite is not happening and ends-up with this error "Is gvfs-trash installed? "


Solution

  • There is an issue on GitHub reporting this problem. According to the report, a missing .Trash-1000 can cause this problem, so you can create it as follows.

    mnt=/; id=$(id -u); sudo mkdir -p "$mnt/.Trash-$id"/{expunged,files,info} \
      && sudo chown -R $USER:$USER "$mnt/.Trash-$id"/ \
      && sudo chmod -R o-rwx "$mnt/.Trash-$id"/
    

    Set mnt to the mount point, where gvfs-trash is expecting it. Simply cd to the directory which will be opened in atom and execute df .. This will give something like this:

    Filesystem     1K-blocks      Used Available Use% Mounted on
    /dev/sdb1      960380628 463122460 448403708  51% /mnt/vol
    

    In this example, the mount point and the value of mnt would be /mnt/vol.