Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1786316

Summary: dnf history command output is trimmed because of hardcoded 79 cols limit
Product: [Fedora] Fedora Reporter: Ivan Pesin <ivan.pesin>
Component: dnfAssignee: Nicola Sella <nsella>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 32CC: jmracek, john.kk.wong, jrohel, mblaha, mhatina, packaging-team-maint, pkratoch, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-4.2.23-1.fc32 dnf-4.2.23-1.fc31 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-05 02:29:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ivan Pesin 2019-12-24 11:13:33 UTC
Description of problem:

`dnf history` command's output is limited to 79 columns regardless of the actual terminal width. This often results in the commands column being trimmed, and makes it impossible to see the complete history information.

How reproducible:

Execute dnf install/update/remove command with parameters string longer than 24 characters. For example:

   yum install vim-enhanced less mc tree bind-utils

Actual results:

[root@safe-glider cli]# dnf history
ID     | Command line             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     9 | install vim-enhanced les | 2019-12-24 11:10 | Install        |   37 EE
     8 | reinstall dnf            | 2019-12-24 10:30 | R              |    2 EE
     7 | -y install man           | 2019-12-24 10:28 | Install        |    3 EE
     6 | -vv install vim-enhanced | 2019-12-24 10:24 | Install        |    4 EE
     5 | -vv install less         | 2019-12-24 10:23 | Install        |    1 EE
     4 | -y remove libsss_idmap l | 2019-12-23 20:35 | Removed        |    3
     3 | -y install cpio dhcp-cli | 2019-12-23 20:35 | Install        |   42
     2 | -y upgrade               | 2019-12-23 20:34 | I, U           |   10
     1 |                          | 2019-12-05 07:48 | Install        |  171 EE

Expected results:

[root@safe-glider cli]# dnf history
ID     | Command line                                                                                       | Date and time    | Action(s)      | Altered
----------------------------------------------------------------------------------------------------------------------------------------------------------
     9 | install vim-enhanced less mc tree bind-utils                                                       | 2019-12-24 11:10 | Install        |   37 EE
     8 | reinstall dnf                                                                                      | 2019-12-24 10:30 | R              |    2 EE
     7 | -y install man                                                                                     | 2019-12-24 10:28 | Install        |    3 EE
     6 | -vv install vim-enhanced                                                                           | 2019-12-24 10:24 | Install        |    4 EE
     5 | -vv install less                                                                                   | 2019-12-24 10:23 | Install        |    1 EE
     4 | -y remove libsss_idmap libsss_nss_idmap sssd-client                                                | 2019-12-23 20:35 | Removed        |    3
     3 | -y install cpio dhcp-client file findutils fipscheck gettext glibc-all-langpacks hardlink initscri | 2019-12-23 20:35 | Install        |   42
     2 | -y upgrade                                                                                         | 2019-12-23 20:34 | I, U           |   10
     1 |                                                                                                    | 2019-12-05 07:48 | Install        |  171 EE

Additional info:

Comment 1 Nicola Sella 2020-01-13 16:03:16 UTC
PR: https://github.com/rpm-software-management/dnf/pull/1567

Comment 2 Nicola Sella 2020-02-06 16:18:16 UTC
(In reply to nsella from comment #1)
> PR: https://github.com/rpm-software-management/dnf/pull/1567

Edit:
A PR that fixes the bug for terminal output was merged. [1]
For redirecting stdout to file there is an enhancement of the previous. [2]

[1] https://github.com/rpm-software-management/dnf/pull/1559
[2] https://github.com/rpm-software-management/dnf/pull/1587

Comment 3 Ben Cotton 2020-02-11 17:13:17 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 5 Fedora Update System 2020-06-03 08:55:14 UTC
FEDORA-2020-a943fde9ba has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-a943fde9ba

Comment 6 Fedora Update System 2020-06-04 03:00:23 UTC
FEDORA-2020-f3f7292b39 has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-f3f7292b39`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-f3f7292b39

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2020-06-04 04:08:30 UTC
FEDORA-2020-a943fde9ba has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-a943fde9ba`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-a943fde9ba

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2020-06-05 02:29:53 UTC
FEDORA-2020-a943fde9ba has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2020-06-19 01:05:24 UTC
FEDORA-2020-f3f7292b39 has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 john.kk.wong 2023-08-14 07:38:09 UTC
When I run "dnf history" on rhel8, the output are expected.

[root@safe-glider cli]# dnf history
ID     | Command line                                                                                       | Date and time    | Action(s)      | Altered
----------------------------------------------------------------------------------------------------------------------------------------------------------
     9 | install vim-enhanced less mc tree bind-utils                                                       | 2019-12-24 11:10 | Install        |   37 EE
     8 | reinstall dnf                                                                                      | 2019-12-24 10:30 | R              |    2 EE
     7 | -y install man                                                                                     | 2019-12-24 10:28 | Install        |    3 EE
     6 | -vv install vim-enhanced                                                                           | 2019-12-24 10:24 | Install        |    4 EE
     5 | -vv install less                                                                                   | 2019-12-24 10:23 | Install        |    1 EE
     4 | -y remove libsss_idmap libsss_nss_idmap sssd-client                                                | 2019-12-23 20:35 | Removed        |    3
     3 | -y install cpio dhcp-client file findutils fipscheck gettext glibc-all-langpacks hardlink initscri | 2019-12-23 20:35 | Install        |   42
     2 | -y upgrade                                                                                         | 2019-12-23 20:34 | I, U           |   10
     1 |                                                                                                    | 2019-12-05 07:48 | Install        |  171 EE


but when I run ssh rhel8vm "sudo dnf history", the output still trimmed like this:

[root@safe-glider cli]# dnf history
ID     | Command line             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     9 | install vim-enhanced les | 2019-12-24 11:10 | Install        |   37 EE
     8 | reinstall dnf            | 2019-12-24 10:30 | R              |    2 EE
     7 | -y install man           | 2019-12-24 10:28 | Install        |    3 EE
     6 | -vv install vim-enhanced | 2019-12-24 10:24 | Install        |    4 EE
     5 | -vv install less         | 2019-12-24 10:23 | Install        |    1 EE
     4 | -y remove libsss_idmap l | 2019-12-23 20:35 | Removed        |    3
     3 | -y install cpio dhcp-cli | 2019-12-23 20:35 | Install        |   42
     2 | -y upgrade               | 2019-12-23 20:34 | I, U           |   10
     1 |                          | 2019-12-05 07:48 | Install        |  171 EE


Any idea how to solve it? I would like get this "dnf history" via ansible ad-hoc command.
Thank you.