You are not logged in.

#1 2021-03-30 11:47:26

Salkay
Member
Registered: 2014-05-22
Posts: 498

[SOLVED]Find non-explicitly installed packages depending on each other

I know that I can remove "real orphans - packages that were installed as dependencies but are no longer required by any installed package" (man pacman), e.g. with

# pacman -Rns $(pacman -Qdttq)

However, a recent dependency cycle made me realise that sometimes there are packages installed that only depend on each other.

# pacman -Syu
...
:: Replace python2-twisted with extra/python-twisted? [Y/n] 
resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing python2-twisted breaks dependency 'python2-twisted' required by python2-incremental
error installing repo packages
# pacman -Qi python2-twisted
...
Required By     : python2-incremental
...
Install Reason  : Installed as a dependency for another package
...
# pacman -Qi python2-incremental
...
Required By     : python2-twisted
...
Install Reason  : Installed as a dependency for another package

I would consider these two "orphan" packages in an informal sense, but they don't get caught by -Qdtt as they don't technically fit the case. Is it possible to find these kinds of packages?

Last edited by Salkay (2021-03-30 21:51:24)

Offline

#2 2021-03-30 11:52:02

Awebb
Member
Registered: 2010-05-06
Posts: 5,805

Re: [SOLVED]Find non-explicitly installed packages depending on each other

Are you sure you understand, what a -tt does as opposed to just -t? That's where I'd start.

Offline

#3 2021-03-30 11:59:09

Salkay
Member
Registered: 2014-05-22
Posts: 498

Re: [SOLVED]Find non-explicitly installed packages depending on each other

I think so? -tt lists packages installed as dependencies that are "no longer required", including packages that are installed as only optdepends.

Offline

#4 2021-03-30 12:32:47

Awebb
Member
Registered: 2010-05-06
Posts: 5,805

Re: [SOLVED]Find non-explicitly installed packages depending on each other

Okay, you are aware, that -Qdtt will also give you packages that are still an optional dependency of an installed package and uninstalling them all will uninstall all optional dependencies, even those that are not orphaned? I don't know where this "real orphans" comes form, but -Qqdtt purges more than "real orphans". I now understand that this has not much to do with your actual issue, I'm just puzzled about this "real orphans" business, as -tt also catches those orphans who have already found a foster family, in a matter of speaking.

You've run into an example of a cyclic dependency. This shouldn't happen and I wouldn't even opposed to asking the maintainer politely why this is even a thing. Without the whole pacman output, I'm not sure I know why this happens. Pacman is usually relatively good at detecting cyclic dependencies and sorts itself out.

Offline

#5 2021-03-30 17:21:51

apg
Developer
Registered: 2012-11-10
Posts: 202

Re: [SOLVED]Find non-explicitly installed packages depending on each other

pacreport

Offline

#6 2021-03-30 21:50:58

Salkay
Member
Registered: 2014-05-22
Posts: 498

Re: [SOLVED]Find non-explicitly installed packages depending on each other

Awebb wrote:

You've run into an example of a cyclic dependency. This shouldn't happen and I wouldn't even opposed to asking the maintainer politely why this is even a thing.

I think it's been fixed now, so it seems moot.

Awebb wrote:

Without the whole pacman output, I'm not sure I know why this happens.

I'm not sure which whole pacman output you are referring too, but here is the full output of the commands I quoted earlier. Looks like there were two different packagers that might have been at odds to each other. Although to me, a cyclic dependency could make sense in theory.

$ sudo pacman -Syu
:: Synchronizing package databases...
 core                              131.3 KiB  12.8 MiB/s 00:00 [##################################] 100%
 extra                            1623.9 KiB  29.9 MiB/s 00:00 [##################################] 100%
 community                           5.5 MiB  39.9 MiB/s 00:00 [##################################] 100%
 multilib                          148.9 KiB  48.5 MiB/s 00:00 [##################################] 100%
:: Starting full system upgrade...
:: Replace python2-twisted with extra/python-twisted? [Y/n] 
resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing python2-twisted breaks dependency 'python2-twisted' required by python2-incremental
error installing repo packages
$ pacman -Qi python2-twisted
Name            : python2-twisted
Version         : 20.3.0-3
Description     : Asynchronous networking framework written in Python
Architecture    : x86_64
URL             : https://twistedmatrix.com/
Licenses        : MIT
Groups          : None
Provides        : None
Depends On      : python2-zope-interface  python2-incremental  python2-constantly  python2-automat
                  python2-hyperlink  python2-attrs  python2-pyhamcrest
Optional Deps   : python2-pyopenssl: for TLS client hostname verification
                  python2-service-identity: for TLS client hostname verification
                  python2-idna: for TLS client hostname verification [installed]
                  python2-cryptography: for using conch
                  python2-pyasn1: for using conch
                  python2-appdirs: for using conch
                  python2-bcrypt: for using conch
                  python2-priority: for http2 support
                  python2-pyserial: for serial support
                  python2-soappy: for twisted.web.soap
                  tk: for using tkconch
Required By     : python2-incremental
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 39.69 MiB
Packager        : Evangelos Foutras <foutrelis@archlinux.org>
Build Date      : Wed 11 Nov 2020 17:52:56
Install Date    : Wed 02 Dec 2020 16:42:38
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature
$ pacman -Qi python2-incremental
Name            : python2-incremental
Version         : 17.5.0-6
Description     : A small library that versions your Python projects
Architecture    : any
URL             : https://github.com/hawkowl/incremental
Licenses        : MIT
Groups          : None
Provides        : None
Depends On      : python2-click  python2-twisted
Optional Deps   : None
Required By     : python2-twisted
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 179.27 KiB
Packager        : Felix Yan <felixonmars@archlinux.org>
Build Date      : Wed 11 Nov 2020 17:51:32
Install Date    : Wed 02 Dec 2020 16:42:38
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature
Awebb wrote:

Pacman is usually relatively good at detecting cyclic dependencies and sorts itself out.

It doesn't seem to detect these cyclic dependencies at all. To test, I installed a few test packages and pacman knew nothing about them.

pkgname=pkg1
pkgver=1
pkgrel=1
pkgdesc='this is pkg1'
arch=('any')
depends=('pkg2')

package() {
  true
}

and

pkgname=pkg2
pkgver=1
pkgrel=1
pkgdesc='this is pkg2'
arch=('any')
depends=('pkg1')

package() {
  true
}
apg wrote:
pacreport

Perfect! This does the job excellently! Thank you!

$ pacreport
...
Unneeded Packages In A Dependency Cycle:
  pkg1	  0.00 B - this is pkg1
  pkg2	  0.00 B - this is pkg2
...

Offline

Board footer

Powered by FluxBB