As of Linux kernel 5.11, the old methods of communicating with header pins on the Raspberry Pi no longer work. This means packages such as RPi.GPIO no longer function properly with newer kernels. This post by Dave Jones explains the reasons for the changes. But there is a new package in Ubuntu 21.04 called LGPIO that allows full control over the header pins with the latest kernel version.
This marks the first Ubuntu release with GPIO support for the Raspberry Pi. There's a tutorial over on Ubuntu dot com to try it out and leave feedback for the devs, though I expect they’re lurking here too.

https://discourse.ubuntu.com/t/how-to-u ... y-pi/22009