-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-steamcmd.sh
More file actions
84 lines (74 loc) · 3.2 KB
/
install-steamcmd.sh
File metadata and controls
84 lines (74 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# scriptlet:_common/os_like.sh
# scriptlet:_common/os_version.sh
# scriptlet:_common/download.sh
##
# Install SteamCMD
#
# CHANGELOG:
#
# 2025.12.16 - Ensure steam GPG key is readable by apt
# 2025.11.09 - Switch to using download to support curl/wget abstraction
# 2025.11.03 - Add support for Debian 13
# 2024.12.23 - Add support for non-interactive acceptance of Steam license
# 2024.12.22 - Initial version
#
function install_steamcmd() {
echo "Installing SteamCMD..."
TYPE_DEBIAN="$(os_like_debian)"
TYPE_UBUNTU="$(os_like_ubuntu)"
OS_VERSION="$(os_version)"
# Preliminary requirements
if [ "$TYPE_UBUNTU" == 1 ]; then
add-apt-repository -y multiverse
dpkg --add-architecture i386
apt update
# By using this script, you agree to the Steam license agreement at https://store.steampowered.com/subscriber_agreement/
# and the Steam privacy policy at https://store.steampowered.com/privacy_agreement/
# Since this is meant to support unattended installs, we will forward your acceptance of their license.
echo steam steam/question select "I AGREE" | debconf-set-selections
echo steam steam/license note '' | debconf-set-selections
apt install -y steamcmd
elif [ "$TYPE_DEBIAN" == 1 ]; then
dpkg --add-architecture i386
apt update
if [ "$OS_VERSION" -le 12 ]; then
apt install -y software-properties-common apt-transport-https dirmngr ca-certificates lib32gcc-s1
# Enable "non-free" repos for Debian (for steamcmd)
# https://stackoverflow.com/questions/76688863/apt-add-repository-doesnt-work-on-debian-12
add-apt-repository -y -U http://deb.debian.org/debian -c non-free-firmware -c non-free
if [ $? -ne 0 ]; then
echo "Workaround failed to add non-free repos, trying new method instead"
apt-add-repository -y non-free
fi
else
# Debian Trixie and later
if [ -e /etc/apt/sources.list ]; then
if ! grep -q ' non-free ' /etc/apt/sources.list; then
sed -i 's/main/main non-free-firmware non-free contrib/g' /etc/apt/sources.list
fi
elif [ -e /etc/apt/sources.list.d/debian.sources ]; then
if ! grep -q ' non-free ' /etc/apt/sources.list.d/debian.sources; then
sed -i 's/main/main non-free-firmware non-free contrib/g' /etc/apt/sources.list.d/debian.sources
fi
else
echo "Could not find a sources.list file to enable non-free repos" >&2
exit 1
fi
fi
# Install steam repo
download http://repo.steampowered.com/steam/archive/stable/steam.gpg /usr/share/keyrings/steam.gpg
chmod +r /usr/share/keyrings/steam.gpg
echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/steam.gpg] http://repo.steampowered.com/steam/ stable steam" > /etc/apt/sources.list.d/steam.list
# By using this script, you agree to the Steam license agreement at https://store.steampowered.com/subscriber_agreement/
# and the Steam privacy policy at https://store.steampowered.com/privacy_agreement/
# Since this is meant to support unattended installs, we will forward your acceptance of their license.
echo steam steam/question select "I AGREE" | debconf-set-selections
echo steam steam/license note '' | debconf-set-selections
# Install steam binary and steamcmd
apt update
apt install -y steamcmd
else
echo 'Unsupported or unknown OS' >&2
exit 1
fi
}