aptitude 需要自己安装
sudo apt-get install aptitude # 安装# aptitude的一些常用的操作:
sudo aptitude update # 更新软件源
sudo aptitude search 软件名称 # 查看软件
sudo aptitude install 软件名称 # 安装软件
sudo apt list gcc-11
Then install the version you want, so for me :
sudo aptitude install gcc-11=11.2.0-19ubuntu1
参考
https://stackoverflow.com/questions/74204019/reset-gcc-version-from-11-3-to-11-2-on-ubuntu-22-04