添加 PPA 源
sudo add-apt-repository ppa:ubuntu-toolchain-r/testsudo apt update
安装 g++ 13 / gcc 13
sudo apt install g++-13sudo apt install gcc-13
设置 g++ 13 / gcc 13 为默认版本
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100sudo update-alternatives --config g++sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100sudo update-alternatives --config gcc