LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Is this apt-get autoremove operation safe? (https://www.linuxquestions.org/questions/debian-26/is-this-apt-get-autoremove-operation-safe-935534/)

edbarx 03-21-2012 05:14 PM

I took a note of the list of packages marked for auto-removal and saved them in a text file. Then I issued the command:
Code:

# apt-get install $(cat file-with-package-names)
I did the above to set all the listed packages as set to manually installed instead of automatically installed. This led the system to keep the packages while at the same time I can use the autoremove feature for other purposes.

The commands together withe the CLI output are listed below:
Code:

# apt-get install $(cat Documents/packages-to-keep)
Reading package lists... Done
Building dependency tree     
Reading state information... Done
acl is already the newest version.
acl set to manually installed.
libcolord1 is already the newest version.
libfftw3-3 is already the newest version.
libfftw3-3 set to manually installed.
g++-4.4 is already the newest version.
g++-4.4 set to manually installed.
libstdc++6-4.4-dev is already the newest version.
libstdc++6-4.4-dev set to manually installed.
gksu is already the newest version.
libgail18 is already the newest version.
libgail18 set to manually installed.
hal is already the newest version.
hal set to manually installed.
libhal-storage1 is already the newest version.
libhal-storage1 set to manually installed.
libhal1 is already the newest version.
libhal1 set to manually installed.
hal-info is already the newest version.
hal-info set to manually installed.
hplip-data is already the newest version.
hplip-data set to manually installed.
libsane-hpaio is already the newest version.
kdebase-apps is already the newest version.
kdebase-apps set to manually installed.
kdebase-bin is already the newest version.
kdebase-bin set to manually installed.
kdebase-workspace is already the newest version.
kdebase-workspace set to manually installed.
libart-2.0-2 is already the newest version.
libart-2.0-2 set to manually installed.
libexif12 is already the newest version.
libexif12 set to manually installed.
libfreezethaw-perl is already the newest version.
libfreezethaw-perl set to manually installed.
libfs6 is already the newest version.
libfs6 set to manually installed.
libgksu2-0 is already the newest version.
libgksu2-0 set to manually installed.
libgnome-keyring-common is already the newest version.
libgnome-keyring-common set to manually installed.
libgnome-keyring0 is already the newest version.
libgnome-keyring0 set to manually installed.
libgphoto2-l10n is already the newest version.
libgphoto2-l10n set to manually installed.
libgphoto2-port0 is already the newest version.
libgphoto2-port0 set to manually installed.
libgsf-1-114 is already the newest version.
libgsf-1-114 set to manually installed.
libgsf-1-common is already the newest version.
libgsf-1-common set to manually installed.
libgtop2-7 is already the newest version.
libgtop2-7 set to manually installed.
libgtop2-common is already the newest version.
libgtop2-common set to manually installed.
libidl0 is already the newest version.
libidl0 set to manually installed.
libieee1284-3 is already the newest version.
libieee1284-3 set to manually installed.
libjpeg62 is already the newest version.
libjpeg62 set to manually installed.
libkdcraw-data is already the newest version.
libkdcraw-data set to manually installed.
libksane-data is already the newest version.
libksane-data set to manually installed.
libmldbm-perl is already the newest version.
libmldbm-perl set to manually installed.
libmusicbrainz4c2a is already the newest version.
libmusicbrainz4c2a set to manually installed.
libnl1 is already the newest version.
libnl1 set to manually installed.
libofa0 is already the newest version.
libofa0 set to manually installed.
libtunepimp5 is already the newest version.
libtunepimp5 set to manually installed.
libxklavier16 is already the newest version.
libxklavier16 set to manually installed.
kdegraphics-libs-data is already the newest version.
kdegraphics-libs-data set to manually installed.
min12xxw is already the newest version.
min12xxw set to manually installed.
openvpn-blacklist is already the newest version.
openvpn-blacklist set to manually installed.
liborbit2 is already the newest version.
liborbit2 set to manually installed.
python-pexpect is already the newest version.
python-pexpect set to manually installed.
pnm2ppa is already the newest version.
pnm2ppa set to manually installed.
python-imaging is already the newest version.
python-imaging set to manually installed.
python-renderpm is already the newest version.
python-renderpm set to manually installed.
python-reportlab is already the newest version.
python-reportlab set to manually installed.
python-reportlab-accel is already the newest version.
python-reportlab-accel set to manually installed.
libqt4-webkit is already the newest version.
libqt4-webkit set to manually installed.
libraptor1 is already the newest version.
libraptor1 set to manually installed.
libsane-common is already the newest version.
libsane-common set to manually installed.
libsane-extras is already the newest version.
libsane-extras set to manually installed.
libsane-extras-common is already the newest version.
libsane-extras-common set to manually installed.
libsmpeg0 is already the newest version.
libsmpeg0 set to manually installed.
sudo is already the newest version.
sudo set to manually installed.
libsvga1 is already the newest version.
libsvga1 set to manually installed.
x11-apps is already the newest version.
x11-session-utils is already the newest version.
x11-session-utils set to manually installed.
x11-xfs-utils is already the newest version.
x11-xfs-utils set to manually installed.
libxcb-render-util0 is already the newest version.
libxcb-render-util0 set to manually installed.
xinit is already the newest version.
xinit set to manually installed.
xbase-clients is already the newest version.
xbase-clients set to manually installed.
libxine1-console is already the newest version.
libxine1-console set to manually installed.
libmagickcore3 is already the newest version.
libmagickcore3 set to manually installed.
libavutil49 is already the newest version.
libavutil49 set to manually installed.
libmaa2 is already the newest version.
libmaa2 set to manually installed.
libgmp3c2 is already the newest version.
libgmp3c2 set to manually installed.
libavcodec52 is already the newest version.
libavcodec52 set to manually installed.
konq-plugins-l10n is already the newest version.
konq-plugins-l10n set to manually installed.
libsolidcontrol4 is already the newest version.
libsolidcontrol4 set to manually installed.
libboost-program-options1.42.0 is already the newest version.
libboost-program-options1.42.0 set to manually installed.
libkexiv2-8 is already the newest version.
libkexiv2-8 set to manually installed.
libnotify1 is already the newest version.
libnotify1 set to manually installed.
libnm-util1 is already the newest version.
libnm-util1 set to manually installed.
libmatroska0 is already the newest version.
libmatroska0 set to manually installed.
libmagickcore3-extra is already the newest version.
libmagickcore3-extra set to manually installed.
libkwineffects1a is already the newest version.
libkwineffects1a set to manually installed.
xulrunner-1.9.1 is already the newest version.
xulrunner-1.9.1 set to manually installed.
libmagickwand3 is already the newest version.
libmagickwand3 set to manually installed.
libkephal4 is already the newest version.
libkephal4 set to manually installed.
libvpx0 is already the newest version.
libvpx0 set to manually installed.
libxcb-event1 is already the newest version.
libxcb-event1 set to manually installed.
libebml0 is already the newest version.
libebml0 set to manually installed.
libgps19 is already the newest version.
libgps19 set to manually installed.
libx264-118 is already the newest version.
libx264-118 set to manually installed.
libxcb-aux0 is already the newest version.
libxcb-aux0 set to manually installed.
libpango1.0-common is already the newest version.
libpango1.0-common set to manually installed.
libxcb-atom1 is already the newest version.
libxcb-atom1 set to manually installed.
libplasmaclock4a is already the newest version.
libplasmaclock4a set to manually installed.
libswscale0 is already the newest version.
libswscale0 set to manually installed.
libhunspell-1.2-0 is already the newest version.
libhunspell-1.2-0 set to manually installed.
libmarblewidget4 is already the newest version.
libeggdbus-1-0 is already the newest version.
libeggdbus-1-0 set to manually installed.
libgs8 is already the newest version.
libgs8 set to manually installed.
foomatic-filters-ppds is already the newest version.
foomatic-filters-ppds set to manually installed.
libpoppler5 is already the newest version.
libpoppler5 set to manually installed.
libtaskmanager4a is already the newest version.
libtaskmanager4a set to manually installed.
kaboom is already the newest version.
kaboom set to manually installed.
libgirepository1.0-0 is already the newest version.
libgirepository1.0-0 set to manually installed.
libmozjs2d is already the newest version.
libmozjs2d set to manually installed.
libavutil50 is already the newest version.
libavutil50 set to manually installed.
libwebkit-1.0-2 is already the newest version.
libwebkit-1.0-2 set to manually installed.
libwebkit-1.0-common is already the newest version.
libwebkit-1.0-common set to manually installed.
libmediastreamer0 is already the newest version.
libmediastreamer0 set to manually installed.
libnm-glib2 is already the newest version.
libnm-glib2 set to manually installed.
libavformat52 is already the newest version.
libavformat52 set to manually installed.
librasqal2 is already the newest version.
librasqal2 set to manually installed.
libkipi7 is already the newest version.
libkipi7 set to manually installed.
libicu44 is already the newest version.
libicu44 set to manually installed.
libpostproc51 is already the newest version.
libpostproc51 set to manually installed.
libprocesscore4a is already the newest version.
libprocesscore4a set to manually installed.
libsolidcontrolifaces4 is already the newest version.
libsolidcontrolifaces4 set to manually installed.
libdvbpsi6 is already the newest version.
libdvbpsi6 set to manually installed.
libpolkit-qt-1-0 is already the newest version.
libpolkit-qt-1-0 set to manually installed.
libweather-ion4a is already the newest version.
libweather-ion4a set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
root@edbarx-pc2:/home/edbarx# apt-get autoremove
Reading package lists... Done
Building dependency tree     
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.


TobiSGD 03-21-2012 05:22 PM

Quote:

Originally Posted by T3RM1NVT0R (Post 4632969)
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.

1. It simply seeks in its database for packages that are marked as automatically installed but are not dependencies for another package.
2. auto-remove is not dangerous in every case. It can become dangerous when it is used together with meta-packages. It is totally possible to install a Debian system without using any meta-package. It also is totally possible to build your own distro using the APT package management system without any meta-packages. It is just that it is convenient to use meta-packages. The same way you could ask why rm has the -rf option, although doing rm -rf /usr (WARNING, don't do that if you don't want to destroy your system) will in any case render your system unusable.
Since you are only be able to use apt-get auto-remove (or the rm thing) as root, it is up to your responsibility to actually think about what you are doing and read the output on the screen before confirming it.
3. Can not say much about that, I have seen many threads in different forums where auto-remove showed the behavior edbarx described, and back in the days I used Debian I also sometimes had problems with that, especially when using Sid (or Sid/Experimental mixes). If you use package management systems with automatic dependency resolution you should be prepared that sometimes odd things may happen. Again, this is why you always should read what is displayed on the screen before confirming anything (not saying that you don't do that).

edbarx 03-21-2012 05:23 PM

Debian's package management system differentiates between:
a) packages that were install explicitly by the user
b) packages that were automatically pulled in by system to satisfy dependences of packages that were installed explicitly.

