As empathy 2.30 in Debian Wheezy didn’t meet all my preferences I tried out empathy 3.1 from experimental, using the command:
apt-get -t experimental install empathy
I had to find out, this version of empathy doesn’t work well in Gnome 2.x. Therefore I mentioned:
apt-get purge empathy apt-get install empathy
Hoping, that this will reinstall the “standard” version of empathy again.
So far, everything worked well.
But now:
apt-get autoremove
wants to delete Gnome as a whole.
How can I calm down apt-get autoremove?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
APT maintains an indicator for each package, telling it whether the package is manually installed (installed because the user/administrator wanted it) or automatically installed (installed only because it’s a dependency of some other package). That’s what apt-get autoremove uses to determine what to remove: it removes packages that are marked as automatically installed, but that no currently installed package requires.
You need to mark the gnome package, or whatever Gnome package corresponds to the bits you want to keep, as manually installed. It’s easiest to do this in an interactive tool with access to the automatically-installed setting:
- On the command line, call
aptitude unmarkauto PACKAGENAMEto mark PACKAGENAME as manually installed, ormarkautoto mark it as automatically installed. - In Aptitude, move to the line corresponding to a package, then press
mto mark it as manually installed, orMto mark it as automatically installed. - In Synaptic, move to the line corresponding to a package, then toggle “Automatically installed” in the “Package” menu.
Note that (at least as of squeeze, I haven’t checked wheezy) gnome-desktop-environment depends on all of the official Gnome components, including empathy. I suspect you had gnome-desktop-environment installed, and removing the empathy package had to remove it because of the dependency. If this is the case you should now reinstall gnome-desktop-environment. (If you don’t remember, you can find a history of what APT-based package managers did in /var/log/apt.)
Instead of purging and installing empathy, you could have just done apt-get -t wheezy empathy to install the wheezy version.
Method 2
You can apt-get install some gnome package (which is already installed) to set it as manually selected (installed). This should introduce the needed dependencies such that autoremove does not want to remove the gnome packages anymore.
I am not using gnome, but probably there is some gnome-desktop package or something like that which pulls in all the main gnome stuff.
For example the output on my system for a non-gnome package:
# apt-get install libsource-highlight3 Reading package lists... Done Building dependency tree Reading state information... Done libsource-highlight3 is already the newest version. libsource-highlight3 set to manually installed.
libsource-highlight3 was automatically installed as dependency of source-highlight. After the remove of source-highlight, apt-get autoremove would not remove the libsource-highlight3 package, because it is set to manually installed now.
Method 3
Another solution would be to completelly switch off autoremove with these options (in /etc/apt/apt.conf orn in file in /etc/apt/apt.conf.d/ directory):
APT::Get::AutomaticRemove "0"; APT::Get::HideAutoRemove "1";
Method 4
Just copy the list of packages apt is wanting to autoremove (use a text editor to remove trailing whitespace). Then sudo apt install <paste list of packages> fixed this issue for me on numerous occasions. Its simply a difference of packages being manually installed (apt thinks you must need these as you installed them) vs. packages being automatically installed (apt installed these so it assumes it can do what it wants with them). By doing th above you tell apt that they are all mannually installed. FYI – I sometimes have to do this twice as it will continue to suggest further autoremoves.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0