Prevent R update once I have compiled from source

I have compile R 4.1 from source code.

Now “Software” wants to update R-code to 4.0.5.

But I (obviously) want to keep the version I compiled from source.

How to prevent this update?

Put the packages you want ignored in an exclude list and configure the software updates to always use that list. I don’t use the gnome software update tool so I don’t have the details of how. If you use dnf it is easy.

Yes I use dnf. How to do it?

Read the man page for dnf to see how to set up an exclude.

Also, if you manually installed R, then you might be able to remove the version installed from the repo. Once removed it will no longer try to update it.

There is an undocumented exclude=<whatever>[,<whatever-else] option that can be added to /etc/dnf/dnf.conf. I think adding the following line to /etc/dnf/dnf.conf should do what you want.

exclude=R-*
1 Like

If using only dnf for updates, something like excludepkgs=R-* in /etc/yum.repos.d/fedora.repo and/or /etc/yum.repos.d/fedora-updates.repo might be enough.

See the excludepkgs description in DNF Configuration Reference — dnf latest documentation

But keep in mind Gnome “Software” and other such app stores may not (probably won’t) respect these settings.

3 Likes

I’d leave the system version in since other bits may depend on it—one cannot tell RPM to use software installed from source.

This bug suggests that while PackageKit (and so Gnome-software I assume) does not respect dnf.conf, it does respect the individual repository files in /etc/yum.repos.d/. So add the excludepkgs bit to your fedora repository files and PackageKit etc. should also ignore them:

1217594 – PackageKit ignores excludes in yum.conf

man dnf.conf does discuss excludepkgs.

1 Like

Gregory, it works perfectly!

I added that option to the file you specified, and this is what I get when I do a sudo dnf upgrade:

 Problem: package rstudio-1.4.1717-2.fc34.x86_64 requires libR.so()(64bit), but none of the providers can be installed
  - cannot install the best update candidate for package rstudio-1.4.1717-1.x86_64
  - package R-core-4.0.4-1.fc34.x86_64 is filtered out by exclude filtering
  - package R-core-4.0.5-1.fc34.x86_64 is filtered out by exclude filtering

The package is filtered out by exclude filtering!

Thank you a lot :slight_smile:

1 Like

Just be aware of what FranciscoD stated previously about some update systems not respecting dnf.conf. I wasn’t aware of that problem. Thanks FranciscoD for pointing that out.

1 Like

Thanks to anyone who participated :slight_smile:

Thanks FranciscoD, I updated the dnf.conf as Gregory suggested and it is working.

What are the advantages of using /etc/yum.repos.d/ files?

I don’t use yum, I use dnf.

Would that file also work for dnf?


I openened a related question here

Those files in /etc/yum.repos.d are the ones dnf uses to configure the active repos for updates. Dnf uses yum and rpm under the hood so it was a migration from yum to dnf as the package manager was improved.

as noted by @computersavvy , the repo configurations still go into /etc/yum.repos.d. So if you also want gnome-software etc. to “exclude” these packagers, add them to these files because Gnome-software etc. do not look at the dnf.conf configuration file.

In short: repo files are for all package managers but dnf.conf is only for dnf.

3 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.