Red Hat Bugzilla – Bug 1218403
dnf history undo dopesn't work
Last modified: 2015-05-05 09:57:21 EDT
Description of problem:
Transaction can't be undone by dnf.
Version-Release number of selected component (if applicable):
.. and newer
Steps to Reproduce:
# dnf update
# dnf history undo last
No package libcom_err-0:1.42.12-3.fc21.i686 available.
Error: An operation cannot be undone
revert/undone last transaction successfully
# dnf history list | tail
10 | update | 2015-04-20 12:32 | I, U | 74
9 | update | 2015-04-17 08:00 | Update | 3
8 | install python-pytest-pe | 2015-04-15 19:28 | Install | 4
7 | install python?-pytest-p | 2015-04-15 19:21 | Install | 6
6 | install pytest | 2015-04-15 19:20 | Install | 2
5 | install pycharm-communit | 2015-04-15 12:22 | Install | 1
4 | install dnf-plugins-core | 2015-04-15 12:17 | Install | 1
3 | install openscap-engine- | 2015-04-14 17:22 | Install | 3
2 | update | 2015-04-14 16:17 | Update | 63 EE
1 | install openscap | 2015-04-14 16:16 | Install | 1
Problem solved after discussion with jsilhan.
You need set "keepcache=1" inside "/etc/dnf/dnf.conf", because otherwise undo of transaction is always impossible after update, because each older package is removed. That's really unhappy solution, that keepcache isn't set by default.
history undo/redo should work even if "keepcache=0" as long as package is still available in repo. Maybe the problem is somewhere else.
But the package is not available, is it? It's clearly a problem with Fedora infrastructure that it does not keep older versions.
Keepcache is not on by default because it would fill your hard disk sooner or later. Another option is also the community plugin called "local".
older version probably isn't still available in repository and I haven't any previous package stored in cache.
> Keepcache is not on by default because it would fill your hard disk sooner or later.
Could be possible add option (as futurefeature), which restrict count of previous versions of some packages? Something like kept_versions=2 (I don't want think about usable name), which will remember 2 previous installed versions of package? It could solve problem with filling of hard disk during time.
However, IMHO I think that most important is the last previous version - "dnf history undo last", which should be possible always, and may this option will not be used the often.
I don't know plugin "local", but thanks for tip, I will look at it.
That would still be just a partial solution. One may want to call undo on multiple transactions or call rollback. Or their history may look like:
upgrade foo-3.0 -> 4.0
downgrade foo-4.0 -> 3.0
upgrade foo-3.0 -> 5.0
Now, undo will fail again.
Anyway, I am not stopping anyone's effort to implement a plugin that works around the Fedora infrastructure issue.
Hmm... I don't see problem exactly here. In this scenario when you downgrade to previous version, you can check if you have downgraded version of package and in that case don't remove/add anything abotu this package in your cache. Yes, it will not be always possible undo on multiple transactions, but when you use some restrictions like that, you must expect it. But still you will be able to call undo for bigger set of transactions.
For me keepcache=1 is ok now. That's same behaviour which I use years on archlinux and I don't have troubles with one clean per few months period.
The problem is really missing package in repo. Closing...