One reason why I use IDE 1.8.x is that it supports portable installs. For each processor/board, I create a portable install. Portable installs don't interfere with each other. So you can have a portable install for AVR, for Teensies (plus AVR), a portable install for LGT8F328 (plus AVR), portable install for ESP8266 (plus AVR), portable install for ESP32 (plus AVR) etc.
Yes, it chews a bit of diskspace (basically a full IDE installation per install) but you will never run into the issue that you have.
Added benefit:
If you backup a portable install, you have ALL relevant stuff (IDE, compiler, board package used, libraries) in the backup.
Hi @StefanL38. Most Arduino boards platforms specify the toolchain dependencies that should be installed along with the platform via Arduino IDE Boards Manager. The "LGT8fx Boards" platform doesn't do that. It instead assumes that usable dependencies will have already been installed through the installation of a different platform (e.g., "Arduino AVR Boards"). It has a dependency on the avr-gcc compiler, but leaves the choice of where to find it to Arduino IDE:
This leaves for some ambiguity in the case where you have installed multiple platforms that each installed a candidate tool.
Although using this approach in a platform always risks that an unsuitable tool might be chosen, Arduino IDE 1.x was especially unsmart, inconsistent, and buggy in the tool selection under these conditions. These problems have already been resolved in Arduino IDE 2.x
But I know you prefer Arduino IDE 1.x. Despite quite some efforts, I didn't find any way to make the "LGT8fx Boards" platform coexist with the "Teensy" boards platform in Arduino IDE 1.x due to that bug. Fortunately this isn't a problem after all because Arduino IDE 1.x is not even compatible with the "Teensy" boards platform (you must use Teensyduino instead). I'll provide instructions you can follow to workaround this bug in Arduino IDE:
Select File > Preferences... from the Arduino IDE menus.
The "Preferences" dialog will open.
Remove the URL for the "Teensy" boards platform from the "Additional Boards Manager URLs" field.
Click the OK button.
Select File > Quit from the Arduino IDE menus if it is running.
Arduino IDE 1.x had a quirk that it doesn't recognize installed platforms if you remove their URL from that preferences field. This means that we can cause it to ignore the "Teensy" boards platform entirely, which doesn't do any harm since that platform couldn't be used in Arduino IDE anyway. This means you can keep the "Teensy" boards platform installed in case you feel like using it with Arduino CLI or Arduino IDE 2.x.
Now start Arduino IDE and try compiling a sketch for the "LGT8F328" board again. Hopefully this time an appropriate avr-gcc will be selected and the sketch will compile without any unexpected errors.