转载:https://www.programering.com/a/MDMyMTMwATI.html
Because matlab R2012a GCC version 4.4, in order to keep the Ubuntu GCC version of the same to compile, so to install the gcc-4.4 version. The following only records the installation error solution:
1 check /etc/apt/sources.list and sudo
sudo gedit /etc/apt/sources.list
2 add the following code to the file:
# stable deb http://ftp.de.debian.org/debian/ sarge main contrib non-free deb-src http://ftp.de.debian.org/debian/ sarge main contrib non-free deb http://ftp.de.debian.org/debian-non-US/ sarge/non-US main contrib non-free deb-src http://ftp.de.debian.org/debian-non-US/ sarge/non-US main contrib non-free
The 3 Update
sudo apt-get update
4 installation of GCC and g++
sudo apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib
转载:https://blog.youkuaiyun.com/hunter___/article/details/89306778
解决"package gcc-4.4 is not available, but is referred to by another package"方法:
1.sudo vim /etc/apt/sources.list
在最后添加:
# stable add by , in order to install g++4.4
deb http://dk.archive.ubuntu.com/ubuntu/ trusty main universe
2.history 如下:
2046 sudo vim /etc/apt/sources.list
2047 sudo apt update
2048 sudo apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib
2050 g++ -v
2057 cd ../bin/
2058 ls g++*
2059 ls g++* -l
2060 sudo mv g++ g++.bak
2061 ls g++* -l
2062 ls gcc* -l
2063 sudo mv gcc gcc.bak
2064 ls gcc* -l
2065 sudo ln -s g++-4.4 g++
2066 ls g++* -l
2067 sudo ln -s gcc-4.4 gcc
2068 ls gcc* -l
降版本成功: