I don’t see anything obviously incompatible with Fedora here except you can remove apt update and use dnf instead to install things, but I don’t have the hardware to test it on. Instead of build-essential, you probably want dnf groupinstall "Development Tools".