Maybe someday you try zypper dup to actualize your distribution and in middle of process it fail, because you are disconnected or some packages is actualized before you download it (especially on factory this can happen). It is more safety download packages at first and then install from this local files.
How todo this is little tricky, at first you must enable caching downloaded files (I do it only for remote connection):
zypper mr –keep-packages –remote
So now you cache all downloaded files and now try testing run of dup. Trick is that all packages download for that test is cached.
zypper dup –dry-run
Now if you have slow connection I reccomend also disable autorefresh for all repositories, because if repository is refreshed before dup, you can easily find that some packages is newer than package in cache and you must download it.
zypper mr –all –no-refresh
Now is everything prepared for zypper dup, which use files from cache. Cache can take quite lot of disk space, so after dup you can clean it.
zypper clean
And thats all. This features work from OpenSuse 11 and you can also use this trick for zypper update or zypper install.
Both comments and pings are currently closed.
Thanks for this tip! Hope there are more to come!
If you previously used Debian this behaviour of zypper you will call a bug. I wonder why this caching is not the default for dist-upgrades.
Reason is that people complain that it eat to much space. If you do dist-upgrade it take around 2.5 GB, more or less depend on what you have installed…and some people restrict space for root and have all space in home. So default is not caching (also zypp (library under zypper) doesn’t delete old package, this is planned to future).
As a yum user, I also call this a bug (and that’s why there is a feature request about this).
The way that zypper does updates is still centered around users with no network and with a CD in their disk drive.
The size argument isn’t one really, in my experience. I usually have some free disk space on some partition and can create a symlink to where there’s room to cache the packages.
It is just a precondition that packages exist on the system for a dist upgrade – unless you want to risk the system. Anyone who would complain that about needing too much disk space might not be aware of the possible consequences of “saving” this disk space – and I’m sure they would complain even more if the update breaks their system.
At the least, zypper could check for available disk space, and use it if it’s there. If it’s not sufficient, it could still offer to do a one-by-one update, downloading on the fly, after displaying a big fat warning.
Agreed.
I’ve broken my SUSE twice because of interruption of this kind.
This feature is a nice one. Thanks Josef. I still think this should be part of YaST/zypp, if not default, at least with an option.
I think, that feature is planned, but for 11.1 is not enought resource to do it. Maybe for 11.2