Bug 1113139 - zypper 'packages' command is slow when listing installed packages
zypper 'packages' command is slow when listing installed packages
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: libzypp
Other Other
: P5 - None : Minor (vote)
: ---
Assigned To: E-mail List
E-mail List
Depends on:
  Show dependency treegraph
Reported: 2018-10-24 15:40 UTC by Markos Chandras
Modified: 2018-10-25 11:15 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Markos Chandras 2018-10-24 15:40:44 UTC
~$ time zypper pa -i

real    0m11.357s
user    0m9.392s
sys     0m0.212s


~$ time zypper --disable-repositories pa -i

real    0m1.061s
user    0m0.837s
sys     0m0.153s

rpm -qa is also faster compared to plain 'zypper pa -i'

It seems that the 'zypper pa' command also performs some repository operations which slows down the overall process. Since we are only interested in the installed packages, perhaps this can be optimized a little bit and not perform unnecessary network or repository operations.
Comment 1 Michael Andres 2018-10-25 09:27:00 UTC
Repository information needs to be loaded in order to determine the repo that provides the package (2nd column).

Per default zypper refreshes the repo information before performing the query.

You can use 'zypper --no-refresh' to avoid updating the repos from remote. The query will then load and use the repo data currently available on the system.

If you don't need the repository info at all, you can use 'zypper --disable-repositories'. This will not even load the local repository data. The repo column will show just `@System` then.

Like we did for the search command, we should default to '--no-refresh' if '-i' is used. That's IMO a good compromise.
Comment 2 Markos Chandras 2018-10-25 11:15:25 UTC
The --no-refresh option is equally slow for me

~$ time zypper --no-refresh pa -i
real    0m9.990s
user    0m9.760s
sys     0m0.163s