zypper cache update

hi everyone

why zypper updates cache everytime when installing a new package?

for example running

zypper in thunderbird

refreshes repositories and i should wait for it to complete. i’m living in iran and we face lot of network issues here specially timeout issue.

please guide me what should i do. sometimes using torsocks helps but now always.

thanks in advance

why zypper updates cache everytime when installing a new package?

see /etc/zypp/zypp.conf

Amount of time in minutes that must pass before another refresh.

Valid values: Integer

Default value: 10

If you have autorefresh enabled for a repository, it is checked for

up-to-date metadata not more often than every <repo.refresh.delay>

minutes. If an automatic request for refresh comes before <repo.refresh.delay>

minutes passed since the last check, the request is ignored.

A value of 0 means the repository will always be checked. To get the opposite

effect, disable autorefresh for your repositories.

This option has no effect for repositories with autorefresh disabled, nor for

user-requested refresh.

repo.refresh.delay = 10

Or disable autorefresh for your Repos and do it only with

zypper ref

I think al lot of what you ask can be found in

man zypper

There is a section “Refresh” which explains when and why refreshing is done. And also point to how to suppress refresh for a repository (that is imho most easily done through YaST > software > Repository Management where you see and can change automatic refreshing for each repo).

You will see there that a refresh is only done when not done already a short time ago. And also that it is only done when the downloading of only a few small files indicates that things have changes since your last refresh. Thus most of the overhead of needless refresh is already taken care of.

Please read that first and then come back with more precise questions if you have them.

thanks for your helps.

FWIW: On an unreliable internet connection I would not even think of running Tumbleweed. The upgrades ( TW releasing over and over again ) can be really big, up to complete rebuilds of the release due to switch to new compiler(option)s f.e.

I think you can use Tumbleweed even on poor internet connections. You need to cache your downloads by using zypper dup --download-only. Repeat that command until your cache is consistent. Only then run zypper dup. Of course you need to provide sufficient disk space.