You're running a very old version of RetroPie/Raspbian, which no longer has updates and it's no longer supported.
The RetroPie-Setup menu needs some new (well, they were new a few years back) dependencies, which your system cannot install anymore. In fact, RetroPie-Setup has probably shown a message when you started it that your system is no longer supported.
Looks like your Pi has been compromised (if you didn't change the default password for the pi user that's pretty easy) and someone added some scripts that are running automatically and brute-force various network addresses on the internet, hoping it would succeed in compromising them also.
Re-install from zero with a new image, don't expose your Pi to the internet directly and change the default password for the pi user to something non-trivial (before connecting it to your WiFi/Lan).
@mitu Ah thanks for the advice. Turns out I only have the Pi3 so even if I could somehow set up the thing to recognise I had a Saturn emulator on it, it's like you said it more than likely wouldn't run very well or even at all. And to think I spent all afternoon browsing the thing's files to try and find a backdoor. Oh well. Sticking to pre 1995 consoles for now it seems.
In addition to the system detection in system.sh, where you specify the detection method and the capabilities, you'll need to decide which distro (and flavor) you support and set the debian/ubuntu_ver. The platform flags in system.sh also have to be able to differentiate the platform so that different packages can be built with the proper make/cflags/ldflags parameters. Some emulators have makefiles that take into account the SBC platform and set compiler options themselves (i.e. Amiberry).
You should also take a look at _mapPackage in helpers.sh to make sure that kernel headers package are properly detected and installed. Armbian has a different naming strategy for kernel package names than Ubuntu/Debian and they also provide different distro options for the same SBC (Debian/Ubuntu flavor).
Lastly, you'd need to check what packages should be enabled via each package's flags and make sure they're working properly.
@ignatius Then the problem is your Wi-Fi connection to the router. Assuming you get an IP address from it, check the Wi-Fi AP for any MAC based access rules or firewalls that might isolate/block your Pi.
First of all, sorry for the delay in replying. I had a brief hospital stint. I gave up on trying to resolve this. Instead, I just chrooted the Pi system, and installed everything that way. It's not exactly the best way to accomplish this, but it works.
Last minute cleaning and changes to script made after the 202205 release mentioned above.
dazi-template now supports loading any number of mods.
ZIPs still get extracted, but all other file types now get symbolic links
Automated Numeric 0rder for M0Ds in templates + mod-loader menu
Traversing Sub-Directories now supported in mod-loader menu
Mod-loader is now independent; no need to install dazi unless you want it to load @runncommand.
You can identify the latest version inside the menu/template by 2022.05 instead of 202205.