Score:3

Showing [Installed Version] when upgrading with dnf in CentOS/Redhat/Fedora/Rocky Linux

vn flag

When running dnf upgrade it only shows the new version of a package about to be upgraded. But I would like to see what the currently installed version of the package is too. Without having to go look up the installed packages etc. Basically I would like to add a column to the upgrade/update list that gets shown when I get asked if it should continue or not.

Currently it looks like

Package         Arch        Version         Repository      Size

But I would like to add a column of Installed Version like this

Package         Arch        Installed Version       Version         Repository      Size

Is this possible to do in dnf at the moment or is it something that would have to be added to the code? Tried to google it but couldn't find anything about this.

Edit: Thought that I could give you a few reasons why this would be helpful, and I came up with this right of off my head. If you know more reasons please enlighten me!

  • That you can see what typ of upgrade your getting. Like if it is a Major/Minor/Patch. So you can be al little more prepared on what your getting yourself into when saying yes on the continuation question.
  • If you are managing multiple servers/computers and upgrade them, you can more easily see if they are on different versions to begin with. Which could mean that the update could impact differently.
Michael Hampton avatar
cz flag
I don't see anything either. The old version is logged in the history after the package is updated, but that might not help you very much.
cn flag
Not what you asked for, but with a little script/pipe you could `dnf check-upgrade -q`, then `cut` the package names out and `rpm -q <packagename>` ... and format the output columns however you like.
BitGen01100000 avatar
vn flag
@rickhg12hs Well I guess I could do that. but it feels like one of those times where you'd end up spending way more time on automating a task than it takes to just check it manually. Fitting [xkcd](https://xkcd.com/1319/). ;)
cn flag
Y M M V :-) ;-)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.