pkg autoremove: totally unreliable

Status
Not open for further replies.
H

Hanky-panky

Guest
Like in the subject.

The experience with this pkg autoremove command is totally tragic in this perfectly working FreeBSD 11.0-RELEASE system.

Code:
% sudo pkg autoremove
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 63 packages:

Installed packages to be REMOVED:
        docbook2X-0.8.8_4
        OpenSP-1.5.2_3
        accerciser-3.14.0_1
        adacurses-20150808_4
        gnome-utils-3.18.0,1
        baobab-3.18.1
        clang36-3.6.2
        gnome-contacts-3.18.0_3
        enca-1.19
        enscript-a4-1.6.6_2
        eog-plugins-3.16.3
        evolution-mapi-3.18.4
        gcc6-aux-20160822
        gegl-0.2.0_19
        gnome-photos-3.18.2_1
        gfbgraph-0.2.3
        gnome-calculator-3.18.3
        gnome-clocks-3.18.0
        gnome-color-manager-3.18.0_1
        gnome-dictionary-3.18.1
        gnome-documents-3.18.2
        gnome-font-viewer-3.16.2
        gnome-maps-3.18.4
        gnome-screenshot-3.18.0
        gnome-search-tool-3.6.0_1
        gnome-system-log-3.9.90_1
        gnome-themes-2.32.1_1
        gnome-tweak-tool-3.18.1
        gnome-weather-3.18.1
        gnote-3.18.1_1
        grilo-plugins-0.2.17
        ini_file_manager-03_2
        itstool-2.0.2_1
        libclc-0.2.0.20151006
        libmapi-2.3_2
        libopenraw-0.1.0
        libzapojit-0.0.3_2
        libzrtpcppcore-4.6.4
        llvm36-3.6.2_2
        ninja-1.7.2,2
        orca-3.18.2
        p5-MIME-Base32-1.301
        p5-MIME-Base64-3.15
        p5-Unicode-Map8-0.13_1
        p5-Unicode-String-2.10
        py27-sphinx-1.4.8
        py27-Jinja2-2.8
        py27-MarkupSafe-0.23
        samba42-4.2.14
        py27-dnspython-1.15.0
        py27-docutils-0.13.1
        py27-imagesize-0.7.1
        py27-pygments-2.1.3
        py27-setuptools_scm-1.13.1
        py34-atspi-2.18.0
        py34-dbus-1.2.0_1
        recode-3.6_13
        swig13-1.3.40_1
        tex-libtexlua-5.2.4
        tex-libtexluajit-2.0.3
        texinfo-6.1.20160425,1
        unoconv-0.6
        yelp-tools-3.18.0

Number of packages to be removed: 63

The operation will free 941 MiB.

Proceed with deinstalling packages? [y/N]: n

If it ins't tragic, it will makes me laugh. I do use daily all those programs (Gnome 3 is my preferred environment and it is perfectly setup on that machine): that evil command want autoremove this program for me.

I experimented a bit with pkg in this last days and I found so much glitch and problems I can say it should just stick with his main goal: to install and remove packages on request.

Do you have different opinion and if yes, how you can justify pkg suggesting me to kill my perfectly working system autoremoving my daily use software?
 
Autoremove means it removes packages you didn't specifically install and aren't required by packages you did specifically install.
AFAIK it works fine and reliably, which leads to the conclusion that you way you installed the packages is suspect. (or perhaps you removed other packages incorrectly and left a bunch of orphans)
 
Autoremove is working exactly as intended, it removes packages that are not dependended on by any other installed packaged and were initially installed as automatic dependencies. If you remove a top level metaport, for example x11/xorg, all of the dependencies of x11/xorg will become candidates for autoremove because you most likely didn't originally install anything else but x11/xorg directly and all of its dependencies were pulled in as automatic dependencies.
 
You can use pkg-set(8) to disable the automatic flag per package or for all packages (exclude them from autoremove): pkg set -A 0 package or for all packages pkg set -A 0 -a (not sure why you'd want to do that though)

Before you ever even consider doing that, you should look at the output of pkg leaf, which will list all ports/packages you have explicitly installed. If something is missing---say, x11/gnome3 or x11/gnome3-lite---then chances are you deleted it, which would be why those essential GNOME packages are listed to be removed.
 
Nevermind. I see it probably migrated from the old pkg system as pkg_cutleaves

I also see that Portmaster uses a "leaf ports" category.
 
Autoremove means it removes packages you didn't specifically install and aren't required by packages you did specifically install.
AFAIK it works fine and reliably, which leads to the conclusion that you way you installed the packages is suspect. (or perhaps you removed other packages incorrectly and left a bunch of orphans)
I didn't installed Gnome meta-port becouse I do personalize my system and I just install needed ports, then it is not a good reason for a serious package manager to call my perfectly customnized Gnome 3 as leftovers.

And what about Clang? It works perfectly fine and that kinky package manager call it a leftover, I need it to build some stuff, and Samba (?!?!?!?) how can it call it leftover if it is constantly used and in charge of file sharing on that machine?

Come on, pkg, in this case of autoremove, it is totally unreliable.
 
....you should look at the output of pkg leaf

Thanks for that. I've been using portmaster -L as it lists all the ports installed on the machine and also tells which ports are leaf, root, trunk, etc. Use -l flag to list without checking to see if any have upgrades available, or use -L flag to see list and check for upgrades available.
 
And what about Clang? It works perfectly fine and that kinky package manager call it a leftover, I need it to build some stuff, and Samba (?!?!?!?) how can it call it leftover if it is constantly used and in charge of file sharing on that machine?
It's the wrong kind of expectation. You're expecting the package system to know what you use, it doesn't. No package manager ever does, not with yum, not with apt, or any other Linux package manager. All it sees are dependencies. Apparently some time in the past you installed something that depended on Clang and/or Samba and it pulled those in automatically. This package has since been removed but because Clang (or Samba) was installed as a dependency and there's nothing else depending on it it's scheduled to be removed. All perfectly normal and expected.

Either set those packages to non-automatic or install them explicitly (which automatically sets them as non-auto).
 
It's the wrong kind of expectation. You're expecting the package system to know what you use, it doesn't. No package manager ever does, not with yum, not with apt, or any other Linux package manager. All it sees are dependencies. Apparently some time in the past you installed something that depended on Clang and/or Samba and it pulled those in automatically. This package has since been removed but because Clang (or Samba) was installed as a dependency and there's nothing else depending on it it's scheduled to be removed. All perfectly normal and expected.

Either set those packages to non-automatic or install them explicitly (which automatically sets them as non-auto).
For me, and for any normal mind, I do expect pkg autoremove act like emerge depclean act in Linux Gentoo: it analize my system and it say which packages are broken, outdated, not maintained, in a term useless for the system. pkg autoremove can't, simply can't ask me to remove vital part of the ports compilation just becouse it think they were dependencies to another removed port or just becouse there is no meta port installed (in the case of Gnome 3 in my system).

And BTW, that machine is over five years old, constantly updated and upgraded and I'm sure Samba - for example - was installed DIRECTLY from ports long time ago and related with Clang, in the same machine reside my fav browser, Chromium, and Clang is needed to built Chromium. So why you want to remove it?

There is no perfect software, then pkg autoremove proved to be totally unreliable, my two cents.
 
For me, and for any normal mind, I do expect pkg autoremove act like emerge depclean act in Linux Gentoo: it analize my system and it say which packages are broken, outdated, not maintained, in a term useless for the system.
This is the crux of the problem. You're expecting something that simply isn't there. You need to adjust your expectations.
 
This is the crux of the problem. You're expecting something that simply isn't there. You need to adjust your expectations.
Or they need to change the name of the functio with something that explain it better.

Here another ridicolous listing from another machine, built by me, the one with outdated gcc. Pretty similar, it still think Gnome, Samba (?!?!?!?!?!) is to autoremoved and tex* too, I doo deeply use tex* LOL And so on... and the broken gcc was not on the listing :p

Code:
% sudo pkg autoremove
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 63 packages:

Installed packages to be REMOVED:
        docbook2X-0.8.8_4
        OpenSP-1.5.2_3
        accerciser-3.14.0_1
        adacurses-20150808_4
        gnome-utils-3.18.0,1
        baobab-3.18.1
        clang36-3.6.2
        gnome-contacts-3.18.0_3
        enca-1.19
        enscript-a4-1.6.6_2
        eog-plugins-3.16.3
        evolution-mapi-3.18.4
        gcc6-aux-20160822
        gegl-0.2.0_19
        gnome-photos-3.18.2_1
        gfbgraph-0.2.3
        gnome-calculator-3.18.3
        gnome-clocks-3.18.0
        gnome-color-manager-3.18.0_1
        gnome-dictionary-3.18.1
        gnome-documents-3.18.2
        gnome-font-viewer-3.16.2
        gnome-maps-3.18.4
        gnome-screenshot-3.18.0
        gnome-search-tool-3.6.0_1
        gnome-system-log-3.9.90_1
        gnome-themes-2.32.1_1
        gnome-tweak-tool-3.18.1
        gnome-weather-3.18.1
        gnote-3.18.1_1
        grilo-plugins-0.2.17
        ini_file_manager-03_2
        itstool-2.0.2_1
        libclc-0.2.0.20151006
        libmapi-2.3_2
        libopenraw-0.1.0
        libzapojit-0.0.3_2
        libzrtpcppcore-4.6.4
        llvm36-3.6.2_2
        ninja-1.7.2,2
        orca-3.18.2
        p5-MIME-Base32-1.301
        p5-MIME-Base64-3.15
        p5-Unicode-Map8-0.13_1
        p5-Unicode-String-2.10
        py27-sphinx-1.4.8
        py27-Jinja2-2.8
        py27-MarkupSafe-0.23
        samba42-4.2.14
        py27-dnspython-1.15.0
        py27-docutils-0.13.1
        py27-imagesize-0.7.1
        py27-pygments-2.1.3
        py27-setuptools_scm-1.13.1
        py34-atspi-2.18.0
        py34-dbus-1.2.0_1
        recode-3.6_13
        swig13-1.3.40_1
        tex-libtexlua-5.2.4
        tex-libtexluajit-2.0.3
        texinfo-6.1.20160425,1
        unoconv-0.6
        yelp-tools-3.18.0

Number of packages to be removed: 63

The operation will free 941 MiB.

Proceed with deinstalling packages? [y/N]:

Hahahahahahaha :)
 
