Hide Forgot
Description of problem: When running DNF 2.0rc1, the history subcommand does not understand "last" to identify the latest transaction recorded to act on. Version-Release number of selected component (if applicable): 2.0.0-0.0.1.rc1.mga6 (= 2.0.0-0.rc1.3.fc26) How reproducible: Always Steps to Reproduce: 1. Install something with dnf 2. Run "dnf history (undo|redo|info) last" Actual results: Returns error: "Bad transaction ID given" Expected results: Does appropriate action with last transaction recorded Additional info: This issue was discovered on Mageia Cauldron using the DNF 2.0 Copr for Cauldron[1]. [1]: https://copr.fedorainfracloud.org/coprs/ngompa/dnf2-mga/
Err, the DNF 2.0rc1 package in the COPR repo is actually equivalent to dnf-2.0.0-0.rc1.4.fc26 in Rawhide.
Please provide backtrace.
oops, wrong bug.
we'll fix this.
*** This bug has been marked as a duplicate of bug 1393595 ***
Any progress on this? I've not seen any pull requests related to this issue show up in DNF...
Just FTR, man pages say: ``` SPECIFYING TRANSACTIONS <transaction-spec> can be in one of several forms. If it is an integer, it specifies a transaction ID. Specifying --last is the same as specifying the ID of the most recent transaction. The last form is --last-<offset>, where <offset> is a positive integer. It specifies offset-th transaction preceding the most recent transaction. ``` So trying last: ``` $ sudo dnf history undo --last usage: dnf history [-c [config file]] [-q] [-v] [--version] [--installroot [path]] [--noplugins] [--disableplugins [plugin]] [--releasever RELEASEVER] [--setopt SETOPTS] [-h] [--allowerasing] [-b] [-C] [-d [debug level]] [--debugsolver] [--showduplicates] [-e ERRORLEVEL] [--rpmverbosity [debug level name]] [-y] [--assumeno] [--enablerepo [repo]] [--disablerepo [repo] | --repo [repo]] [-x [package]] [--disableexcludes [repo]] [--repofrompath [repo,path]] [--nogpgcheck] [--color COLOR] [--refresh] [-4] [-6] [--downloadonly] [[list|info|redo|undo|rollback|userinstalled] [[list|info|redo|undo|rollback|userinstalled] ...]] dnf history: error: unrecognized arguments: --last ``` But I used to be to use just "last" without dashes when using YUM, but it fails with different error: ``` $ sudo dnf history undo last Repository 'tiliado-nuvolaplayer' is missing name in configuration, using id. Last metadata expiration check: 4:24:15 ago on Tue Nov 22 10:37:33 2016 CET. Failed to synchronize cache for repo 'rcm-tools-fedora-rpms', disabling. Failed to synchronize cache for repo 'tiliado-nuvolaplayer', disabling. Bad transaction ID given Error: Failed history undo ``` So you probably want to clarify the behavior/documentation ...
In document "doc/cli_vs_yum.rst" was documented that dnf considers last option as <package-ID>, but yum considered it as package name. So because of back compatibility it was renamed to "--last" option (Commit https://github.com/rpm-software-management/dnf/commit/1681a5fafbb66e115b8ab71ae9b374227aeb7c6c) Few weeks later was changed handling or arguments and I found that "--last" option did not work. So I created PR (https://github.com/rpm-software-management/dnf/pull/584) that fixed that but after some discussion about doing this the right way we found out that there was mistake in "doc/cli_vs_yum.rst" and dnf worked as yum. Unfortunately argparser is not able to handle this option in some new pretty way so we need to apply old parsing of "last" option to new argparser.
(In reply to Štěpán Smetana from comment #8) > Unfortunately argparser is not able to handle this option in some new pretty > way so we need to apply old parsing of "last" option to new argparser. Yep, YUM always accepted just plain "last" as far as I remember, so this plan works for me.
Fixed in https://github.com/rpm-software-management/dnf/pull/659
Verified that it's fixed: ``` [ngompa@mgacauldron-dnftst Music]$ sudo dnf history info last Last metadata expiration check: 0:01:58 ago on Thu Nov 24 10:40:27 2016 EST. Transaction ID : 90 Begin time : Thu Nov 24 10:42:01 2016 Begin rpmdb : 2623:fef133c1f4cd41f0af864d6b9d9dffde4e203958 End time : 10:42:09 2016 (8 seconds) End rpmdb : 2623:633bc9ecb97873fcf3dd271784b2fe599cff3b6f User : System <unset> Return-Code : Success Command Line : --best --allowerasing install dnf Transaction performed with: Upgraded dnf-2.0.0-0.0.1.rc1.mga6.noarch @ngompa-dnf2-mga Installed 1:rpm-4.13.0-2.mga6.x86_64 @cauldron-x86_64 Packages Altered: Upgraded dnf-2.0.0-0.0.1.rc1.mga6.noarch @ngompa-dnf2-mga Upgrade 2.0.0-0.0.3.rc1.mga6.noarch @ngompa-dnf2-mga Upgraded dnf-conf-2.0.0-0.0.1.rc1.mga6.noarch @ngompa-dnf2-mga Upgrade 2.0.0-0.0.3.rc1.mga6.noarch @ngompa-dnf2-mga Upgraded dnf-yum-2.0.0-0.0.1.rc1.mga6.noarch @ngompa-dnf2-mga Upgrade 2.0.0-0.0.3.rc1.mga6.noarch @ngompa-dnf2-mga Upgraded python3-dnf-2.0.0-0.0.1.rc1.mga6.noarch @ngompa-dnf2-mga Upgrade 2.0.0-0.0.3.rc1.mga6.noarch @ngompa-dnf2-mga ```
Fixed with the dnf 2.0rc2 builds in rawhide.