Answers:
我通过添加jessie repo然后从中安装来使其正常运行(非常不合理)。包含在/etc/apt/sources.list中:
deb http://ftp.us.debian.org/debian/ jessie main contrib non-free
deb-src http://ftp.us.debian.org/debian/ jessie main contrib non-free
执行apt-get更新&& apt-get安装g ++-4.9
安装后,注释掉jessie行,以免以后与Stretch冲突。如果Debian包含其他g ++版本,那就更好了。奇怪的是,我们捆绑了许多版本的gcc,但只有一个版本的g ++(6.0)。
这适用于debian10.3,没有任何软件包冲突。
#!/bin/bash
set -xe
BASE_URL=http://ftp.us.debian.org/debian/pool/main/
PACKAGES=$(cat <<-END
g/gcc-4.9/cpp-4.9_4.9.2-10%2Bdeb8u1_amd64.deb
g/gcc-4.9/g%2B%2B-4.9_4.9.2-10%2Bdeb8u1_amd64.deb
g/gcc-4.9/gcc-4.9-base_4.9.2-10%2Bdeb8u1_amd64.deb
g/gcc-4.9/gcc-4.9_4.9.2-10%2Bdeb8u1_amd64.deb
g/gcc-4.9/libgcc-4.9-dev_4.9.2-10%2Bdeb8u1_amd64.deb
g/gcc-4.9/libasan1_4.9.2-10%2Bdeb8u1_amd64.deb
g/gcc-4.9/libubsan0_4.9.2-10%2Bdeb8u1_amd64.deb
g/gcc-4.9/libcilkrts5_4.9.2-10%2Bdeb8u1_amd64.deb
g/gcc-4.9/libstdc%2B%2B-4.9-dev_4.9.2-10%2Bdeb8u1_amd64.deb
m/mpfr4/libmpfr4_3.1.5-1_amd64.deb
c/cloog/libcloog-isl4_0.18.4-1+b1_amd64.deb
i/isl/libisl10_0.12.2-2_amd64.deb
i/isl/libisl15_0.18-1_amd64.deb
END
)
mkdir -p ./downloads/gcc4.9
cd ./downloads/gcc4.9
while IFS= read -r package; do
wget -c $BASE_URL$package
done <<< "$PACKAGES"
apt-get install multiarch-support
dpkg -i ./downloads/gcc4.9/*.deb
http://ftp.us.debian.org/debian/pool/main/g/gcc-4.9/
请注意以下有用的答案:https : //askubuntu.com/a/428199/456089
相反,只需下载所有这些内容:
binutils_2.25-5_amd64.deb
cpp_4.9.2-2_amd64.deb
g++_4.9.2-2_amd64.deb
gcc_4.9.2-2_amd64.deb
gcc-4.9-base_4.9.2-10_amd64.deb
libasan1_4.9.2-10_amd64.deb
libatomic1_4.9.2-10_amd64.deb
libcilkrts5_4.9.2-10_amd64.deb
libgcc1_4.9.2-10_amd64.deb
libgcc-4.9-dev_4.9.2-10_amd64.deb
libgomp1_4.9.2-10_amd64.deb
libitm1_4.9.2-10_amd64.deb
liblsan0_4.9.2-10_amd64.deb
libmpfr4_3.1.2-2_amd64.deb
libquadmath0_4.9.2-10_amd64.deb
libstdc++-4.9-dev_4.9.2-10_amd64.deb
libstdc++6
libtsan0_4.9.2-10_amd64.deb
libubsan0_4.9.2-10_amd64.deb
从Debian的服务器,例如:
http://ftp.us.debian.org/debian/pool/main/b/binutils/binutils_2.25-5_amd64.deb
然后安装它们,例如:$ for package in * .deb; 做sudo dpkg --install“ $ package”; 做完了
请注意,您可能会遇到一些有关依赖项的问题,因此您希望使用该列表中尽可能少的软件包。