I do expect pkg autoremove act like emerge depclean act in Linux Gentoo: it analize my system and it say which packages are broken, outdated, not maintained, in a term useless for the system.
Actually, I just checked the man pages and it works exactly the same way as pkg(8) on FreeBSD. It doesn't know what you're using and if something was installed as a dependency and nothing depends on it anymore a depclean will simply remove the package.
 
Actually, I just checked the man pages and it works exactly the same way as pkg(8) on FreeBSD. It doesn't know what you're using and if something was installed as a dependency and nothing depends on it anymore a depclean will simply remove the package.
Yes, then it will never ever ask for Gnome remove if just there is no meta port installed. And it will never ever ask for samba remove if it is safe and in use.

Maybe the difference is Emerge works and pkg don't?

And, again, it as revdep-rebuild to eventually fix operator and software mistakes when running depclean. A big difference.
 
I can confirm that some problem exists related to pkg autoremove, on my system it want to remove firefox and thunderbird among others, and those two are not installed as dependency of anything.

However, resetting the flags solve the problem for me, yet I think some other tool (possibly used to install from ports) may be behind this type of issue, which in my case remain to be investigated.
Code:
pkg set -A 0 thunderbird
pkg set -A 0 firefox
 
then pkg autoremove proved to be totally unreliable
I am really interested in that proof. Could you give me the test case showing that a package that is not installed as a dependency is removed by the pkg autoremove command.
 
Proved becouse I can remember I installed the port "directly". Then if you know a command that show how and when a port was installed, please tell it to me and I will execute that command for you.
 
I am really interested in that proof. Could you give me the test case showing that a package that is not installed as a dependency is removed by the pkg autoremove command.

Are you aware on any package/port that could pull in firefox or thunderbird as dependencies ?

So is you system a mix of ports that you have built and packages? In which case there is your problem, I think.

Care to explain why that would be a problem ?
(considering that the documentation state that installing from port is equivalent to installing from package repository).
 
Just a question,

So is you system a mix of ports that you have built and packages? In which case there is your problem, I think.
Absolutely DON'T! I avoid that type of hybrid systems. All my systems are built from ports! Also because, well, I never been too deep with this, then pkg seems unable to cope with personalized ports built packages, if you install a pkg on a port built system it will reset all your default, like reinstalling 600 packages with different defaults just to install a single package. This is so dumb too. Then as I said I never been too deep in this subject because I do build all my system using ports because I want a need personalized software and settings.
 
And it will never ever ask for samba remove if it is safe and in use.
Actually, it will.

Suppose, you install packageA and packageB is installed as a dependency of packageA. If you later on remove packageA both pkg-autoremove(8) and emerge --depclean will remove packageB. It doesn't know you depend on packageB, all it sees is a relation between packageA and packageB. And because packageA was removed there's no use for packageB any more.
 
Are you aware on any package/port that could pull in firefox or thunderbird as dependencies ?
I posted just after you and your post was not visible to me at that time. For www/firefox, there is only www/firefox-i18n. For mail/thunderbird, there are mail/thunderbird-dictionaries and mail/thunderbird-i18n. Otherwise, I have no clue why those packages have been set to automaticaly installed in your case.

Then, to be fair, since these two packages were set as automatically installed, then pkg autoremove worked as expected and the problem lies somewhere else. If pkg autoremove wanted to remove packages that were set as non-automatically installed, then it would be proven to be unreliable.
 
  • Thanks
Reactions: ASX
if you install a pkg on a port built system it will reset all your default, like reinstalling 600 packages with different defaults just to install a single package. This is so dumb too.
Obviously you have no idea regarding dependencies and options. No surprise here, after all you managed to break 20 machines during freebsd-update in another thread.
 
Status
Not open for further replies.
Back
Top