Is this apt-get autoremove operation safe?
I have just upgraded to Wheezy and apt-get autoremove is saying there are the following packages which may be safely removed. I have kde 4.7.4 installed.
Code:
/home/edbarx# apt-get autoremove |
Ouch! No , not when it wants to remove that many packages and things like hal, and all the python stuff.
Try running apt-get -f install or Open Synaptic and see what it says in either Obsolete or Autoremovable, something needs to be installed that was some how removed. I find the safest thing to do is disable autoremove in apt.conf. Code:
# cat /etc/apt/apt.conf Quote:
|
@ Reply
Hi edbarx,
Yes it is safe to use apt-get autoremove option. It removes the packages that are no longer needed so you can use this option. @ craigevil As I can see from the man apt-get page it says: Code:
autoremove |
As the name suggests, apt-get AUTOremove is an automated operation where the system takes its "best guess" what you are trying to achieve. It should not be used as a substitute for common sense system administration.
Since you are new to Debian Testing you should definitely do some basic reading first. It is actually a fairly common situation in Testing that the user must go on the forum/mailing-lists to understand a particular update situation. The safest thing to do is not use the (completely optional!!) apt-get autoremove until you understand the situation. Personally at this stage my next step would be to use tasksel to make sure you have installed the correct metapackages (I'm guessing you want Desktop Environment, right?) to avoid the situation of autoremove removing wanted packages. DISCLAIMER: I am not a Testing user myself, and I know there are some pretty knowledgable Testing users here, so take my advice with a grain of salt. :) |
Wheezy is not misbehaving. I already did some reading to learn about the listed packages for removal. Whenever there is a big list of packages for removal, it is always safer to be on the side of caution. However, even if I remove the packages, I can still take a note of packages' names, save them to a file and use:
Code:
apt-get install $(cat removed-packages-list) Code:
/home/edbarx# apt-get -f install |
@ Reply
As far as I know if you use apt-get install to install the stuff on your system then apt-get autoremove should not hurt. It might create a problem if you do install stuff explicitly (that is without using apt-get install).
In that case apt-get autoremove might make a mistake as it will not be aware about the packages dependency of the package that you have installed explicitly. |
If as you say you went from Squeeze to Wheezy, then a lot of stuff might just have been obsoleted. :)
|
Quote:
In short, Debian developers create meta-packages that don't contain any software, but have a lot of dependencies. This is used, for example, to install a complete desktop system with a single apt-get command, for example apt-get install gnome. In this case the package doesn't contain Gnome, but is dependent on all packages the Debian developers think that should be part of a Gnome install. The problem with this approach: If you (or an update) removes a package that is part of this dependency list the auto-remove function wants to remove all other packages in the dependency list, leaving you with a system without working desktop (and sometimes even with a completely broken system). apt-get autoremove is a dangerous weapon, use it with care (and edbarx has done that, rather ask than mindlessly confirm to rip out half of the system, relying on an automatic function). Having said that, I thank Pat Volkerding for this one great system without automatic dependency resolution. |
@ Reply
Quote:
I can make out the following points from this link: 1. When you install a package using: Code:
apt-get install <package name> 2. As you said about meta-package it is a package that contains all the dependency and it is not a software in itself. I found it to be like a shopping list (read somewhere). So basically meta-package is not a dish itself but ingredients that will be used in a dish. Questions that is still bothering me is the later explanation in that article. Let us assume that I have installed gnome using: Code:
apt-get install gnome Code:
apt-get -s autoremove | less Code:
apt-get remove gnome-office Code:
apt-get autoremove Thing that is still confusing me is how system calculates which things to include/exclude in autoremove option. |
Did you do that on Ubuntu or on Debian? AFAIK, those both distributions handle the marking of automatically installed packages differently, Ubuntu handles it in a way that is more newbie friendly by marking those dependencies as manually installed to prevent newbies from accidentally delete half the system with apt-get, while Debian assumes that you are knowing what you do when you are playing with the package manager.
|
I am certainly no expert on running Debian testing. I do have, however, this install of it which I have used for about 2 years as my production OS.
I wouldn't use the autoremove command if I were you. Just pulled it up to take a look at it and in about 15 seconds of glancing at it only picked out to packages that are currently in use. Admittedly it would not be a disaster if I removed lobrhythmbox-core5 or rhythmbox-data. Rhythmbox depends on both of these so I think it may suffer but could be reinstalled easily. I do have a lot of experience with Ubuntu testing releases. Using auto remove on them is a very good way to break your system. This is a command that is intended for stable releases. You could easily go to synaptic and go through the list there. Select one at a time and hit apply. It will offer you a chance to back out. See what all is being removed. You can set your preferences in Synaptic to show a lot of info. Just highlighting a package will give you info on the depends for instance. I would be shocked if there are no some packages listed there that you have no need of at all. Maybe even a majority of them. I would be more shocked if just using the autoremove command did not do some very serious damage to your system. Yes you can fix it after that. It is a lot easier to not break it in the first place. |
Craigevil has given good solid and sound advice, if I were you I would heed it. Snowpine and Tobi have also given good advice. Widget is just full of good advice.
Now to mine and I'll give you an example to clarify it. If you have modified the system in any way your package lists will be different to the "official" package lists. If you have removed any packages at all you may find you have caused the removal of a dependency of a smetapackage. Metapackages are used to pull in a bunch of other packages but have no other use. If you have inadvertantly removed a metapackage dependency you will now see other packages listed as dependencies of that metapackage in the autoremove list. So as an example say you have removed openoffice/libreoffice you will have caused a meta package to try and install other software like gnomeoffice or something similar. If you do not allow that to install apt will place many parts of Gnome (I can't give an example in KDE but it will do the same) in the autoremove list. If you allow the autoremove you will break your desktop environment and find it near impossible to do simple things like log in, open applications or even (I did this once) shut down. As already pointed out, autoremove is indicating you now have a dependency problem. My gut feeling is you have accidentally removed a dependencies of a metapackage so the remaining dependencies are listing as autoremoveable. |
Actually, I have upgraded a full system (Squeeze with kde) to Wheezy. The upgrade process itself crashed and I had to revive it by issuing and apt-get -f install command. That, complained that it couldn't work because there was a dependency problem. I used dkpg -i to resolve the latter and then apt-get -f install. However, apt-get -f install, continued till the very end of the installation probably assuming it was not a dist-upgrade what I needed. After that, I reapplied an apt-get dist-upgrade to correct the remaining problems and did some package auditing to verify that I did not have any remaining packages from Squeeze.
As long as the system boots in CLI, it should not be a problem, although there is still the chance of using a chroot from within another working installation. That should enable one to repair the system and it would be an interesting experiment to try. I think, the safest action to take is to backup the entire installation, attempt a removal of the packages from outside kde (with kdm stopped) and reinstall the deleted packages. That should eliminate the need for the missing meta package. |
Quote:
|
@ Reply
Quote:
Code:
cat /etc/debian_version 1. How apt-get autoremove calculates which packages to be removed. 2. If this option is so disastrous then why it is there. 3. When I did small testing with my Debian system it did not remove any package which was in use when I ran apt-get autoremove. I mean if it is so dangerous then why does it exist there on the first place. I did try to find more information on this option on Debian's site but was unable to find much. If we say that autoremove option sometimes remove the stuff which is required by the system then there is a problem with the code. It is like running "clear" command sometimes not only clears the screen but make the screen go black till you reboot :-) |
All times are GMT -5. The time now is 09:53 AM. |