Ask / Submit
7

Clean out orphaned packages

asked 2014-12-17 08:45:20 +0200

blabber gravatar image

updated 2014-12-17 15:46:43 +0200

dulog gravatar image

Toying around with apps from openrepos pulls in different packages as dependencies. When uninstalling an app only the app and not the orphaned dependencies are removed.

Is there a way to get rid of dangling orphaned dependencies?

edit retag flag offensive close delete

Comments

The question is: is it safe? I mean.. An OS that uses dependencies for apps to work, maybe have commond dependencies. The solution for safety (but not for space) is MacOS

palikao ( 2016-12-13 11:16:46 +0200 )edit

3 Answers

Sort by » oldest newest most voted
2

answered 2014-12-18 10:52:33 +0200

blabber gravatar image

updated 2014-12-18 17:17:49 +0200

Following magullos hint I created following script, that prints all installed packages with their corresponding repository (zypper has to be installed).

#! /bin/sh
pkcon get-packages \
    | awk '/^Install/ { print $2 }' \
    | while read PACKAGE; do
            REPO=`zypper wp "$PACKAGE" \
                    | awk 'BEGIN{FS="|"} /^i/{print $6}'`
            printf '%s\t%s\n' "$PACKAGE" "$REPO"
      done

Filtering further you can at least get all packages installed from openrepos:

sh script.sh | awk '$2 ~ "^openrepos" {print $0}'
edit flag offensive delete publish link more
1

answered 2014-12-17 10:44:23 +0200

I think is not so easy, I've already asked something similar in the past, but could not get a real answer. Here's my suggestion: - install zypper, it's the only way you can get info on packages origin (pkcon doesn't provide this info) (http://talk.maemo.org/showpost.php?p=1430997&postcount=4) - with a full list of installed packages, you could do something like (never tried):

pkcon get-packages | grep ^Installed | zypper what-provides

It should show installed packages and their info. You should be able to remove unwanted packages from here.

edit flag offensive delete publish link more

Comments

You should put this as an answer, very good job! Thanks!

magullo ( 2014-12-18 15:44:59 +0200 )edit

Done. Thanks for the hint ;)

blabber ( 2014-12-18 17:18:40 +0200 )edit

Doesn't work (PackageKit blocks zypper).

V10lator ( 2015-09-30 16:39:47 +0200 )edit

Probably related to new enforcing policies. Which SO version are you using?

magullo ( 2015-09-30 16:55:04 +0200 )edit

1.1.9.28 ...

V10lator ( 2015-09-30 16:57:10 +0200 )edit
0

answered 2016-12-12 16:04:57 +0200

ghling gravatar image

You can do it the manual way by listing all packages that were installed as dependency and then removing each one by hand:

First, list the packages, that were recently installed with:

rpm -qa --last | head

This lists the last 10 packages, which may include those that are installed when you enable developer mode. In this case, just omit "| head", so the command ist: rpm -qa --last

Now, you should (hopefully) find all packages that were installed at the same time with the package you want to remove. Remove them with

pkcon remove <packages (without version number)>
edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
7 followers

Stats

Asked: 2014-12-17 08:45:20 +0200

Seen: 1,456 times

Last updated: Dec 12 '16