@@ -33,6 +33,7 @@ function check_system() {
3333 case " $VERSION_CODENAME " in
3434 " bionic" )
3535 GCC_VERSION=" 9"
36+ LLVM_VERSION=" 18"
3637 NODE_DISTRO=" $VERSION_CODENAME "
3738 NODE_KEY=" nodesource.gpg.key"
3839 NODE_VERSION=" 18"
@@ -44,32 +45,44 @@ function check_system() {
4445 DISTRO_PREFIX=" debian-archive/"
4546 DISTRO_SECUTIRY_PATH=" buster/updates"
4647 GCC_VERSION=" 8"
48+ LLVM_VERSION=" 18"
4749 UBUNTU_CODENAME=" bionic"
4850 VERSION_PACKAGE=" lib32gcc1 python2"
4951 ;;
5052 " focal" |\
5153 " jammy" )
5254 GCC_VERSION=" 9"
55+ LLVM_VERSION=" 18"
5356 UBUNTU_CODENAME=" $VERSION_CODENAME "
5457 VERSION_PACKAGE=" lib32gcc-s1 python2"
5558 ;;
5659 " bullseye" )
5760 BPO_FLAG=" -t $VERSION_CODENAME -backports"
5861 GCC_VERSION=" 9"
62+ LLVM_VERSION=" 18"
5963 UBUNTU_CODENAME=" focal"
6064 VERSION_PACKAGE=" lib32gcc-s1 python2"
6165 ;;
6266 " bookworm" )
6367 BPO_FLAG=" -t $VERSION_CODENAME -backports"
6468 GCC_VERSION=" 12"
69+ LLVM_VERSION=" 18"
6570 UBUNTU_CODENAME=" jammy"
6671 VERSION_PACKAGE=" lib32gcc-s1"
6772 ;;
6873 " noble" )
6974 GCC_VERSION=" 13"
75+ LLVM_VERSION=" 18"
7076 UBUNTU_CODENAME=" $VERSION_CODENAME "
7177 VERSION_PACKAGE=" lib32gcc-s1"
7278 ;;
79+ " trixie" )
80+ BPO_FLAG=" -t $VERSION_CODENAME -backports"
81+ GCC_VERSION=" 13"
82+ LLVM_VERSION=" 18"
83+ UBUNTU_CODENAME=" noble"
84+ VERSION_PACKAGE=" lib32gcc-s1"
85+ ;;
7386 * )
7487 __error_msg " Unsupported OS, use Ubuntu 20.04 instead."
7588 exit 1
@@ -97,6 +110,7 @@ function update_apt_source() {
97110 apt install -y apt-transport-https gnupg2
98111 if [ -n " $CHN_NET " ]; then
99112 mv " /etc/apt/sources.list" " /etc/apt/sources.list.bak"
113+ mv " /etc/apt/sources.list.d/debian.sources" " /etc/apt/sources.list.d/debian.sources.bak"
100114 if [ " $VERSION_CODENAME " == " $UBUNTU_CODENAME " ]; then
101115 cat << -EOF >"/etc/apt/sources.list"
102116 deb https://repo.huaweicloud.com/ubuntu/ $VERSION_CODENAME main restricted universe multiverse
@@ -159,11 +173,14 @@ function update_apt_source() {
159173 EOF
160174 curl -fsL " https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xe1dd270288b4e6030699e45fa1715d88e1df1f24" -o " /etc/apt/trusted.gpg.d/git-core-ubuntu-ppa.asc"
161175
162- cat << -EOF >"/etc/apt/sources.list.d/llvm-toolchain.list"
163- deb https://apt.llvm.org/$VERSION_CODENAME / llvm-toolchain-$VERSION_CODENAME -18 main
164- deb-src https://apt.llvm.org/$VERSION_CODENAME / llvm-toolchain-$VERSION_CODENAME -18 main
165- EOF
166- curl -fsL " https://apt.llvm.org/llvm-snapshot.gpg.key" -o " /etc/apt/trusted.gpg.d/llvm-toolchain.asc"
176+ # TODO: remove this once llvm-toolchain provides trixie package
177+ if [ " $VERSION_CODENAME " != " trixie" ]; then
178+ cat << -EOF >"/etc/apt/sources.list.d/llvm-toolchain.list"
179+ deb https://apt.llvm.org/$VERSION_CODENAME / llvm-toolchain-$VERSION_CODENAME -$LLVM_VERSION main
180+ deb-src https://apt.llvm.org/$VERSION_CODENAME / llvm-toolchain-$VERSION_CODENAME -$LLVM_VERSION main
181+ EOF
182+ curl -fsL " https://apt.llvm.org/llvm-snapshot.gpg.key" -o " /etc/apt/trusted.gpg.d/llvm-toolchain.asc"
183+ fi
167184
168185 cat << -EOF >"/etc/apt/sources.list.d/longsleep-ubuntu-golang-backports-$UBUNTU_CODENAME .list"
169186 deb https://ppa.launchpadcontent.net/longsleep/golang-backports/ubuntu $UBUNTU_CODENAME main
@@ -181,6 +198,16 @@ function update_apt_source() {
181198 sed -i " s,ppa.launchpadcontent.net,launchpad.proxy.ustclug.org,g" " /etc/apt/sources.list.d" /*
182199 fi
183200
201+ # TODO: remove this once git-core and golang PPA update signing key
202+ case " $VERSION_CODENAME " in
203+ " trixie" )
204+ cat << -EOF > "/etc/apt/apt.conf.d/99insecure-signatures"
205+ Acquire::AllowInsecureRepositories "true";
206+ Acquire::AllowDowngradeToInsecureRepositories "true";
207+ EOF
208+ ;;
209+ esac
210+
184211 apt update -y $BPO_FLAG
185212
186213 set +x
@@ -192,17 +219,17 @@ function install_dependencies() {
192219 apt full-upgrade -y $BPO_FLAG
193220 apt install -y $BPO_FLAG ack antlr3 asciidoc autoconf automake autopoint binutils bison \
194221 build-essential bzip2 ccache cmake cpio curl device-tree-compiler ecj fakeroot \
195- fastjar flex gawk gettext genisoimage git gnutls-dev gperf haveged help2man \
196- intltool irqbalance jq libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev \
197- libltdl-dev libmpc-dev libmpfr-dev libncurses-dev libreadline-dev libssl-dev \
198- libtool libyaml-dev libz-dev lrzsz msmtp nano ninja-build p7zip p7zip-full patch \
199- pkgconf libpython3-dev python3 python3-pip python3-cryptography python3-docutils \
222+ fastjar flex gawk gettext genisoimage gnutls-dev gperf haveged help2man intltool \
223+ irqbalance jq libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl -dev \
224+ libmpc-dev libmpfr-dev libncurses-dev libreadline-dev libssl-dev libtool \
225+ libyaml-dev libz-dev lrzsz msmtp nano ninja-build p7zip p7zip-full patch pkgconf \
226+ libpython3-dev python3 python3-pip python3-cryptography python3-docutils \
200227 python3-ply python3-pyelftools python3-requests qemu-utils quilt re2c rsync scons \
201228 sharutils squashfs-tools subversion swig texinfo uglifyjs unzip vim wget xmlto \
202229 zlib1g-dev zstd xxd $VERSION_PACKAGE
203230
204231 # fix broken http2 support for curl on buster
205- if [ " $VERSION_CODENAME " == " buster" ]; then
232+ if [ " $VERSION_CODENAME " == " buster" ]; then
206233 apt full-upgrade -y
207234 apt reinstall -y libcurl3-gnutls/buster
208235 fi
@@ -212,30 +239,32 @@ function install_dependencies() {
212239 pip3 config set install.trusted-host " https://mirrors.aliyun.com"
213240 fi
214241
242+ apt install -y --allow-unauthenticated $BPO_FLAG git
243+
215244 apt install -y $BPO_FLAG " gcc-$GCC_VERSION " " g++-$GCC_VERSION " " gcc-$GCC_VERSION -multilib" " g++-$GCC_VERSION -multilib"
216245 for i in " gcc-$GCC_VERSION " " g++-$GCC_VERSION " " gcc-ar-$GCC_VERSION " " gcc-nm-$GCC_VERSION " " gcc-ranlib-$GCC_VERSION " ; do
217246 ln -svf " $i " " /usr/bin/${i% -$GCC_VERSION } "
218247 done
219248 ln -svf " /usr/bin/g++" " /usr/bin/c++"
220249 [ -e " /usr/include/asm" ] || ln -svf " /usr/include/$( gcc -dumpmachine) /asm" " /usr/include/asm"
221250
222- apt install -y $BPO_FLAG clang-18 libclang-18 -dev lld-18 liblld-18 -dev
223- for i in " clang-18 " " clang++-18 " " clang-cpp-18 " " ld.lld-18 " " ld64.lld-18 " " llc-18 " " lld-18 " " lld-link-18 " " opt-18 " " wasm-ld-18 " ; do
224- ln -svf " $i " " /usr/bin/${i% -18 } "
251+ apt install -y $BPO_FLAG " clang-$LLVM_VERSION " " libclang-$LLVM_VERSION -dev" " lld-$LLVM_VERSION " " liblld-$LLVM_VERSION -dev"
252+ for i in " clang-$LLVM_VERSION " " clang++-$LLVM_VERSION " " clang-cpp-$LLVM_VERSION " " ld.lld-$LLVM_VERSION " " ld64.lld-$LLVM_VERSION " " llc-$LLVM_VERSION " " lld-$LLVM_VERSION " " lld-link-$LLVM_VERSION " " opt-$LLVM_VERSION " " wasm-ld-$LLVM_VERSION " ; do
253+ ln -svf " $i " " /usr/bin/${i% -$LLVM_VERSION } "
225254 done
226255
227- apt install -y $BPO_FLAG llvm-18
228- for i in " /usr/bin" /llvm-* -18 ; do
229- ln -svf " $i " " ${i% -18 } "
256+ apt install -y $BPO_FLAG " llvm-$LLVM_VERSION "
257+ for i in " /usr/bin" /llvm-* -" $LLVM_VERSION " ; do
258+ ln -svf " $i " " ${i% -$LLVM_VERSION } "
230259 done
231260
232- apt install -y $BPO_FLAG nodejs yarn
261+ apt install -y --allow-unauthenticated $BPO_FLAG nodejs yarn
233262 if [ -n " $CHN_NET " ]; then
234263 npm config set registry " https://registry.npmmirror.com" --global
235264 yarn config set registry " https://registry.npmmirror.com" --global
236265 fi
237266
238- apt install -y $BPO_FLAG golang-1.25-go
267+ apt install -y --allow-unauthenticated $BPO_FLAG golang-1.25-go
239268 rm -rf " /usr/bin/go" " /usr/bin/gofmt"
240269 ln -svf " /usr/lib/go-1.25/bin/go" " /usr/bin/go"
241270 ln -svf " /usr/lib/go-1.25/bin/gofmt" " /usr/bin/gofmt"
0 commit comments