apt-get install with '-' (minus / hyphen) removes packages
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
:
install install is followed by one or more packages desired for installation or upgrading. Each package is a package name, not a fully qualified filename (for instance, in a Debian system, apt-utils would be the argument provided, not apt-utils_1.2.10_amd64.deb). All packages required by the package(s) specified for installation will also be retrieved and installed. The /etc/apt/sources.list file is used to locate the desired packages. If a hyphen is appended to the package name (with no intervening space), the identified package will be removed if it is installed. Similarly a plus sign can be used to designate a package to install. These latter features may be used to override decisions made by apt-get's conflict resolution system.