You need to establish a base line that your ESP32 works on at least one computer before trying on RPI. I know the RPI4 is pretty snappy and all but I only use it over VNC if I need to develop something on Python and ensure it works on RPIs and I never compile anything on it. Arduino tools on RPI need to be built from source, or are not very up to date. It’s not the best environment to do development, better if you do deployment on it.
For instance, the most up-to-date ESP32-Arduino component is based on ESP-IDF V3.3, which relies on a pseudo nix environment on windows and requires an esptool.exe to upload code. I don’t know the equivalence on nix machines. I imagine it uses Python 2.x, that’s dino turd old. The latest ESP-IDF V4.3/4.4 already uses a Python 3.x based esptool.py, a pure Python script that I guarantee you works on RPI0W and RPI4 because I’ve just done some custom jig and Python factory firmware build with them, with the esptool.py and its required components that I copied from ESP-IDF V4.3.
Issue is, you have to wait for the ESP32-Arduino 2.0, which is based on ESP-IDF V4.x but is in beta or alpha so until then, it’s best for you, an ESP32 newcomer, to use windows.
There’s nothing bad using a $200 windows laptop while you watch birds in your retirement. Once you get your hands on the sweet official release ESP32-Arduino 2.0 sometime later this year, you can gift that laptop to your grand kids.
Espressif is cranking out a lot of hardware/dev kit goodies lately so I give them some slack when they didn’t deliver the USB host stack on their S2 or not upgrading their ESP32-Arduino to the latest ESP-IDF. ESP-IDF is the foundation of all ESP development environments including ESP32-Arduino so maybe you would be interested in using is once you’ve got enough experience with ESP32-Arduino. There is a lot you can do with ESP32. Welcome to the “club”!