DNF / Package installation question

Hello Everyone,
I am pretty new to Linux. So it might be a dumb question. I installed a package from a specific repository. But when I run DNF update, it tells me there is an update for this package from another repository. I would only like to update to newer version in the same repository I installed it from.

The packages even have different names (azure-cli vs azure-cli.x86_64).

Why is it asking me to replace what I installed from a different repository? Is there a way to limit updates to the original repository only?

Thank you!

  1. What depository did you install that from? I see several non-fedora repos in that list.
  2. Those package names are not different. One has the arch extension and one does not, but the package names are the same.
  3. Is there a specific reason you installed from a 3rd party repo when it was available from the fedora repo? What benefit was gained that was not available with the packages from fedora? Fedora also has 2 additional dependent packages due to the way the software is packaged.
  4. Yes you can force the system to use only the chosen repo.
    Use dnf --help to see the options and usage. You are looking for the --disablerepo and --enablerepo options.
    dnf upgrade <package name> --disablerepo=\* --enablerepo=<chosen repo> which will select the named package from only the chosen repo.
  5. Similarly you can prevent actions on a given package with a general update using dnf upgrade --exclude=<package>

Hello Jeff,

  1. It’s the pcakages-microsoft-com-prod repo (you can see it in the second line of the screenshot, top right corner)
  2. Ah. I assumed it would consider the extensions too. Sounds like it does not.
  3. The third party repo is the official repo for that package that is maintained by the creator of the tool (Microsoft) and I trust it more than the package that is maintained by someone else (looks like one person as far as I can see). No offense to the person, but I would trust Microsoft as the source over someone I don’t know.
  4. I think this is what I need.
  5. This is good to know as well!

Thank you. I will mess around with #4!

Turned out #5 was closer. I had to put that into the individual fedora repo config files at: /etc/yum.repos.d/ (3 of them, fedora, fedora-updates, and fedora-updates-testing) to make it permanently skip checking those repos for that package.

Thank you!


You also could put similar options into /etc/dnf/dnf.conf that would affect the global config, not just the individual repos.

Your solution sounds the best for your particular needs.

1 Like