Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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
    if [ "$(cat list2.txt | grep -i $line)" = "" ]; then
        echo "$line"

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

share|improve this answer

The option pa is probably more appropriate:

zypper pa -i

lists all the installed packages and their available versions and repositories. You can choose to list only the packages belonging to a certain repository with the -r flag:

zypper pa -i -r openSUSE-12.1

from there on you can use the strategies proposed by @ernestopheles to find the ones matching your needs.

share|improve this answer

Your Answer


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.