Skip to content

Commit 1bd8842

Browse files
Remove testing packages and add nvidia-driver
1 parent a691d8c commit 1bd8842

File tree

1 file changed

+14
-96
lines changed

1 file changed

+14
-96
lines changed
Lines changed: 14 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#!/bin/bash
22
# ─────────────────────────────────────────────────────────────
3-
# TriOS GPU Driver Installer (v6.1 - Hotfix)
4-
# Safely installs and maintains up-to-date GPU drivers
5-
# Supports all hybrid GPU setups (Intel+NVIDIA, AMD+NVIDIA, AMD+Intel)
3+
# TriOS GPU Driver Installer (v7 - Compatibility)
4+
# Safely installs GPU drivers
5+
# Supports NVIDIA, AMD, Intel, and all hybrid combinations
66
# Designed for Debian 13 "Trixie" (Stable)
7-
# Only GPU-related packages are allowed from Debian Testing
7+
# No repositories added; installs GPU drivers directly
88
# ─────────────────────────────────────────────────────────────
99

1010
set -e
1111

12-
echo "=== TriOS GPU Driver Installer v6 ==="
12+
echo "=== TriOS GPU Driver Installer v7 ==="
1313
echo
1414
echo "Supports NVIDIA, AMD, Intel, and all hybrid combinations."
15-
echo "Stable base preserved; GPU drivers sourced safely from Testing."
15+
echo "No external repositories added, drivers installed directly."
1616
echo
1717
read -rp "Press any key to continue, or Ctrl+C to cancel... " -n1 -s
1818
echo -e "\n"
@@ -24,67 +24,11 @@ if [ "$EUID" -ne 0 ]; then
2424
fi
2525

2626
# ─── Helper Functions ────────────────────────────────────────
27-
add_repo() {
28-
local _file="$1"
29-
local _marker="$2"
30-
local _content="$3"
31-
if ! grep -Rq "$_marker" /etc/apt/sources.list*; then
32-
echo "[*] Adding repository: $_marker"
33-
echo "$_content" > "/etc/apt/sources.list.d/${_file}.list"
34-
_needs_update=true
35-
fi
36-
}
37-
38-
prompt_yn() {
39-
local _prompt="$1"
40-
read -rp "$_prompt [y/N]: " _ans
41-
[[ "$_ans" =~ ^[Yy]$ ]]
42-
}
43-
4427
install_pkg() {
4528
local _pkg="$1"
46-
dpkg -s "$_pkg" &>/dev/null || apt-get install -y "$_pkg"
29+
dpkg -s "$_pkg" &>/dev/null || apt-get install -y --install-recommends "$_pkg"
4730
}
4831

