Skip to main content

How to Use ELevate Script to Upgrade CentOS to AlmaLinux



Step 1: Install ELevate

 Install elevate-release package in your CentOS 7 system using command:
$ sudo yum install http://repo.almalinux.org/elevate/elevate-release-latest-el7.noarch.rpm
Step 2: Install Leapp and migration data 

 The elevate-release package provides the Leapp utility and the necessary data to migrate Enterprise Linux 7.x to any Enterprise Linux 8.x versions of our choice. Depending upon the distribution you want to upgrade, you need to install any one of the following packages:
leapp-data-almalinux
leapp-data-centos
leapp-data-oraclelinux
leapp-data-rocky
For instance, if you want to migrate CentOS 7 to AlmaLinux 8, you need to install the following packages:
$ sudo yum install -y leapp-upgrade leapp-data-almalinux
To migrate CentOS 7 to CentOS 8, install the following packages:
$ sudo yum install -y leapp-upgrade leapp-data-centos
To migrate CentOS 7 to Oracle Linux 8, install the following packages:
$ sudo yum install -y leapp-upgrade leapp-data-oraclelinux
To migrate CentOS 7 to Rocky Linux 8, install the following packages:
$ sudo yum install -y leapp-upgrade leapp-data-rocky
We have now installed the leap-upgrade package and the migration data for the OS we want to upgrade. For the purpose of this guide, I am going to upgrade CentOS 7 to AlmaLinux 8. 

 Step 3: Start preupgrade check 

 Next run the following command to check if upgrade is possible or not:
$ sudo leapp preupgrade
This will perform a series of actions and verify if it is possible to perform the upgrade.

==> Processing phase `configuration_phase`
====> * ipu_workflow_config
        IPU workflow config actor
==> Processing phase `FactsCollection`
====> * scanmemory
        Scan Memory of the machine.
====> * source_boot_loader_scanner
        Scans the boot loader configuration on the source system.
.
.
.
============================================================
                     UPGRADE INHIBITED                      
============================================================

Upgrade has been inhibited due to the following problems:
    1. Inhibitor: Detected loaded kernel drivers which have been removed in RHEL 8. Upgrade cannot proceed.
    2. Inhibitor: Multiple devel kernels installed
    3. Inhibitor: Possible problems with remote login using root account
    4. Inhibitor: Missing required answers in the answer file
Consult the pre-upgrade report for details and possible remediation.

============================================================
                     UPGRADE INHIBITED                      
============================================================

Debug output written to /var/log/leapp/leapp-preupgrade.log

============================================================
                           REPORT                           
============================================================

A report has been generated at /var/log/leapp/leapp-report.json
A report has been generated at /var/log/leapp/leapp-report.txt

============================================================
                       END OF REPORT                        
============================================================

Answerfile has been generated at /var/log/leapp/answerfile

Start preupgrade check
At the end of the preupgrade check, the Leapp utility will generate a report in /var/log/leapp/leapp-report.txt file. This file contains possible problems and recommended solutions. No rpm packages will be installed at this phase.

WARNING:

Preupgrade check will fail if the default CentOS 7 doesn't meet all requirements for migration. In that case, you need to fix all the problems and try again.

The following fixes from the /var/log/leapp/leapp-report.txt file are mandatory, but you can also review the rest of them if needed.
In my case, I fixed the following issues:
$ sudo rmmod pata_acpi
$ echo PermitRootLogin yes | sudo tee -a /etc/ssh/sshd_config
$ sudo leapp answer --section remove_pam_pkcs11_module_check.confirm=True
I also had to remove the extra kernel devels. List the installed kernels in CentOS:
$ rpm -qa kernel
kernel-3.10.0-1160.45.1.el7.x86_64
kernel-3.10.0-1160.42.2.el7.x86_64
As you see above, there are currently two kernels installed in my system. Remove the old kernel and kernel-devels and keep only the currently active Kernel using command:
$ sudo package-cleanup --oldkernels --count=1
Once you fixed all the problems, run the following command to migrate CentOS 7 to any Enterprise Linux 8.x of you choice:
$ sudo leapp upgrade
Once the upgrade is completed, reboot your system:
$ sudo reboot
A new entry called ELevate-Upgrade-Initramfs in the GRUB menu will appear. The system will be automatically booted into it. You can view the how the update process goes in the console. System will automatically reboot once the upgrade is completed. The GRUB menu entries will be automatically updated depending upon the OS. Login to the system and verify that the current OS is the one you need.
$ cat /etc/os-release

