Dependencies of an add-on

How can I build a list of dependencies for a specific add-on.
Same question with a twist: build that list for an add-on that was removed by recent core upgrade: CUPS

My case: after CUPS was removed I noticed that avahi was left behind, and I am pretty sure Avahi was brought in by CUPS.
So now I am trying to build a list of all dependencies that are left behind and remove them.
Something like “apt autoremove/autoclean” will be nice.

I do not see anything like this in pakfire:

 pakfire <install|remove> [options] <pak(s)>
               <update> - Contacts the servers for new lists of paks.
               <upgrade> - Installs the latest version of all paks.
               <list> [installed/notinstalled/upgrade] - Outputs a list with all, installed, available or upgradeable paks.
               <info> <pak> [<pak> ...] - Output pak metadata.
               <status> - Outputs a summary about available core upgrades, updates and a required reboot

       Global options:
               --non-interactive --> Enables the non-interactive mode.
                                     You won't see any question here.
                              -y --> Short for --non-interactive.
                     --no-colors --> Turns off the wonderful colors.

Avahi was a dependency for cups but is also one for samba, mpd, netatalk and shairport-sync.

Maybe it would have been good to add a check in the update.sh script to see if anyone of those addons was installed and if none were, then to also uninstall avahi.

The same question then arises with dbus as that dependency is also used by netattalk and libexif, which is also used by minidlna.

We missed that possibility and nobody flagged it up with the Core Update Testing stage.

A potential problem with doing that automatically with an update would be if a user had installed the avahi addon for their own purposes. There is no way to detect in the current code if that package had been installed deliberately and not as a dependency.

Look in the lfs file for that addon and there will be a line starting with DEPS which will have a list of the dependencies for that addon. If empty there are no dependencies.

You would also need to check the lfs file for each of those dependency addons listed as they might have further dependencies of their own.

The lfs files can be found in the following url link for CU193

https://git.ipfire.org/?p=ipfire-2.x.git;a=tree;f=lfs;h=d4fcbf3e5849d0aa2c46b12b2f9a5d98bae1c3e4;hb=refs/heads/core193

To look for the lfs file as at an earlier CU just modify the core update number at the end of the url link.

No, it does not exist. Not a simple thing to do and not likely to get on the list of any of the developers to do for IPFire-2.x.

Currently no dependencies for an addon are uninstalled when that addon is uninstalled..

When you uninstall an addon, it will show all the dependencies for that addon in the pakfire page. You would need to make a manual list of those, then check in all the installed addon lfs files if any of those dependencies are also dependencies for another addon and only then manually remove the dependency addons not needed by any other program.

However as always any user is welcome to modify the code and submit a patch to the IPFire development mailing list as per the submit patches entry in the documentation.

No samba or any of the add-ons you listed above: so I have manually removed avahi

Thanks: I manually removed dbus because none of those were installed.

That would be a nice feature. I removed by now at least 2 add-ons left behind because I had cups.

Please be a bit more detailed: cups is gone, so where should I search for lfs for cups?

In the link provided above there is no cups :frowning:

I went back to core 189 where cups was available and the links still does not show CUPS:

look: git.ipfire.org Git - ipfire-2.x.git/tree - lfs/

Appreciated

I thought that just changing the CU number in that url link would be sufficient but it isn’t. Other parts of the url are changed also such as the sha hash for that location.

So you need to follow this sequence of steps.

Go to the git repo via

https://git.ipfire.org/?p=ipfire-2.x.git;a=summary

Then in the section labelled heads select the required CU number link. Cups was removed in CU192 so for this case choose core191.

This opens the following

https://git.ipfire.org/?p=ipfire-2.x.git;a=shortlog;h=refs/heads/core191

At the top of that page is a link labelled tree. Click that link which then shows

https://git.ipfire.org/?p=ipfire-2.x.git;a=tree;h=refs/heads/core191;hb=refs/heads/core191

Then click the link labelled lfs and that will give you

https://git.ipfire.org/?p=ipfire-2.x.git;a=tree;f=lfs;h=8fdc5c72881b458aadf4eeefd3e4693d947ccd9e;hb=refs/heads/core191