49-
# ─── Enable 32-bit Multiarch ─────────────────────────────────
50-
if ! dpkg --print-foreign-architectures | grep -q i386; then
51-
echo "[*] Enabling 32-bit multiarch support..."
52-
dpkg --add-architecture i386
53-
_needs_update=true
54-
fi
55-
56-
# ─── Repositories ────────────────────────────────────────────
57-
echo "[*] Ensuring Debian repositories are configured..."
58-
59-
add_repo "testing" "deb.debian.org/debian testing" \
60-
"deb http://deb.debian.org/debian testing main contrib non-free non-free-firmware"
61-
62-
# ─── Strict APT Pinning ──────────────────────────────────────
63-
cat >/etc/apt/preferences.d/gpu-drivers.pref <<'EOF'
64-
# Default: Debian Stable (Trixie)
65-
Package: *
66-
Pin: release a=trixie
67-
Pin-Priority: 990
68-
69-
# Testing disabled by default
70-
Package: *
71-
Pin: release a=testing
72-
Pin-Priority: 100
73-
74-
# GPU packages allowed from Testing
75-
Package: nvidia-driver nvidia-settings nvidia-kernel-dkms libnvidia-gl* \
76-
libnvidia-egl* libnvidia-compute* libnvidia-encode* libnvidia-decode* \
77-
mesa* libgl1-mesa* libegl* libgbm* vulkan* firmware-amd* firmware-linux* \
78-
intel-media* xserver-xorg-video-intel libvulkan* libdrm* clinfo \
79-
amd64-microcode intel-microcode
80-
Pin: release a=testing
81-
Pin-Priority: 900
82-
EOF
83-
84-
# ─── Update Once ─────────────────────────────────────────────
85-
apt-get update -y
86-
apt-get upgrade -y
87-
8832
# ─── Base Utilities ──────────────────────────────────────────
8933
install_pkg pciutils
9034
install_pkg curl
@@ -115,50 +59,25 @@ install_nvidia() {
11559

11660
echo "[*] Installing driver package: $_driver"
11761

118-
# Install all NVIDIA packages from Testing together to satisfy dependencies
119-
apt-get install -y -t testing \
120-
"$_driver" \
121-
nvidia-driver-libs \
122-
nvidia-driver-bin \
123-
xserver-xorg-video-nvidia \
124-
nvidia-alternative \
125-
nvidia-vdpau-driver \
126-
nvidia-persistenced \
127-
nvidia-settings \
128-
nvidia-smi \
129-
nvidia-vulkan-icd \
130-
libcuda1 libcuda1:i386 \
131-
libegl-nvidia0 libegl-nvidia0:i386 \
132-
libgl1-nvidia-glvnd-glx libgl1-nvidia-glvnd-glx:i386 \
133-
libgles-nvidia1 libgles-nvidia1:i386 \
134-
libgles-nvidia2 libgles-nvidia2:i386 \
135-
libnvcuvid1 libnvcuvid1:i386 \
136-
nvidia-kernel-dkms nvidia-kernel-support \
137-
nvidia-modprobe \
138-
console-setup console-setup-linux kbd keyboard-configuration || true
62+
# Install the nvidia-driver package and other recommended NVIDIA packages
63+
apt-get install -y --install-recommends nvidia-driver nvidia-driver-libs nvidia-driver-bin xserver-xorg-video-nvidia nvidia-settings nvidia-smi
13964
}
14065

141-
142-
14366
install_amd() {
14467
echo "[*] Installing AMD drivers..."
145-
apt-get install -y -t testing mesa-vulkan-drivers mesa-opencl-icd clinfo \
146-
vulkan-validationlayers mesa-vulkan-drivers:i386 mesa-opencl-icd:i386 \
147-
firmware-amd-graphics
68+
apt-get install -y --install-recommends mesa-vulkan-drivers mesa-opencl-icd clinfo vulkan-validationlayers
14869
}
14970

15071
install_intel() {
15172
echo "[*] Installing Intel drivers..."
152-
apt-get install -y -t testing xserver-xorg-video-intel \
153-
intel-media-va-driver-non-free intel-gpu-tools \
154-
mesa-vulkan-drivers mesa-vulkan-drivers:i386
73+
apt-get install -y --install-recommends xserver-xorg-video-intel intel-media-va-driver-non-free intel-gpu-tools mesa-vulkan-drivers
15574
}
15675

15776
configure_hybrid() {
15877
echo "[*] Configuring hybrid GPU environment..."
15978

160-
# Always install hybrid control tools (nvidia-prime removed)
161-
apt-get install -y switcheroo-control bbswitch-dkms
79+
# Always install hybrid control tools
80+
apt-get install -y --install-recommends switcheroo-control bbswitch-dkms
16281

16382
# Detect combo type
16483
if $HAS_NVIDIA && $HAS_INTEL; then
@@ -174,7 +93,6 @@ configure_hybrid() {
17493
}
17594

17695
# ─── Install in Safe Order ───────────────────────────────────
177-
# Mesa first, proprietary last
17896
if $HAS_INTEL; then install_intel; fi
17997
if $HAS_AMD; then install_amd; fi
18098
if $HAS_NVIDIA; then install_nvidia; fi
@@ -190,5 +108,5 @@ apt-get clean
190108

191109
echo
192110
echo "=== GPU Driver Installation Complete ==="
193-
echo "Stable base preserved — hybrid setups configured automatically."
111+
echo "Hybrid setups configured automatically."
194112
echo "Reboot to apply changes."

0 commit comments

Comments
 (0)