Not sure about the kernel panic. Try removing overclocking and setting the memory split to 256. Also try a different powersupply if problem persists. You may also want to try updating your raspberry pi firmware with “sudo rpi-update”
As for having problem with retropie_setup.sh after apt-get upgrade, try editing retropie_packages.sh and replace all (three) 4.7 references with 4.8. gcc-4.7 is removed for some reason, at least if you do an apt-get dist-upgrade, so it’s likely broken.