Tested on a Raspberry Pi 4 with 8GB RAM.
Whatever else you do, make sure you are using a 64-bit OS. The combination of the arm archtecture and a 32-bit OS will greatly limit package support.
Rasberry Pi OS is based on Debian, and very recently released a 64-bit version.
Ubuntu for Raspberry Pi 64-bit is another choice.