Furthermore, there are empty packages which do not provide other functionality than providing a list of required packages. These are called meta-packages. If a meta-package is removed, than some/all of its dependencies may be marked as unneeded as they were not explicitly installed by the user. Meta-packages are useful in cases where the user needs a simple command to install a complex suit of software (say kde or gnome) with just the explicit installation of one package, the meta-package.

273 03-21-2012 05:28 PM

Personally I only come across this problem when I do a dist-upgrade. In day to day use autoremove just tends to suggest a few packages that, generally, I know can go but when it comes to just after a dist-upgrade, or a new install, I tend to leave autoremove until things settle down.
Might this be caused in part by dependency changes when upgrading, or am I complicating matters and it's just meta-packages?

widget 03-21-2012 05:48 PM

If you are using the command on a stable system such as Debian stable (Squeeze) there is little chance of a problem. Most problems there will be the result of user actions that change the "state" of the package.

If you are using a non stable OS such as Debian testing or Sid the chances of error are higher. The chances of user actions that change the state of the packages is also, I believe, higher.

That belief is based on my oppinion that users of this type of OS are more adventurous in their use of and play with the installation. I do know for a fact that this is true in at least one case, mine. Could be that I am simply crazy and other users are not.

It is a prefectly good command and very handy. As all tools are designed to be useful in stable OS's the fact that you need to be careful with them in other installs just makes sense.

Update Manager (or Update Mangler as I like to call it) is a good example of this. In a stable environment it is very handy for folks to use to keep their OS up to date.

Every cycle of Ubuntu testing, however, they get a lot of folks complaining that it broke their system. It does break their system.

It is designed to work with repos that are stable. Ubuntu-testing repos can get packages in them that do not have the depends in there yet. It is a newer version, it needs upgraded. The fact that the depends for the older version will not work is not part of the design of UM. It will tell you that it has a "partial upgrade" available. If you choose to use it that is not the fault of the tool.

Autoclean is a similar tool. Use it in Squeeze with a fair amount of confidence if you have not been making a lot of "strange" installs, particularly from the testing or unstable repos.

Use in testing or Sid with a lot of caution. This advice is similar to the advice to use testing or Sid as an OS should be used with caution.

Starting in the Debian experimental repo and migrating progressively through Sid and the testing repos filters the packages that finally arrive in the stable repo that is designed to be the repo for the OS Debian puts out for normal users to use. Those are the users that autoclean is aimed at. Those are the users and conditions it is designed for.

T3RM1NVT0R 03-22-2012 04:11 PM

@ Reply
 
@ All

Thanks for explaining.


All times are GMT -5. The time now is 03:40 AM.