Hi, I'd like to know if this is a bad design or not: ========DNF======= $dnf update clang* RPM Fusion for Fedora Rawhide - Nonfree 2.1 kB/s | 171 kB 01:19 google-chrome 11 kB/s | 3.7 kB 00:00 RPM Fusion for Fedora Rawhide - Free 149 kB/s | 479 kB 00:03 Rawhide kernels built without debugging turned on 119 kB/s | 504 kB 00:04 Fedora - Rawhide - Developmental packages for the next Fedora release 204 kB/s | 38 MB 03:11 Dependencies resolved. ============================================================================================================================================================= Package Arch Version Repository Size ============================================================================================================================================================= Upgrading: clang i686 3.5.0-6.fc22 rawhide 14 M Transaction Summary ============================================================================================================================================================= Upgrade 1 Package Total download size: 14 M Is this ok [y/N]: y Downloading Packages: clang-3.5.0-6.fc22.i686.rpm 137 kB/s | 14 MB 01:41 ------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 132 kB/s | 14 MB 01:46 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Failed to obtain the transaction lock (logged in as: xxxxxx). ========END======= yum never let normal users do transactions even there are no upgrades/updates or just downloading. ========YUM======= $ yum update Loaded plugins: auto-update-debuginfo, fastestmirror You need to be root to perform this command. ========END======= I for real don't like the philosophy behind since I'm under a limited bandwidth mobile network sometimes, rawhide metadata refresh will cost me ~50MB, if I do update everyday, it's not a small size anymore. But that's not the worst, I just entered dnf update without checking the user I was under, then I found a normal user was used, now I've switched to root but it will download the same file again, it's annoying, this is the key point of this bug. Is there a way to reuse those cache?(I've enabled keepcache=true in dnf.conf) Since normal user's content is worthless, I hope dnf will have the same behavior like yum(notify users are normal or reuse cache downloaded if keepcache is true)
Sharing cache is not easy task. We know about it and we plan to extend it to sharing the cache between PackageKit/yum/dnf. tip: install dnf-plugins-core (noroot plugin) to avoid fetching metadata for root operation - it will abort at the start. *** This bug has been marked as a duplicate of bug 1185741 ***
*** Bug 1211166 has been marked as a duplicate of this bug. ***
(In reply to Jan Silhan from comment #1) > Sharing cache is not easy task. We know about it and we plan to extend it to > sharing the cache between PackageKit/yum/dnf. Sharing metadata between users seems relatively simple to me (sharing with PK is another story): check if global (owned by root) metadata exists. If it exists, use it. If not, go to the slow path of downloading the metadata for the user only. You could also add a lock file so that if root is refreshing the metadata to prevent race conditions. What am I missing? is there some complexity here I didn't think about? > > tip: install dnf-plugins-core (noroot plugin) to avoid fetching metadata for > root operation - it will abort at the start. > This is not helpful when you want to do non privileged operations such as search.
(In reply to Elad Alfassa from comment #3) > (In reply to Jan Silhan from comment #1) > > Sharing cache is not easy task. We know about it and we plan to extend it to > > sharing the cache between PackageKit/yum/dnf. > > Sharing metadata between users seems relatively simple to me (sharing with > PK is another story): check if global (owned by root) metadata exists. If it > exists, use it. If not, go to the slow path of downloading the metadata for > the user only. > You could also add a lock file so that if root is refreshing the metadata to > prevent race conditions. > > What am I missing? is there some complexity here I didn't think about? I agree with you (that's the reason why I've marked you bug as a duplicate of this bug and of the bug referenced here). On the other hand, AFAIK there is already a plan to implement the cache sharing service and if it's true, it's probably better for DNF (and consequently for its users) to wait for it and not complicate its code base just for the meantime. > > > > tip: install dnf-plugins-core (noroot plugin) to avoid fetching metadata for > > root operation - it will abort at the start. > > > > This is not helpful when you want to do non privileged operations such as > search. This should be helpful for the original reporter because he run "dnf upgrade", the command downloaded the metadata and only then he got the message that the command cannot continue without the needed privileges. With the plugin, the command would fail immediately and thus it wouldn't download the unneeded amount of data. The tip is not a solution nor a workaround for this problem. It could have just save the bandwidth in the given situation.
*** Bug 1255278 has been marked as a duplicate of this bug. ***