I cannot update to Pihole 5.1 on OSMC

Pi-hole and OSMC don’t sit well together but you can probably hack it so it works – but at your own risk. See No internet on OSMC after installing Pi-hole (also using the Pi-hole as DHCP server) as an example.

As to the more immediate problem, I (very) briefly looked at the code and there is mention of getting

a list of supported OS versions from a TXT record at versions.pi-hole.net

I’m unable to find versions.pi-hole.net so perhaps it’s a DNS-related problem.

Update: No, not a DNS problem.

[user@disp2478 ~]$ dig +short -t txt versions.pi-hole.net
"Raspbian=9,10 Ubuntu=16,18,20 Debian=9,10 Fedora=31,32 CentOS=7,8"

Although OSMC is Debian-based, it doesn’t have the “correct” values in /etc/os-release, which is where Pi-hole looks. As to why using export PIHOLE_SKIP_OS_CHECK=true doesn’t work, perhaps you’ll have more success on the Pi-hole forum.