pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to remove pkgsrc orphan dependencies?



On 19 June 2014 21:01, Greg Troxel <gdt%ir.bbn.com@localhost> wrote:
>
> Ottavio Caruso <ottavio2006-usenet2012%yahoo.com@localhost> writes:
>
>> My system has grown to be a mix-and-match of binary packages installed
>> with pkgin and other packages compiled natively from pkgsrc.
>>
>> I have then removed some of the latter packages but I have Gbytes of
>> unused orphan packages.
>>
>> I know that "pkgin autoremove" can remove orphan packages but that
>> doesn't take in consideration compiled packages.
>>
>> I could force pkgin to "keep" some packages, but thay are really too many.
>>
>> Is there a native way to achieve this goal?
>>
>> How do you guys manage a system that grows a bit too big, without
>> sacrificing essential dependencies?
>
> As I understand it, pkgin's notion of "keepable" is exactly the same as
> a package not having automatic=YES.    The packages that you manually
> built should not have automatic=YES set.   So you should be able to
> "pkgin -n ar" and see what it wants to remove.
>
> The following will make 4 files, separating packages into
> automatic/manual and required/notrequired.   Then you can adjust
> automatic.
>
> I use this to remove automatic-notrequired, but pkgin ar is better
> because it does it all in one step instead of having to redo it.
>
>
> rm -f PKG.automatic-required PKG.automatic-notrequired \
>     PKG.manual-required PKG.manual-notrequired
> for d in `cd /var/db/pkg && ls`; do
>     D=/var/db/pkg/$d
>     DREQ=$D/+REQUIRED_BY
>     DINS=$D/+INSTALLED_INFO
>     REQ=notrequired
>     AUTO=manual
>     if [ ! -d $D ]; then
>         continue;
>     fi
>     if [ -s $DREQ ]; then
>         REQ=required
>     fi
>     if [ -f $DINS ] && egrep 'automatic=(yes|YES)' $DINS > /dev/null; then
>         AUTO=automatic
>     fi
>     echo $d >> PKG.$AUTO-$REQ
> done

This scripts gives me 46 packages to remove instead of 103, as
suggested by pkgin ar, so this is a bit of an improvement.

However I'll probably stick to the solution you proposed in an earlier thread:
http://mail-index.netbsd.org/pkgsrc-users/2014/05/20/msg019708.html

that is, creating a local summary file for pkgin.conf.

I guess I'll have to suspend and readdress this issue to when we have
the new stable release.

-- 
Ottavio


Home | Main Index | Thread Index | Old Index