1.卸载现有的 GCC 5.5
sudo apt-get remove gcc-5 g++-5
sudo apt-get autoremove
2.编辑sources.list文件
sudo vi /etc/apt/sources.list
3.替换或添加以下内容
deb http://archive.ubuntu.com/ubuntu/ xenial main universe
deb http://archive.ubuntu.com/ubuntu/ xenial-updates main universe
deb http://archive.ubuntu.com/ubuntu/ xenial-security main univers
4.更新包列表
sudo apt-get update
5.安装 GCC 5.4
sudo apt-get install gcc-5=5.4.0-6ubuntu1~16.04.12
6.结果