upgrade from Centos 8.2 to Centos 8.x

Issues related to applications and software problems and general support
Post Reply
rational_behavior
Posts: 3
Joined: 2022/04/18 02:20:40

upgrade from Centos 8.2 to Centos 8.x

Post by rational_behavior » 2022/05/18 23:26:20

I need to upgrade a Centos 8.2 to another higher version of Centos 8. (Yes, I am aware they are EOL). I see that there is a website https://vault.centos.org . Do I just substitute that site for mirror.centos.org in my /etc/yum.repos.d/CentOS-Linux-BaseOS.repo file below?

Code: Select all

[baseos]
name=CentOS Linux $releasever - BaseOS
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
and then run

Code: Select all

yum update
? Is there anything else I need to do?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: upgrade from Centos 8.2 to Centos 8.x

Post by TrevorH » 2022/05/19 11:40:22

Yes, you can just substitute vault for the old mirror URL but that will only get you to 8.5, frozen in time as of 2021-12-31 and you will be missing lots of security updates.

Longer term you need to convert CentOS Linux 8 to something else - I'd recommend either Rocky or Alma Linux which are distros that fill the gap that CentOS Linux 8 left behind - rebuilds of RHEL minus branding. There is also CentOS Stream 8 but I would not recommend that as it is not a rebuild of RHEL and often breaks and, more importantly, some security updates for it lag behind RHEL by a lot. One kernel update at the start of the year to fix an important CVE took over 3 weeks to arrive and the httpd package lagged by 71 days for similarly important updates.

Both Rocky and Alma have scripts to convert from CentOS Linux 8 to their new distros. I only have one el8 VM so my sample is very small but migrate2rocky.pl worked on that for me. You do need to be on a newer CL8 version than 8.2 for those to work though so you probably have to point to vault to get more up to date first.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

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

Re: upgrade from Centos 8.2 to Centos 8.x

Post by jlehtone » 2022/05/19 12:23:39

I have migrated more than one (say three) system to Alma during last year. Back then my CentOS were up to date.

IIRC, both Alma and Rocky did update their migration scripts after 2022-01-31 to cope with fact that CentOS repos went to vault, so the scripts might already look at the vault on their own. Not sure though.

rational_behavior
Posts: 3
Joined: 2022/04/18 02:20:40

Re: upgrade from Centos 8.2 to Centos 8.x

Post by rational_behavior » 2022/05/20 04:06:43

I ran successfully on one box but now I can't replicate my success on another. Here's my /etc/yum.conf:

Code: Select all

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=0
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
Here's my /etc/yum.repos.d/CentOS-Linux-BaseOS.repo:

Code: Select all

[baseos]
name=CentOS Linux $releasever - BaseOS
baseurl=https://vault.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
I ran `yum update` just like before, seems successful, but which ends in:
Running transaction check
No available modular metadata for modular package 'perl-Encode-Locale-1.05-10.module_el8.3.0+416+dee7bcef.noarch', it cannot be installed on the system
No available modular metadata for modular package 'perl-IO-Socket-SSL-2.066-4.module_el8.3.0+410+ff426aa3.noarch', it cannot be installed on the system
No available modular metadata for modular package 'perl-Mozilla-CA-20160104-7.module_el8.3.0+416+dee7bcef.noarch', it cannot be installed on the system
No available modular metadata for modular package 'perl-Net-SSLeay-1.88-1.module_el8.3.0+410+ff426aa3.x86_64', it cannot be installed on the system
No available modular metadata for modular package 'perl-libnetcfg-4:5.30.1-451.module_el8.3.0+406+78614513.noarch', it cannot be installed on the system
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'yum clean packages'.
Error: No available modular metadata for modular package
At this point, `cat /etc/*-release` still says "CentOS Linux release 8.2.2004 (Core)", but it said 8.5 on my first try. Any red flags? Does it matter if I have local organizational repo configs in /etc/yum.repos.d?

"The downloaded packages were saved in cache until the next successful transaction." -- does that mean its not actually doing the work yet?

rational_behavior
Posts: 3
Joined: 2022/04/18 02:20:40

Re: upgrade from Centos 8.2 to Centos 8.x

Post by rational_behavior » 2022/05/20 04:55:24

seems that the correct command is

Code: Select all

yum update && yum ugrade
, or thereabouts.

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

Re: upgrade from Centos 8.2 to Centos 8.x

Post by jlehtone » 2022/05/20 08:01:41

man yum wrote: Upgrade Command
Command: upgrade
Aliases: up
Deprecated aliases: update, upgrade-to, update-to, localupdate
That is, your yum update && yum ugrade is exactly same as yum upgrade && yum ugrade

The yum caches repository metadata. It is quite common that cache is stale, but yum does not check for that every time. Hence mismatches between metadata (from cache) and actual repo content.

One way around that is yum --refresh up


PS. 'yum' is only a symlink to 'dnf'. The old name is there to help port maintenance scripts (that call 'yum') into 8.

Post Reply