public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* How to uninstall packages that were installed as dependency but are no longer required
@ 2021-03-30  5:51 Yasuhiro Kimura
  2021-03-30  8:07 ` Marco Atzeri
  0 siblings, 1 reply; 6+ messages in thread
From: Yasuhiro Kimura @ 2021-03-30  5:51 UTC (permalink / raw)
  To: cygwin

Hello,

If you repeat the update of installed Cygwin packages for a while,
it's quite possible that there are some packages that were installed
as dependency but are no longer required by any others.

Then is there any way to detect and uninstall such ones?

I expect such way as `apt autoremove` of Debian or `dnf autoremove` of
Fedora.

Best Regards.

---
Yasuhiro Kimura

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to uninstall packages that were installed as dependency but are no longer required
  2021-03-30  5:51 How to uninstall packages that were installed as dependency but are no longer required Yasuhiro Kimura
@ 2021-03-30  8:07 ` Marco Atzeri
  2021-03-30  9:46   ` Yasuhiro Kimura
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Marco Atzeri @ 2021-03-30  8:07 UTC (permalink / raw)
  To: cygwin

On 30.03.2021 07:51, Yasuhiro Kimura wrote:
> Hello,
> 
> If you repeat the update of installed Cygwin packages for a while,
> it's quite possible that there are some packages that were installed
> as dependency but are no longer required by any others.
> 
> Then is there any way to detect and uninstall such ones?
> 
> I expect such way as `apt autoremove` of Debian or `dnf autoremove` of
> Fedora.
> 
> Best Regards.
> 
> ---
> Yasuhiro Kimura

as currently we are not tracking between choosen packages
and installed by dependency, Cygwin is lacking such capabilities

the most likely candidates for removal are the different version
of the same libraries

$ cygcheck -cd | grep "^lib" | tee lib.txt

in my case I see

libvpx1                                 1.3.0-2
libvpx3                                 1.5.0-1
libvpx4                                 1.6.1-1
libvpx5                                 1.7.0-1

$ cygcheck-dep -q -n libvpx1 libvpx3 libvpx4 libvpx5
  libvpx1: is needed for ( )
  libvpx3: is needed for ( )
  libvpx4: is needed for ( )
  libvpx5: is needed for ( gstreamer1.0-plugins-good libvpx-devel )

Regards
Marco


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to uninstall packages that were installed as dependency but are no longer required
  2021-03-30  8:07 ` Marco Atzeri
@ 2021-03-30  9:46   ` Yasuhiro Kimura
  2021-03-30 17:18   ` Brian Inglis
  2021-03-30 17:47   ` Achim Gratz
  2 siblings, 0 replies; 6+ messages in thread
From: Yasuhiro Kimura @ 2021-03-30  9:46 UTC (permalink / raw)
  To: cygwin

From: Marco Atzeri via Cygwin <cygwin@cygwin.com>
Subject: Re: How to uninstall packages that were installed as dependency but are no longer required
Date: Tue, 30 Mar 2021 10:07:04 +0200

> as currently we are not tracking between choosen packages
> and installed by dependency, Cygwin is lacking such capabilities
> 
> the most likely candidates for removal are the different version
> of the same libraries
> 
> $ cygcheck -cd | grep "^lib" | tee lib.txt
> 
> in my case I see
> 
> libvpx1                                 1.3.0-2
> libvpx3                                 1.5.0-1
> libvpx4                                 1.6.1-1
> libvpx5                                 1.7.0-1
> 
> $ cygcheck-dep -q -n libvpx1 libvpx3 libvpx4 libvpx5
>  libvpx1: is needed for ( )
>  libvpx3: is needed for ( )
>  libvpx4: is needed for ( )
>  libvpx5: is needed for ( gstreamer1.0-plugins-good libvpx-devel )
> 
> Regards
> Marco

I didn't know cygcheck-dep package and it seems very helpful to
uninstall unnecessary dependency.

Thanks for letting me know it.

---
Yasuhiro Kimura

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to uninstall packages that were installed as dependency but are no longer required
  2021-03-30  8:07 ` Marco Atzeri
  2021-03-30  9:46   ` Yasuhiro Kimura
@ 2021-03-30 17:18   ` Brian Inglis
  2021-03-30 18:36     ` Marco Atzeri
  2021-03-30 17:47   ` Achim Gratz
  2 siblings, 1 reply; 6+ messages in thread
From: Brian Inglis @ 2021-03-30 17:18 UTC (permalink / raw)
  To: cygwin

On 2021-03-30 02:07, Marco Atzeri via Cygwin wrote:
> On 30.03.2021 07:51, Yasuhiro Kimura wrote:
>> If you repeat the update of installed Cygwin packages for a while,
>> it's quite possible that there are some packages that were installed
>> as dependency but are no longer required by any others.
>>
>> Then is there any way to detect and uninstall such ones?
>>
>> I expect such way as `apt autoremove` of Debian or `dnf autoremove` of
>> Fedora.

> as currently we are not tracking between choosen packages
> and installed by dependency, Cygwin is lacking such capabilities

