Oracle Linux 7.9 to OL 8 Free Tier Upgrade

I decided to Upgrade my Oracle Free Tier instance

Based on Leapp utility simplifies Oracle Linux 7 to 8 upgrades in Oracle Cloud Infrastructure

If you are ready for OL9 look here: Upgrade Oracle Linux 8 to Oracle Linux 9 using Leapp

My Linux VM is running sqlcl, node js, pm2 , nginx and other small stuff that is useful

First i did:
yum upgrade
shutdown -r
sudo yum clean all

# Clean up old kernels and unused packages
sudo package-cleanup --oldkernels --count=1
sudo package-cleanup --leaves
sudo package-cleanup --orphans

Than i installed leapp that helps to upgrade from ol7 to ol8

sudo yum install leapp --enablerepo=ol7_leapp,ol7_latest
sudo leapp preupgrade --oci

The Preupgrade Check detects possible problems:

I got Warnings:

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

Upgrade has been inhibited due to the following problems:
    1. Inhibitor: The OS Management Service (OSMS) agent is running on this instance and instance is not identified as managed
    2. Inhibitor: Upgrade requires links in root directory to be relative
    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
============================================================

Ups i have too solve this 4 "Problemos"

  1. Shutdown OSMS Service
sudo systemctl stop oracle-cloud-agent.service
sudo systemctl disable oracle-cloud-agent.service
  1. Find relative Links in Root directory
find / -maxdepth 1 -type l -exec readlink -f {} \; -exec ls -l {} \;
found:
[root@oiainstance ~]# find / -maxdepth 1 -type l -exec readlink -f {} \; -exec ls -l {} \;
/usr/bin
lrwxrwxrwx. 1 root root 7 Oct 13  2021 /bin -> usr/bin
/usr/sbin
lrwxrwxrwx. 1 root root 8 Oct 13  2021 /sbin -> usr/sbin
/usr/lib
lrwxrwxrwx. 1 root root 7 Oct 13  2021 /lib -> usr/lib
/usr/lib64
lrwxrwxrwx. 1 root root 9 Oct 13  2021 /lib64 -> usr/lib64
/var/lib/snapd/snap
lrwxrwxrwx. 1 root root 19 Dec 13  2021 /snap -> /var/lib/snapd/snap

As you can see here its /var and not var only => Thats the Problem here


Fix it via:
# Remove the existing absolute link
sudo rm /snap

# Create the new relative link
sudo ln -s var/lib/snapd/snap /snap

# Verify the link
ls -l /snap
  1. Remote Login SSH
Remote Login Using Root Account
sudo vi /etc/ssh/sshd_config

Search for PermitRootLogin and change it to yes

PermitRootLogin yes

Then:
sudo systemctl restart sshd
  1. Edit the Answer file:
    In my case theire was nothing important in it so i decided to start the upgrade
sudo leapp upgrade --oci

thumps up?

No more space on device?

  installing package bcc-0.25.0-5.el8.x86_64 needs 29MB on the / filesystem

Error Summary
-------------
Disk Requirements:
   At least 29MB more space needed on the / filesystem.

[root@oiainstance home]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        301M     0  301M   0% /dev
tmpfs           335M     0  335M   0% /dev/shm
tmpfs           335M  5.2M  330M   2% /run
tmpfs           335M     0  335M   0% /sys/fs/cgroup
/dev/sda3        39G   20G   19G  53% /

and now?

hm enough free i think