After all the issues I was having with my 2015 5k imac, I gave up on it as a vehicle for Linux and bought a 2019 refurb. This was a bit of a gamble, as I hadn't seen a lot of postings on problems with it, at least with ones I couldn't solve. The good news is it has no kernel problems; both the 5.4 and 5.8 series boot up quickly. The bad news is that my internal wifi (Broadcom BCM4364), audio and microphone are not recognized, nor are drives plugged into the thunderbird ports. So I had to buy a wifi dongle (Linksys wusb6300), compile the driver (not difficult), and continue to plug in external speakers via another dongle (requiring two usb ports). I have yet to buy a microphone, so I can't do Zoom meetings on the Linux side. (Not a big deal, as it's a dual boot with MacOS.) And I can plug things other than drives into the thunderbolt ports using a thunderbolt to usb3 adapter. Using this approach, I have as many as 6 usb3 ports on the iMac, and I already need 5 of them (1 for speaker, 1 for audio dongle, 1 for wifi, 1 for keyboard/mouse, 1 for scanner).
For some reason, Ubuntu 20.04 kernel panics when more than the 4 usb ports are used, but Ubuntu 20.10 is fine. So that is what I am now using.
Bottom line on iMac with Linux. I have had three 27" iMacs: 2011, late 2015 5k, and now 2019 5k. All have AMD graphics. I have tried not only Ubuntu, but several other distros on them. None of them are flawless, but the earliest of them is nearly so. The internal speakers and mic work flawlessly and the internal wifi works with drivers in the Ubuntu repositories. Thunderbolt drives can be seen and read. The only thing that doesn't work is brightness control, but the native brightness is fine, so I never looked too hard for a solution. The only problem with the 2011 iMac is on the Mac side - the current version of MacOS isn't supported and the latest it runs (High Sierra) will no longer be supported after November.
The late 2015 was the most problematic. The internal speakers don't work and thunderbolt drives cannot be seen, but the mic works and the internal wifi works with drivers in the Ubuntu repositories. Brightness control works. But the big problem, the one I could never solve, is the kernel booting problem. Any kernel from 5.3 up takes several minutes to boot and changes to monitor resolution are glacial, as is the shutdown sequence. I was limping along with the Ubuntu 18.04 LTS kernel (4.15), but something happened during a MacOS update that messed up grub and I could never fix it, so it meant choosing to boot the MacOS or the distro at the top of the grub list (and those were the only choices) through the Mac booter.
The 2019 has more driver support problems than the 2015, but none that cannot be fixed with inexpensive external dongles. And I'm hoping to see BCM4364 support soon, which will free one of my usb ports now using a wifi dongle. In addition to the dongle problems, support for brightness control depends on the kernel you use. It is supported in the Ubuntu 5.4 LTS kernel, but not the Ubuntu 20.10 5.8 kernel. However, the latter doesn't kernel panic when more than 4 usb ports are occupied, so that's what I am going with. As for brightness control, it works with a tiny app called appropriately "Brightness Controller", which is in the repositories. The 2019 iMac will be supported on the Apple side for many years to come, so I expect to be using this computer for both Linux and Mac for a long time.