The undocumented third field in installed.db is automatic dependency 0 / 
manually picked 1:

$ sort -k3 /etc/setup/installed.db | uniq -cf2
          1 INSTALLED.DB 3
       1203 _autorebase _autorebase-001007-1.tar.bz2 0
        467 aalib aalib-1.4rc5-12.tar.bz2 1

> the most likely candidates for removal are the different version
> of the same libraries
> 
> $ cygcheck -cd | grep "^lib" | tee lib.txt
> 
> in my case I see
> 
> libvpx1                                 1.3.0-2
> libvpx3                                 1.5.0-1
> libvpx4                                 1.6.1-1
> libvpx5                                 1.7.0-1
> 
> $ cygcheck-dep -q -n libvpx1 libvpx3 libvpx4 libvpx5
> libvpx1: is needed for ( )
> libvpx3: is needed for ( )
> libvpx4: is needed for ( )
> libvpx5: is needed for ( gstreamer1.0-plugins-good libvpx-devel )

Using the above info you could run a check for automatic dependencies no longer 
needed, but you *MUST* retain and not attempt to deinstall Base packages, plus 
packages automatically installed to replace obsolete packages, which ideally 
would inherit the manually picked flag of the obsolete package.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]







^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to uninstall packages that were installed as dependency but are no longer required
  2021-03-30  8:07 ` Marco Atzeri
  2021-03-30  9:46   ` Yasuhiro Kimura
  2021-03-30 17:18   ` Brian Inglis
@ 2021-03-30 17:47   ` Achim Gratz
  2 siblings, 0 replies; 6+ messages in thread
From: Achim Gratz @ 2021-03-30 17:47 UTC (permalink / raw)
  To: cygwin

Marco Atzeri via Cygwin writes:
> as currently we are not tracking between choosen packages
> and installed by dependency, Cygwin is lacking such capabilities

We do, since this commit in 2016:

https://sourceware.org/git/?p=cygwin-setup.git;a=commitdiff;h=f6d6c600edffdb83a57ed13384e38a504fdc366b

However, it does only work if you pick by package and not by group and
it has not yet been sufficiently tested to invoke auto-removal of such
packages IMHO.  If you're adventurous you could recognitize these
packages as being installed as dependencies (maybe they already are, I
have not checked) and then in libsolv use the SOLVER_CLEANDEPS flag for
the solution so they can get removed if they are no longer part of a
dependency chain that leads to an explicitly installed package.

Setup has two command line options that somewhat deal with this problem,
both of them were implemented before setup gained the capability
mentioned above and none of them do directly what the OP was asking:

The option --delete-orphans / -o removes packages installed on the
system that are no longer available from the repository.

The option --prune-install / -Y will remove _all_ packages except the
ones that are explicitly requested via either --packages / -P or
--categories / -C.  I implemented this to enable up- and downgrading
installations in unattended mode when that includes removal of packages,
but that requires you to know the list of packages that you need to keep
including their dependencies.  I generate a new setup.ini with extra
categories for this purpose (each of the categories contains all
packages including dependencies for each type of install supported).


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to uninstall packages that were installed as dependency but are no longer required
  2021-03-30 17:18   ` Brian Inglis
@ 2021-03-30 18:36     ` Marco Atzeri
  0 siblings, 0 replies; 6+ messages in thread
From: Marco Atzeri @ 2021-03-30 18:36 UTC (permalink / raw)
  To: cygwin

On 30.03.2021 19:18, Brian Inglis wrote:
> On 2021-03-30 02:07, Marco Atzeri via Cygwin wrote:
>> On 30.03.2021 07:51, Yasuhiro Kimura wrote:
>>> If you repeat the update of installed Cygwin packages for a while,
>>> it's quite possible that there are some packages that were installed
>>> as dependency but are no longer required by any others.
>>>
>>> Then is there any way to detect and uninstall such ones?
>>>
>>> I expect such way as `apt autoremove` of Debian or `dnf autoremove` of
>>> Fedora.
> 
>> as currently we are not tracking between choosen packages
>> and installed by dependency, Cygwin is lacking such capabilities
> 
> The undocumented third field in installed.db is automatic dependency 0 / 
> manually picked 1:
> 
> $ sort -k3 /etc/setup/installed.db | uniq -cf2
>           1 INSTALLED.DB 3
>        1203 _autorebase _autorebase-001007-1.tar.bz2 0
>         467 aalib aalib-1.4rc5-12.tar.bz2 1
> 

it really depends on the history of the package,
I have tons of package with "0" that in reality were picked
long time ago.
So it is not 100% trustable on long time installation


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-30 18:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30  5:51 How to uninstall packages that were installed as dependency but are no longer required Yasuhiro Kimura
2021-03-30  8:07 ` Marco Atzeri
2021-03-30  9:46   ` Yasuhiro Kimura
2021-03-30 17:18   ` Brian Inglis
2021-03-30 18:36     ` Marco Atzeri
2021-03-30 17:47   ` Achim Gratz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).