1

I wanted to install the tree command to look at /var/www. I can ls /var/www and the directories it contains. Permissions on those directories are set to 755.

I ran

sudo snap install tree

thereafter running

tree /var/www

returns the message

/var/www [error opening dir]

I removed the tree snap with

sudo snap remove --purge tree

...and installed tree with

sudo apt install tree

Now when I try to use tree I get

-bash: /snap/bin/tree: No such file or directory

How to I banish the snap version of tree from my machine completely?

Zanna
  • 69,223
  • 56
  • 216
  • 327
NetFool
  • 131
  • 3
  • 2
    It's likely not in your "machine" - just in your shell's hash table. Try `hash -d tree` or `hash -r` to clear the whole table - see for example [Why is my system only looking in /snap for binaries?](https://askubuntu.com/questions/1317554/why-is-my-system-only-looking-in-snap-for-binaries) – steeldriver Mar 18 '21 at 00:01
  • 1
    That fixed the problem. Thanks. Looks like "snap remove" is somewhat incomplete. – NetFool Mar 18 '21 at 00:13
  • 2
    Does this answer your question? [Why is my system only looking in /snap for binaries?](https://askubuntu.com/questions/1317554/why-is-my-system-only-looking-in-snap-for-binaries) – steeldriver Mar 18 '21 at 00:15

1 Answers1

1

Steeldriver had the solution!

It's likely not in your "machine" - just in your shell's hash table. Try hash -d tree or hash -r to clear the whole table - see for example Why is my system only looking in /snap for binaries?

Zanna
  • 69,223
  • 56
  • 216
  • 327
NetFool
  • 131
  • 3