g++(gcc)11.1能在Debian Bullseye上使用吗?
即将发布的Debian 11(bullseye),我想使用一个支持C++20和模块的编译器。
Debian 11目前拥有gcc10.2和clang 11。clang 11具有一些C++20支持。
Debian是否比较保守,因为该操作系统使用gcc,而不是clang?
g++(gcc)11.1能在Debian Bullseye上使用吗?
即将发布的Debian 11(bullseye),我想使用一个支持C++20和模块的编译器。
Debian 11目前拥有gcc10.2和clang 11。clang 11具有一些C++20支持。
Debian是否比较保守,因为该操作系统使用gcc,而不是clang?
由于下一段中的链接已过时,因为Ubuntu 19.04已经到达了生命周期的尽头,我建议阅读本答案的读者参考更通用的情况,适用于所有基于Debian的操作系统中使用gcc的用户。有关在基于Debian的操作系统中安装非标准版本的gcc和g++的更多信息,请参阅此答案。
这里是从默认的Ubuntu软件源准备好在Debian Bullseye中安装的g++-11,该软件包的依赖关系列在this page上。
打开终端并输入:
cd ~/Desktop/
wget http://security.ubuntu.com/ubuntu/pool/universe/g/gcc-11/g++-11_11.1.0-1ubuntu1~21.04_amd64.deb
apt install --simulate ./g++-11_11.1.0-1ubuntu1~21.04_amd64.deb
sudo apt install ./g++-11_11.1.0-1ubuntu1~21.04_amd64.deb
使用 apt install --simulate
命令将在开始时生成未满足的依赖错误,因为Debian Bullseye默认软件源中不包含gcc-11依赖包(最新版本是gcc-10),但它们会显示一列缺失的依赖包。如果您进行迭代处理,您将能够安装所有这些缺失的依赖包,以便最后可以无错误地运行 sudo apt install ./g++-11_11.1.0-1ubuntu1~21.04_amd64.deb
。
security.ubuntu.com/ubuntu/pool/universe/g/...
没有ARM64的软件包,为什么呢?我以为ARM64现在已经足够主流了。我想在树莓派上安装一个较新版本的GCC... - Violet Giraffeg++-11,gcc-11可以成功安装到“Debian 11 Bullseye”中。
安装g++-11及其依赖项...
cpp-11_11.1.0-4_amd64.deb
g++-11_11.1.0-4_amd64.deb
gcc-11_11.1.0-4_amd64.deb
gcc-11-base_11.1.0-4_amd64.deb
libasan6_11.1.0-4_amd64.deb
libatomic1_11.1.0-4_amd64.deb
libcc1-0_11.1.0-4_amd64.deb
libgcc-11-dev_11.1.0-4_amd64.deb
libgcc-s1_11.1.0-4_amd64.deb
libgomp1_11.1.0-4_amd64.deb
libitm1_11.1.0-4_amd64.deb
liblsan0_11.1.0-4_amd64.deb
libquadmath0_11.1.0-4_amd64.deb
libstdc++-11-dev_11.1.0-4_amd64.deb
libstdc++6_11.1.0-4_amd64.deb
libtsan0_11.1.0-4_amd64.deb
libubsan1_11.1.0-4_amd64.deb
g++-11 https://packages.debian.org/experimental/g++-11
安装:cd Downloads/
;# apt install ./*
这与你的"Source.list
"有关。
如果你的"source.list"是"Debian 11: 官方源列表":
(Debian 11
源与 g++(gcc)10
)
deb http://deb.debian.org/debian/ bullseye main
deb-src http://deb.debian.org/debian/ bullseye main
deb http://security.debian.org/debian-security bullseye-security main contrib
deb-src http://security.debian.org/debian-security bullseye-security main contrib
deb http://deb.debian.org/debian/ bullseye-updates main contrib
deb-src http://deb.debian.org/debian/ bullseye-updates main contrib
apt-cache madison gcc
"命令:gcc | 4:10.2.1-1 | http://deb.debian.org/debian bullseye/main amd64 Packages
gcc-defaults | 1.190 | http://deb.debian.org/debian bullseye/main Sources
deb http://mirrors.xmission.com/debian/ testing main non-free contrib
deb http://http.us.debian.org/debian testing main contrib non-free
deb http://ftp.us.debian.org/debian testing main non-free contrib
apt-cache madison gcc
" 命令:gcc | 4:11.2.0-2 | http://mirrors.xmission.com/debian testing/main amd64 Packages
gcc | 4:11.2.0-2 | http://http.us.debian.org/debian testing/main amd64 Packages
gcc | 4:11.2.0-2 | http://ftp.us.debian.org/debian testing/main amd64 Packages
如果你想把 Debian 11
中的 GCC
从版本 10
切换到版本 11
,
你需要在你的 Debian
的 "source.list" 文件中进行修改。
只需按以下步骤执行:
cd /etc/apt/ && sudo nano sources.list
然后,更改"source.list"
并添加一个源,该源可以帮助您下载g++(gcc)11
。请使用以下内容替换您的Debian源或官方源:
deb http://mirrors.xmission.com/debian/ testing main non-free contrib
deb http://http.us.debian.org/debian testing main contrib non-free
deb http://ftp.us.debian.org/debian testing main non-free contrib
g++11
,需要在sources.list
中进行哪些更改? - NawazGCC10
。目前官方源不支持 GCC11
。因此,如果需要 GCC11
,我们需要寻找其他的 Debian 源。我现在已经补充了我的回答。这次我表述清楚了吗?谢谢! - Vittore Marcas看起来你需要安装 bookworm (testing)
才能安装这个软件包。
请参考以下链接:
https://packages.debian.org/search?suite=bullseye&keywords=gcc-11
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gcc-12/g++-12_12.2.0-14_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gcc-12/cpp-12_12.2.0-14_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gcc-12/gcc-12-base_12.2.0-14_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gcc-12/gcc-12_12.2.0-14_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gcc-12/libgcc-12-dev_12.2.0-14_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gcc-12/libstdc++-12-dev_12.2.0-14_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gcc-12/libasan8_12.2.0-14_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gcc-12/libtsan2_12.2.0-14_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gcc-12/libcc1-0_12.2.0-14_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gcc-12/libitm1_12.2.0-14_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gcc-12/libatomic1_12.2.0-14_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gcc-12/liblsan0_12.2.0-14_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gcc-12/libubsan1_12.2.0-14_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gcc-12/libquadmath0_12.2.0-14_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gcc-12/libgcc-s1_12.2.0-14_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gcc-12/libgomp1_12.2.0-14_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gcc-12/libstdc++6_12.2.0-14_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/glibc/libc6_2.36-9_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/glibc/libc6-dev_2.36-9_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/glibc/libc-dev-bin_2.36-9_amd64.deb
RUN wget -q -P ./locales ftp.de.debian.org/debian/pool/main/g/glibc/locales-all_2.36-9_amd64.deb
RUN wget -q -P ./locales ftp.de.debian.org/debian/pool/main/g/glibc/libc-l10n_2.36-9_all.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/glibc/libc-bin_2.36-9_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/b/binutils/binutils_2.40.50.20230611-2_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/b/binutils/binutils-common_2.40.50.20230611-2_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/b/binutils/libbinutils_2.40.50.20230611-2_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/b/binutils/binutils-x86-64-linux-gnu_2.40.50.20230611-2_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/b/binutils/libctf-nobfd0_2.40.50.20230611-2_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/b/binutils/libctf0_2.40.50.20230611-2_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/b/binutils/libgprofng0_2.40.50.20230611-2_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/libz/libzstd/libzstd1_1.5.4+dfsg2-5_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/j/jansson/libjansson4_2.14-2_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/g/gmp/libgmp10_6.2.1+dfsg1-1.1_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/r/rpcsvc-proto/rpcsvc-proto_1.4.3-1_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/i/isl/libisl23_0.23-1_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/m/mpclib3/libmpc3_1.1.0-1_amd64.deb
RUN wget -q -P ./deb ftp.de.debian.org/debian/pool/main/m/mpfr4/libmpfr6_4.0.2-1_amd64.deb
RUN apt-get purge -y locales
RUN apt install --simulate ./deb/*.deb
RUN cd locales && dpkg --auto-deconfigure -R --install .
RUN cd deb && dpkg --auto-deconfigure -R --install . || apt install -y locales
RUN dpkg --configure -a