[Popcon-developers] Bug#414865: popularity-contest: A script to filter requested/recommended/suggested packages

Carsten Hey carsten at debian.org
Tue May 12 22:16:03 UTC 2009


On Tue, May 12, 2009 at 02:35:57PM +0200, Christophe Lohr wrote:
> But perhaps deborphan and orphaner can do most of the work themselves.
> deborphan is able to manages the dependency better than a grep in a list,
> and orphaner does interaction with the administrator.
>
> So, deborphan and orphaner has to be "modularized" in some way for that.

As said in my other mail, I also think that this should be done this
way.  If you are not interested in writing a wrapper after I implemented
the necessary parts in deborphan I could also implement everything
needed in deborphan and orphaner, which would make this wrapper
needlessly.  I would be happy with both options.

If you prefer the whole use case to be handled by deborphan and orphaner
over a wrapper there is another issue which has to be resolved first:
Some people, especially FSF fellows and fedora consider the Artistic
License 1.0 (deborphan uses this license without the usual "_OR_ GPL2+")
to be non-free.  To prevent future problems I decided to try to
relicense deborphan and orphaner under the conditions of the MIT License
( http://www.opensource.org/licenses/mit-license.php ) and today I got
the last required permission.  Since parts of your code might be helpful
to extend orphaner to interact with popcon I also would need your
permission:

Do you agree to publish the parts of your fork of orphaner where you are the
copyright holder under the conditions of the above-mentioned MIT license?

If you choose not to write the wrapper and agree to the relicensing
I think this bug can be reassigned to deborphan, but I leave this
decision to the maintainers of popularity-contest.

> That's why I'm looking for something that can help my to clean my system.

Until this bug is fixed you could use (requires moreutils to be installed):

    combine <(deborphan -a --no-show-section) and <(popcon-largest-unused | awk '{print $2}')

To get a list of old packages which can not be reinstalled:

    wget http://stateful.de/~carsten/bin/apt-listrepository
    chmod a+x apt-listrepository
    apt-listrepository | grep /var/lib/dpkg/status

To show the size of all installed packages you could use debsize[1],
which requires dctrl-tools to be installed.  If this does not match the
disk usage on your system using du -s * | sort -n recursively might help
to find old cruft.  I guess you already know that apt-get clean cleans
your apt package cache.


Regards
Carsten

[1]
debsize() {
    case $1 in
        -v | --verbose)
            grep-status -nsPackage,Installed-Size -FStatus " installed" \
                | while read package
                do \
                    read size
                    read
                    printf '%6d %-25s\n' "$size" "$package"
                done \
                | sort -rn
            ;;

        -h | --help | -*)
            echo "Usage: debsize [ -v | --verbose | -h | --help ]"
            ;;

        *)
            grep-status -ns Installed-Size -Fstatus " installed" \
                | awk '{i+=$1}END{print i}' \
                | sed 's#\([0-9]\)\([0-9]\{3\}\)$#\1\.\2 kb#' \
                | sed 's#\([0-9]\)\([0-9]\{3\}[.]\)#\1\.\2#'
            ;;
    esac
}





More information about the Popcon-developers mailing list