zypper: how to list all active package repos?
How can I show all active package repos with zypper
?
I need the output for a check script.
I know how to list them all. But I would like to avoid to parse this output with a regex:
foo-work:~ # LANG=C zypper lr
# | Alias | Name | Enabled | Refresh
--+-----------------------------------+-----------------------------------+---------+--------
1 | openSUSE 12.3 FOO-BAR | openSUSE 12.3 FOO-BAR | Yes | Yes
2 | openSUSE 12.3 FOO-BAR Test | openSUSE 12.3 FOO-BAR Test | Yes | No
3 | openSUSE-12.3 Updates (FOO-BAR) | openSUSE-12.3 Updates (FOO-BAR) | Yes | Yes
4 | openSUSE-12.3-Non-Oss (FOO-BAR) | openSUSE-12.3-Non-Oss (FOO-BAR) | Yes | No
5 | openSUSE-12.3-Oss (FOO-BAR) | openSUSE-12.3-Oss (FOO-BAR) | Yes | No
Are you looking for the -E, --show-enabled-only
flag to only show enabled repositories, or the -e -
, --export -
to get the listing in the repository definition format that allows for much easier parsing?
zypper lr -E -e - |grep name=