cups is in that list.

2 Likes

Thanks a lot: I see this line in the blob:

DEPS = avahi cups-filters dbus ghostscript libexif

DO I need to search for each of the DEPS if those have additional DEPS?

Example: I feel that some of these add-on are deps of one of de cups deps:

Name: libdaemon
ProgVersion: 0.14
Release: 1
Installed: yes

Name: libexif
ProgVersion: 0.6.25
Release: 4
Installed: yes

Name: libtalloc
ProgVersion: 2.4.2
Release: 4
Installed: yes

Name: libxxhash
ProgVersion: 0.8.3
Release: 2
Installed: yes

Late edit: I believe I need to check each deps for other deps

Example:

avahi DEPS:

DEPS = dbus libdaemon

I already removed Avahi and DBUS so I need to remove libdaemon as well…

Thanks, I have a process to cleanup my system (the one that had cups and no other add-ons that might had same deps as cups)

That is correct. I mentioned that was needed in my original reply.

You will also need to be sure that none of those other dependencies are being used by anything that you do have installed.

As far as I can see libxxhash is only being used by rsync and has never been used by cups.

libtalloc is used by samba, cifs-utils and freeradius. It was not used by cups or any of its dependencies as far as I can see, although you should make your own checks to be certain.

1 Like

All clear!
And my system is now cleaned.
I confirm I have rsync there so that explain one of the lib* add-ons I have listed.

I also manually installed in the past cif-utils because in the past I wanted to do some automations and needed something from there

In short: your explanation helps me a lot to build a list of DEPS that I can remove after a main package is declared unsuported.

Appreciated your detailed explanation! - I never used GIT :smiley:

1 Like

Hello,

It looks like you already have a solution for this, but just to add that you can also find dependencies for available add-ons from the command line with ‘pakfire resolvedeps’. This doesn’t work for cups since it was removed. You still would have needed @bonnietwin solution for cups dependencies.

‘pakfire resolvedeps’ also finds sub-dependencies as you can see for ‘avahi’ in the example below.

[root@zone3 ~]# pakfire resolvedeps samba
PAKFIRE RESV: samba: Resolving dependencies...
PAKFIRE RESV: samba: Need to install dependency: avahi
PAKFIRE RESV: samba: Need to install dependency: libtalloc
PAKFIRE RESV: samba: Need to install dependency: perl-Parse-Yapp
PAKFIRE RESV: samba: Need to install dependency: wsdd
PAKFIRE RESV: wsdd: Resolving dependencies...
PAKFIRE RESV: perl-Parse-Yapp: Resolving dependencies...
PAKFIRE RESV: libtalloc: Resolving dependencies...
PAKFIRE RESV: avahi: Resolving dependencies...
PAKFIRE RESV: avahi: Need to install dependency: dbus
PAKFIRE RESV: avahi: Need to install dependency: libdaemon
PAKFIRE RESV: libdaemon: Resolving dependencies...
PAKFIRE RESV: dbus: Resolving dependencies...
[root@zone3 ~]# 

Regards,
Stephen

2 Likes

Good day and thank you @stephen
I already used web interface for a list of dependencies after I noticed that pakfire utility shows no option in the --help message for displaying utilities (see first post in this thread)
Apparently the resolvedeps is not included in help, and I thank you for sharing that

Web interface dialogue I have used until you provided the command line parameter:

@bonnietwin Should be “resolvedeps” included in pakfire --help list of commands?
Thanks!

That would probably be a good idea. Could you please raise it as an IPFire bug.

@stephen would you be able to provide a patch submission for this. I already have far too much on my list of things to do.

Done

I’ll do the patch.

Regards,
Stephen

3 Likes

added to Wiki
https://www.ipfire.org/docs/configuration/ipfire/pakfire/pakfireconsole#resolve-dependencies

Also there is a pakfire info <package> command that provides dependencies and other info:
https://www.ipfire.org/docs/configuration/ipfire/pakfire/pakfireconsole#package-information

1 Like