Sample output:

NAME="AlmaLinux"
VERSION="8.4 (Electric Cheetah)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="AlmaLinux 8.4 (Electric Cheetah)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:almalinux:almalinux:8.4:GA"
HOME_URL="https://almalinux.org/"
DOCUMENTATION_URL="https://wiki.almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"

ALMALINUX_MANTISBT_PROJECT="AlmaLinux-8"
ALMALINUX_MANTISBT_PROJECT_VERSION="8.4"
Check AlmaLinux version
Check AlmaLinux version
Great! We've successfully upgraded CentOS 7 to AlmaLinux 8.4 version.
Clear cache (Optional) All the downloaded packages during the migration will be saved in cache until the next successful transaction. You can remove cached packages by executing the following command as sudo or root user:
$ sudo dnf clean packages
Update hostname Finally, update the hostname, username to match with AlmaLinux.
$ sudo hostnamectl set-hostname almalinux8
All done! Reboot your system to take effect the changes.

Comments

Popular posts from this blog

Cara Disable Antimalware Service Executable di Windows 10

Disadari atau tidak, Windows 10 (dan juga windows-windows lainnya) hadir dengan banyak sekali aplikasi bloatware (aplikasi yang tidak perlu-perlu amat dimiliki oleh end user). Contohnya, adalah aplikasi yang seharusnya sudah tergantikan fungsinya oleh antivirus, seperti Antimalware Service Executable . Aplikasi ini dicurigai membuat Windows 10 mengalami inefisiensi memori/RAM, memakan resource yang tinggi, dengan Load yang tinggi (tanpa limit terkadang). Nah, berikut adalah cara men-disable nya: Tekan tombol Windows + I untuk membuka apliaksi Windows Setting. Pilih icon menu Update and Security Pilih lagi menu disamping kiri Windows Security Pada jendela baru yang muncul, ada pilihan Virus & Threat protection Klik ini Lalu matikan proses Real-time protection tersebut. Dengan Regedit. Buka dialog regedit, Windows + R dan ketik ‘regedit’ Cari Folder regedit ini HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Buat sebuah DWORD baru dengan klik kanan

Setup Debian 11 Official Repository In sources.list (/etc/apt/sources.list)

When you install Debian 11 using a DVD, the OS installer sets the DVD as the source for getting packages for your system if you didn't choose to scan for network mirrors. Due to this reason, the system would ask you to insert a DVD if the disc is not present in the DVD drive when you try to install any software.  Also, the packages on DVD may not be the latest release.  So, we need to get the packages from the Internet. Media change: please insert the disc labeled 'Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04' in the drive '/media/cdrom/' and press [Enter] The /etc/apt/sources.list file with DVD as a source would look something like below. # deb cdrom:[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04]/ bullseye contrib main deb cdrom:[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04]/ bullseye contrib main deb http://security.debian.org/debian-security bullseye-security

Cara Membuat Live USB VMWare ESXi 6.7 di Linux (Debian/CentOS)

VMWare ESXi 6.7 menyediakan satu installer dalam format CDROM ISO. Dalam tutorial kali ini kita akan membuat sebuah live USB dengan menggunakan sistem Linux, misalnya Debian dan CentOS. Untuk keperluan tutorial kali ini silakan pastikan sudah ada download installer ISO ESXi 6.7 dari https://my.vmware.com Siapkan satu USB Flashdisk dengan kapasitas lebih dari 1GB. Format dalam satu partisi dengan tool yang biasa dipakai dalam format partisi FAT32. Misal dengan FDISK: [sourcecode] fdisk /dev/sdX [/sourcecode] format ke FAT32: [sourcecode]mkfs.fvat -F 32 -n USB /dev/sdX1[/sourcecode] selanjutnya, kita buat USB tersebut bootable dengan syslinux. Bagi linuxnya belum ada syslinux, silakan install dulu (apt-get install syslinux atau yum install syslinux).