I was looking for some package (nautilus-terminal
), and accidentally did this:
$ sudo apt-get install nautilus-
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
apturl apturl-common libgail-3-0 linux-headers-4.4.0-57 linux-headers-4.4.0-57-generic linux-image-4.4.0-57-generic linux-image-extra-4.4.0-57-generic
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
gnome-session-flashback nautilus nautilus-sendto nautilus-share ubuntu-desktop
0 upgraded, 0 newly installed, 5 to remove and 69 not upgraded.
After this operation, 2 031 kB disk space will be freed.
Do you want to continue? [Y/n] ^[[^C
That's quite dangerous because remove is much harder to mistype than a simple dash from a failed autocompletion.
Is that an equivalent of apt-get remove
? I couldn't find any documentation for that. Edit: except for overlooking the man page...
From
man apt-get
:The following two mean the same:
So if you are merely installing or removing one thing, then there is really no reason to choose one over the other, and the
remove
command may as well be used.Where the "minus" operator comes in handy is in cases where you want to remove one package and install another in the same operation:
I couldn't think of a better example, but there are some situations where removing one and adding another in separate operations could trigger additional unnecessary installations or removals, while doing them both in a single operation will immediately satisfy some co-dependencies and make it an overall simpler operation.
As for whether adding the minus makes it easier to accidentally remove something unintentionally, I first and foremost refer you to how easy it is to create damage to your system unintentionally on the command line anyway. It was not built to protect you from yourself and there are billions of even simpler commands that can hose your system. But secondly, in this case it tells you exactly what it's going to do and confirms that you really want to do it. This is low risk.