@@ -38,18 +38,6 @@ if [ "${architecture}" != "amd64" ] && [ "${architecture}" != "arm64" ]; then
38
38
exit 1
39
39
fi
40
40
41
- # Only debian testing supports arm64
42
- # shellcheck source=/dev/null
43
- source /etc/os-release
44
- if [ " ${ID} " = " ubuntu" ] && [ " ${architecture} " != " amd64" ]; then
45
- echo " (!) Ubuntu $architecture unsupported"
46
- exit 1
47
- fi
48
- if [ " ${ID} " = " debian" ] && [ " ${architecture} " != " amd64" ] && [ " ${USE_TESTING} " != " true" ]; then
49
- echo " (!) To use Debian $architecture , please set useTesting option to true"
50
- exit 1
51
- fi
52
-
53
41
# Determine the appropriate non-root user
54
42
if [ " ${USERNAME} " = " auto" ] || [ " ${USERNAME} " = " automatic" ]; then
55
43
USERNAME=" "
@@ -144,13 +132,15 @@ usermod -a -G staff "${USERNAME}"
144
132
145
133
check_packages curl ca-certificates
146
134
135
+ # shellcheck source=/dev/null
136
+ source /etc/os-release
147
137
if [ " ${ID} " = " ubuntu" ]; then
148
138
echo " Set up for Ubuntu..."
149
139
curl -fsSL https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc > /dev/null
150
- echo " deb [arch=amd64] https://cloud.r-project.org/bin/linux/ubuntu ${UBUNTU_CODENAME} -cran40/" > /etc/apt/sources.list.d/cran-ubuntu.list
140
+ echo " deb https://cloud.r-project.org/bin/linux/ubuntu ${UBUNTU_CODENAME} -cran40/" > /etc/apt/sources.list.d/cran-ubuntu.list
151
141
echo " Set up r2u..."
152
142
curl -fsSL https://eddelbuettel.github.io/r2u/assets/dirk_eddelbuettel_key.asc | tee -a /etc/apt/trusted.gpg.d/cranapt_key.asc > /dev/null
153
- echo " deb [arch=amd64] https://r2u.stat.illinois.edu/ubuntu ${UBUNTU_CODENAME} main" > /etc/apt/sources.list.d/cranapt.list
143
+ echo " deb https://r2u.stat.illinois.edu/ubuntu ${UBUNTU_CODENAME} main" > /etc/apt/sources.list.d/cranapt.list
154
144
# Pinning
155
145
cat << EOF >"/etc/apt/preferences.d/99cranapt"
156
146
Package: *
@@ -167,7 +157,7 @@ elif [ "${ID}" = "debian" ]; then
167
157
else
168
158
echo " Set up for Debian ${VERSION_CODENAME} ..."
169
159
curl -fsSL " https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x95c0faf38db3ccad0c080a7bdc78b2ddeabc47b7" | tee -a /etc/apt/trusted.gpg.d/cran_debian_key.asc > /dev/null
170
- echo " deb [arch=amd64] http://cloud.r-project.org/bin/linux/debian ${VERSION_CODENAME} -cran40/" > /etc/apt/sources.list.d/cran-debian.list
160
+ echo " deb http://cloud.r-project.org/bin/linux/debian ${VERSION_CODENAME} -cran40/" > /etc/apt/sources.list.d/cran-debian.list
171
161
fi
172
162
# On Debian, renv, languageserver and httpgd are not available via apt
173
163
# shellcheck disable=SC2206
@@ -176,6 +166,10 @@ elif [ "${ID}" = "debian" ]; then
176
166
APT_PACKAGES=(${APT_PACKAGES[@]/ r-cran-languageserver} )
177
167
# shellcheck disable=SC2206
178
168
APT_PACKAGES=(${APT_PACKAGES[@]/ r-cran-httpgd} )
169
+ else
170
+ echo " (!) Unsupported distribution: ${ID} "
171
+ echo " This script is designed only for Debian and Ubuntu."
172
+ exit 1
179
173
fi
180
174
181
175
apt-get update -y
0 commit comments