15

What I want to know is how to search for all available versions of a particular package.

It might help to understand my situation to understand exactly what I want to do.

I develop software for clients using Node.js, npm, TypeScript, JavaScript, Express JS, React TSX/JSX, Mocha/JEST, and lots of other things.

All of the software mentioned above is obtained via "Npm", and much of it runs in the Node.js Runtime Environment.

Many clients get stuck to specific versions of Node.js, TypeScript, Npm &/or Npm packages. This makes it imperative that I can install the latest version of Node.js, the LTS version of Node.js, and all versions that have not yet reached their EoL.

I use to boot to Ubuntu, and I would obviously use the Apt package manager to search & download packages. "Ubuntu" & apt has some issues when it comes to certain packages though, expecially when trying to change versions. Unfortuanatly Node.js is one piece of software where switching around to different versions is difficult to do using "Ubuntu" & apt. This conundrum led to me getting use to manually installing Node, Npm, and manually adding the global npm bin dirs to my path &/or soft linking them.

I switched to Fedora Workstation 35 a little over a year ago (currently I just upgraded to the 37-prerelease version) for other reasons not to do with Node.js. Because of my problems w/ Ubuntu I got use to manually installing Npm & Node.js and I continued that practice while booting to Fedora. I Decided to see if I could install different versions of node using DNF, but the problem I am having is when I search using DNF it only returns the name of the package, informing me that it is available for download, but it doesn't mention what version it is, and if any other versions are available.

Does anyone know how I can search dnf for all available Node.js packages & Npm packages?

2 Answers2

24

Okay so I figured out how to find all available packages for a given piece of software.

To see if the software is even available through dnf, I will first run the following.

$ dnf search pkg-name-here

If it returns with a result that looks like the software I was searching for, then I will execute:

$ dnf search --showduplicates pkg-name-here

If there is more than one package available for the package-name that you searched for the --showduplicates flag will print the list of all available packages, as well as the version info for each one.

This is a very useful flag IMO.

3

Also when installing a package, autocompletion with TAB will show all available matches, including different versions:

dnf in brave-browser  (pressing TAB here)

brave-browser-1.51.114-1.x86_64 brave-browser-1.52.130-1.x86_64 brave-browser-1.57.53-1.x86_64 brave-browser-1.58.129-1.x86_64 brave-browser-1.59.124-1.x86_64 brave-browser-1.51.118-1.x86_64 brave-browser-1.56.11-1.x86_64 brave-browser-1.57.57-1.x86_64 brave-browser-1.58.131-1.x86_64 brave-browser-1.60.110-1.x86_64 brave-browser-1.52.117-1.x86_64 brave-browser-1.56.14-1.x86_64 brave-browser-1.57.62-1.x86_64 brave-browser-1.58.135-1.x86_64 brave-browser-1.60.114-1.x86_64 brave-browser-1.52.122-1.x86_64 brave-browser-1.56.20-1.x86_64 brave-browser-1.57.64-1.x86_64 brave-browser-1.58.137-1.x86_64
brave-browser-1.52.126-1.x86_64 brave-browser-1.56.9-1.x86_64 brave-browser-1.58.124-1.x86_64 brave-browser-1.59.117-1.x86_64
brave-browser-1.52.129-1.x86_64 brave-browser-1.57.47-1.x86_64 brave-browser-1.58.127-1.x86_64 brave-browser-1.59.120-1.x86_64

No need for sudo and no need to actually execute the command.
dnf might take a bit to display matches, as it refreshes the cache.

manero
  • 541