Results 1 to 4 of 4

Thread: How to remove orphan packages in OpenSUSE

  1. #1
    Join Date
    Oct 2011
    Location
    Italy
    Posts
    28

    Question How to remove orphan packages in OpenSUSE

    Hi everyone,
    I'd like to know if there is a way to remove all unneeded dependencies on OpenSUSE (11.4 in my case, but a general solution would be nice).

    I have read (here) that some option can be used when removing a package so that all its dependencies (i hope just the one not needed by others) are removed.
    Do you suggest not to modify that line in zypper.conf? Can it be unsafe?
    And also, is there a way to do it on demand? Like on Debian/Ubuntu you can do with apt-get autoremove.

    I have tried rpmorphan, but it removed too many packages, also some that were manually installed by me, and screwed my system; epic fail.

    Suggestions?

    Thanks in advance!

  2. #2
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How to remove orphan packages in OpenSUSE

    On 2011-11-09 10:56, frasmog wrote:

    > I have read ('here' (http://tinyurl.com/bnz4b2r)) that some option can
    > be used when removing a package so that all its dependencies (i hope
    > just the one not needed by others) are removed.
    > Do you suggest not to modify that line in zypper.conf? Can it be
    > unsafe?


    Little tested, I believe.

    > And also, is there a way to do it -on demand-? Like on Debian/Ubuntu
    > you can do with -apt-get autoremove-.


    Not that I know.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  3. #3
    Join Date
    Oct 2008
    Location
    near Munich
    Posts
    507

    Default Re: How to remove orphan packages in OpenSUSE

    I've written a small Perl script that prints you a list of packages that
    COULD be removed:

    -------
    #!/usr/bin/perl

    use strict;

    my @out;

    open(RPM, "rpm -qa |");
    my @rpm = <RPM>;
    close RPM;

    foreach my $rpm (@rpm)
    {
    chomp($rpm);
    open(RPM, "rpm -e --test $rpm 2>&1 |");
    my @ret = <RPM>;
    close RPM;

    push(@out, "$rpm\n") if ($#ret <= 0);
    }

    @out = sort @out;
    print @out;
    --------


    It shows you all packages that are not installed because of any
    dependencies.

    You don't want to remove all of them, but any orphan packages should be in
    this list.

  4. #4

    Default Re: How to remove orphan packages in OpenSUSE

    Fruchtratte wrote:
    > I've written a small Perl script that prints you a list of packages that
    > COULD be removed:


    That's a nice little program

    For the benefit of anybody picking up style tips it would be good to add

    use warnings;

    after use strict;

    Cheers, Dave

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •