Merge branch 'bugfix/KASM-7060-update_chromium_install_logic_develop' into 'develop'

install chromium from debian bookworm repos for ubuntu - develop

Closes KASM-7060

See merge request kasm-technologies/internal/workspaces-images!256
This commit is contained in:
Richard Koliser 2025-03-27 04:44:11 +00:00
commit d0188ada6b
3 changed files with 17 additions and 41 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -ex set -ex
START_COMMAND="chromium-browser" START_COMMAND="chromium"
PGREP="chromium" PGREP="chromium"
MAXIMIZE="true" MAXIMIZE="true"
DEFAULT_ARGS="" DEFAULT_ARGS=""

View File

@ -33,54 +33,30 @@ else
apt-get install -y software-properties-common ttf-mscorefonts-installer apt-get install -y software-properties-common ttf-mscorefonts-installer
apt-get remove -y chromium-browser-l10n chromium-codecs-ffmpeg chromium-browser apt-get remove -y chromium-browser-l10n chromium-codecs-ffmpeg chromium-browser
# Chromium on Ubuntu 19.10 or newer uses snap to install which is not # Install from debian bookworm repos
# currently compatible with docker containers. The new install will pull mkdir -p /etc/apt/keyrings
# deb files from archive.ubuntu.com for ubuntu 18.04 and install them. curl -fsSL https://ftp-master.debian.org/keys/archive-key-12.asc | sudo tee /etc/apt/keyrings/debian-archive-key-12.asc
# This will work until 18.04 goes to an unsupported status. echo "deb [signed-by=/etc/apt/keyrings/debian-archive-key-12.asc] http://deb.debian.org/debian bookworm main" | sudo tee /etc/apt/sources.list.d/debian-bookworm.list
if [ ${ARCH} = 'amd64' ] ; echo -e "Package: *\nPin: release a=bookworm\nPin-Priority: 100" | sudo tee /etc/apt/preferences.d/debian-bookworm
then apt-get update
chrome_url="http://archive.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/" apt install -y chromium --no-install-recommends
else
chrome_url="http://ports.ubuntu.com/pool/universe/c/chromium-browser/"
fi
chromium_codecs_data=$(curl ${chrome_url}) # Cleanup debian bookworm repos
chromium_codecs_data=$(grep "chromium-codecs-ffmpeg-extra_" <<< "${chromium_codecs_data}") rm /etc/apt/sources.list.d/debian-bookworm.list
chromium_codecs_data=$(grep "18\.04" <<< "${chromium_codecs_data}") rm /etc/apt/preferences.d/debian-bookworm
chromium_codecs_data=$(grep "${ARCH}" <<< "${chromium_codecs_data}") rm /etc/apt/keyrings/debian-archive-key-12.asc
chromium_codecs_data=$(sed -n 's/.*<a href="//p' <<< "${chromium_codecs_data}") apt-get update
chromium_codecs_data=$(sed -n 's/">.*//p' <<< "${chromium_codecs_data}")
echo "Chromium codec deb to download: ${chromium_codecs_data}"
chromium_data=$(curl ${chrome_url})
chromium_data=$(grep "chromium-browser_" <<< "${chromium_data}")
chromium_data=$(grep "18\.04" <<< "${chromium_data}")
chromium_data=$(grep "${ARCH}" <<< "${chromium_data}")
chromium_data=$(sed -n 's/.*<a href="//p' <<< "${chromium_data}")
chromium_data=$(sed -n 's/">.*//p' <<< "${chromium_data}")
echo "Chromium browser deb to download: ${chromium_data}"
echo "The things to download"
echo "${chrome_url}${chromium_codecs_data}"
echo "${chrome_url}${chromium_data}"
wget "${chrome_url}${chromium_codecs_data}"
wget "${chrome_url}${chromium_data}"
apt-get install -y ./"${chromium_codecs_data}"
apt-get install -y ./"${chromium_data}"
rm "${chromium_codecs_data}"
rm "${chromium_data}"
if [ -z ${SKIP_CLEAN+x} ]; then if [ -z ${SKIP_CLEAN+x} ]; then
apt-get autoclean apt-get autoclean
rm -rf \ rm -rf \
/var/lib/apt/lists/* \ /var/lib/apt/lists/* \
/var/tmp/* /var/tmp/*
fi fi
fi fi
if grep -q "ID=debian" /etc/os-release || grep -q "ID=kali" /etc/os-release || grep -q "ID=parrot" /etc/os-release; then if grep -q "ID=debian" /etc/os-release || grep -q "ID=kali" /etc/os-release || grep -q "ID=parrot" /etc/os-release || grep -q "ID=ubuntu" /etc/os-release; then
REAL_BIN=chromium REAL_BIN=chromium
else else
REAL_BIN=chromium-browser REAL_BIN=chromium-browser
@ -113,7 +89,7 @@ fi
EOL EOL
chmod +x /usr/bin/${REAL_BIN} chmod +x /usr/bin/${REAL_BIN}
if [ "${DISTRO}" != "opensuse" ] && ! grep -q "ID=debian" /etc/os-release && ! grep -q "ID=kali" /etc/os-release && ! grep -q "ID=parrot" /etc/os-release; then if [ "${DISTRO}" != "opensuse" ] && ! grep -q "ID=debian" /etc/os-release && ! grep -q "ID=kali" /etc/os-release && ! grep -q "ID=parrot" /etc/os-release && ! grep -q "ID=ubuntu" /etc/os-release; then
cp /usr/bin/chromium-browser /usr/bin/chromium cp /usr/bin/chromium-browser /usr/bin/chromium
fi fi

View File

@ -23,7 +23,7 @@ else
apt-get install -y software-properties-common apt-get install -y software-properties-common
add-apt-repository -y ppa:nextcloud-devs/client add-apt-repository -y ppa:nextcloud-devs/client
apt update apt update
apt install -y nextcloud-client apt install -y nextcloud-desktop
if [ -z ${SKIP_CLEAN+x} ]; then if [ -z ${SKIP_CLEAN+x} ]; then
apt-get autoclean apt-get autoclean
rm -rf \ rm -rf \