Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In a system using Zypper for package management (openSuse, in my case) how can one get a list of all installed packages that are not associated with a currently enabled repository?

Real problem: When upgrading distributions (e.g., from openSuse 12.1 to 12.2), I disable all non-standard repositories that I've enabled. Often, I only added them to get a new version of a particular tool, but that newer version is included by default in the updated distribution. Sometimes though, additional packages were installed from the repository, but I don't know how to detect those. The system works, but those packages will never be updated since I removed the providing repository after the upgrade.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

It is a bit about messing around with zypper inquiries.

1) Find installed packages, which come from non-opensuse-distribution-repositories:

zypper search -s | grep "i |" | grep -vi "| patch" | grep -vi "| opensuse" > list1.txt

2) Find packages, which are available from opensuse repositories (no matter whether they are installed or not):

zypper search -s | grep "v |" | grep -vi "| patch" | grep -i "| opensuse" > list2.txt

3) Identify packages from list1, which are not represented in list2:

cat list1.txt | cut -d " " -f3 | cut -d " " -f1 | while read line
do
    if [ "$(cat list2.txt | grep -i $line)" = "" ]; then
        echo "$line"
    fi
done

This should kind of solve the case (tested on openSUSE 11.3).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.