Hello aladebinary,
Thank you for reaching out to Apple Support Communities.
If terminal is not functioning as expected, you may need to reinstall macOS. This is required since terminal is a core function of macOS.
We strongly recommend creating a backup first even if you don't plan on doing an erase and install,
These steps should help:
If you're using a Mac with Apple silicon
- Press and hold the power button on your Mac. As you continue to hold the power button, your Mac turns on and loads startup options. When you see Options, release the power button.

- Click Options, then click the Continue button that appears below it.
- If you're asked to select a user you know the password for, select the user, click Next, then enter their administrator password.
If you're using an Intel-based Mac
If you're not using a Mac with Apple silicon, then you're using an Intel-based Mac.
- Press the power button on your Mac to turn it on, then release the power button and immediately press and hold both the Command (⌘) key and R key until you see an Apple logo or spinning globe. If you can't start up from Recovery in this way, review the guidelines for using startup-key combinations.
- If you're asked to select a user you know the password for, select the user, click Next, then enter their administrator password.
Reinstall macOS from macOS Recovery
When you see a window with the option to reinstall macOS, your Mac has started up from Recovery.
- Select the option to reinstall macOS. Reinstalling macOS doesn't remove your personal data.

- Click Continue, then follow the onscreen instructions.
- If the installer asks to unlock your disk, enter the password that you use to log in to your Mac.
- If the installer doesn't see your disk, or it says that it can't install on your computer or volume, you might need to erase your disk first.
- If the installer offers you the choice between installing on Macintosh HD or Macintosh HD - Data, choose Macintosh HD.
- Allow installation to complete without putting your Mac to sleep or closing its lid. Your Mac might restart and show a progress bar several times, and the screen might be empty for minutes at a time.
After installation is complete, your Mac might restart to a setup assistant. If you're selling, trading in, or giving away your Mac, press Command-Q to quit the setup assistant without completing setup, then click Shut Down. When the new owner starts up the Mac, they can use their own information to complete setup.
More details can be found here: How to reinstall macOS
As far as your second question we would recommend checking with linux forums to see which version best suits your needs.
Cheers!