Is it possible to set Operating System Release Preference like in RHEL ?

General support questions
Post Reply
NITESupport
Posts: 4
Joined: 2016/06/27 11:01:15

Is it possible to set Operating System Release Preference like in RHEL ?

Post by NITESupport » 2019/09/19 12:40:32

Hello

I'd like to set the Operating System Release Preference in centos to limit the updates at specific version.
(Like it is possible with RHEL)

Is there a way to do this with centos ?

Thanks

User avatar
avij
Retired Moderator
Posts: 3039
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: Is it possible to set Operating System Release Preference like in RHEL ?

Post by avij » 2019/09/19 14:20:31

You mean you want to stop receiving updates to your system? That's easy, you only need to refrain from running yum update ever again. If you have yum-cron installed to install updates, you will also need to edit /etc/yum/yum-cron.conf to stop yum from applying the updates automatically (apply_updates = no).

Mike_Rochefort
Posts: 152
Joined: 2016/03/16 02:34:19

Re: Is it possible to set Operating System Release Preference like in RHEL ?

Post by Mike_Rochefort » 2019/09/19 15:04:58

That functionality does not exist within CentOS, as it relies on subscription-manager which CentOS does not use. This configuration can also be managed by Satellite for larger networks.

To get a similar result in CentOS, you will need to deactivate the base, updates, and extras repos. Then use the Vault repos to enable the version you want. Be aware this only works for the second most recent release, i.e. you can’t isolate C7.7 since it doesn’t have an RPM vault yet.

Keep in mind that if you rely on packages from third-party repos, you may not be able to upgrade/install those packages if they require a specific package version greater than what is supplied by your locked release. You will also not be getting any updates once you switch, so please only do this on internal, non-internet and isolated systems.

Cheers,
Mike

User avatar
jlehtone
Posts: 2293
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Is it possible to set Operating System Release Preference like in RHEL ?

Post by jlehtone » 2019/09/19 15:37:12

NITESupport wrote:
2019/09/19 12:40:32
Is there a way to do this with centos ?
No.

Red Hat sells support for their old point releases. CentOS does not have access to that (legacy) support. Therefore, CentOS can support only one -- the current latest -- point release; there are no other versions.
  • With CentOS you have to update all the way.
  • With RHEL you can pay for security updates for specific older version.
  • Not updating is never an option, because you endanger everybody (unless your system is completely isolated)

hunter86_bg
Posts: 1903
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Is it possible to set Operating System Release Preference like in RHEL ?

Post by hunter86_bg » 2019/09/20 04:48:02

I think there is a workaround.

All mirrors contain a specific directory for each point release.You can update your /etc/yum.repos.d/*.conf files to point 7.7.1908 and you will never upgrade to 7.8 (whenever it comes).
Of course, that might not be valid for external repos like epel's ,remi's php ,etc.

So your base should be looking like this:

Code: Select all

#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
And the modified one should look like:

Code: Select all

#

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=http://centos.uni-sofia.bg/centos/7.7.1908/os/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

Note: The example above has not been tested if it works or checked if points to exact base repo on the mirror , but is an example how to modify the neccessary repo files.

User avatar
jlehtone
Posts: 2293
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Is it possible to set Operating System Release Preference like in RHEL ?

Post by jlehtone » 2019/09/20 07:50:56

hunter86_bg wrote:
2019/09/20 04:48:02
I think there is a workaround.
Simpler (and safer) solution: unplug your machine from all networks, permanently.
That way yum cannot reach repositories for "wrong" versions.

User avatar
TrevorH
Forum Moderator
Posts: 26515
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Is it possible to set Operating System Release Preference like in RHEL ?

Post by TrevorH » 2019/09/20 08:19:29

All mirrors contain a specific directory for each point release.You can update your /etc/yum.repos.d/*.conf files to point 7.7.1908 and you will never upgrade to 7.8 (whenever it comes).
That will 404 when the next point release comes out. Older point releases are removed from the mirror network to save space.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

NITESupport
Posts: 4
Joined: 2016/06/27 11:01:15

Re: Is it possible to set Operating System Release Preference like in RHEL ?

Post by NITESupport » 2019/09/22 04:59:48

Hello

No need for more information.

Thanks

Post Reply

Return to “CentOS 7 - General Support”