File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,10 +12,16 @@ source "$SCRIPT_DIR/libs/linuxtoys.lib"
1212_lang_
1313sudo_rq
1414if is_debian; then
15- debian_ver=$( lsb_release -rs 2> /dev/null)
1615 prep_tmp
17- pkg_install gcc lsb-release software-properties-common
18- sudo add-apt-repository contrib
16+ pkg_install gcc lsb-release
17+ debian_ver=$( lsb_release -rs 2> /dev/null)
18+ if [ -f /etc/apt/sources.list.d/debian.sources ]; then
19+ sudo sed -i ' s/^Components: \(.*\)main$/Components: \1main contrib non-free/' /etc/apt/sources.list.d/debian.sources
20+ else
21+ sudo sed -i ' s/^deb http:\/\/\([^ ]*\) \([^ ]*\) main$/deb http:\/\/\1 \2 main contrib non-free/' /etc/apt/sources.list
22+ sudo sed -i ' s/^deb-src http:\/\/\([^ ]*\) \([^ ]*\) main$/deb-src http:\/\/\1 \2 main contrib non-free/' /etc/apt/sources.list
23+ fi
24+ sudo apt update
1925 wget " https://developer.download.nvidia.com/compute/cuda/repos/debian${debian_ver:- trixie} /x86_64/cuda-keyring_1.1-1_all.deb"
2026 pkg_fromfile cuda-keyring_1.1-1_all.deb
2127 sleep 1
Original file line number Diff line number Diff line change @@ -13,9 +13,15 @@ source "$SCRIPT_DIR/libs/linuxtoys.lib"
1313_lang_
1414sudo_rq
1515prep_tmp
16- pkg_install gcc lsb-release software-properties-common
16+ pkg_install gcc lsb-release
17+ if [ -f /etc/apt/sources.list.d/debian.sources ]; then
18+ sudo sed -i ' s/^Components: \(.*\)main$/Components: \1main contrib non-free/' /etc/apt/sources.list.d/debian.sources
19+ else
20+ sudo sed -i ' s/^deb http:\/\/\([^ ]*\) \([^ ]*\) main$/deb http:\/\/\1 \2 main contrib non-free/' /etc/apt/sources.list
21+ sudo sed -i ' s/^deb-src http:\/\/\([^ ]*\) \([^ ]*\) main$/deb-src http:\/\/\1 \2 main contrib non-free/' /etc/apt/sources.list
22+ fi
23+ sudo apt update
1724debian_ver=$( lsb_release -rs 2> /dev/null)
18- sudo add-apt-repository contrib
1925wget " https://developer.download.nvidia.com/compute/cuda/repos/debian$debian_ver /x86_64/cuda-keyring_1.1-1_all.deb"
2026pkg_fromfile cuda-keyring_1.1-1_all.deb
2127sleep 1
You can’t perform that action at this time.
0 commit comments