Skip to content

Instantly share code, notes, and snippets.

@ar-lex
Created July 18, 2025 21:38
Show Gist options
  • Save ar-lex/8dd947f4968f15d758d13a3854af171b to your computer and use it in GitHub Desktop.
Save ar-lex/8dd947f4968f15d758d13a3854af171b to your computer and use it in GitHub Desktop.
Latest VSCodium installation/upgrade from .deb for local user
#!/usr/bin/env bash
GITHUB_USER="VSCodium"
GITHUB_REPO="vscodium"
DL_DIR=$HOME/.cache/vscodium
verify_checksum(){
if [ $(sha256sum ${DL_DIR}/codium.deb | cut -d" " -f1) == ${file_sha256sum} ]; then
echo "Checksum is valid."
return 0
else
echo "Checksum is invalid."
return 1
fi
}
download_file(){
echo "Downloading ..."
curl --silent --location --output ${DL_DIR}/codium.deb https://github.com/${GITHUB_USER}/${GITHUB_REPO}/releases/download/${version}/${filename}
if verify_checksum; then
return 0
else
echo "Can't download valid file."
return 1
fi
}
version=$(basename $(curl --silent --location --output /dev/null --write-out %{url_effective} https://github.com/${GITHUB_USER}/${GITHUB_REPO}/releases/latest))
filename="codium_${version}_amd64.deb"
echo "Downloading ${filename} checksum ..."
file_sha256sum=$(curl --silent --location --output - https://github.com/${GITHUB_USER}/${GITHUB_REPO}/releases/download/${version}/${filename}.sha256 | cut -d" " -f1)
mkdir -p ${DL_DIR}/extracted
if ! [ -f ${DL_DIR}/codium.deb ]; then
echo "File does not exist."
if download_file; then
echo "Extracting ..."
else
echo "Exiting ..."
exit 1
fi
else
echo "File exists."
if verify_checksum; then
echo "Extracting ..."
else
if download_file; then
echo "Extracting ..."
else
echo "Exiting ..."
exit 1
fi
fi
fi
ar x --output=${DL_DIR}/extracted ${DL_DIR}/codium.deb
tar --extract --file ${DL_DIR}/extracted/data.tar.xz --directory ${DL_DIR}/extracted
echo "Installing application data ..."
mkdir -p ${HOME}/.local/share/{applications,pixmaps}
rm -rf ${HOME}/.local/share/codium
mv ${DL_DIR}/extracted/usr/share/codium ${HOME}/.local/share/
ln -sf ../share/codium/codium ${HOME}/.local/bin/codium
mkdir -p ${HOME}/.local/share/pixmaps
mv ${DL_DIR}/extracted/usr/share/pixmaps/vscodium.png ${HOME}/.local/share/pixmaps/
echo "Patching and installing desktop files ..."
sed -i 's;Exec=/usr/share/codium/codium;Exec=codium --ozone-platform-hint=auto --no-sandbox;g' ${DL_DIR}/extracted/usr/share/applications/*.desktop
mv ${DL_DIR}/extracted/usr/share/applications/*.desktop ${HOME}/.local/share/applications/
@ar-lex
Copy link
Author

ar-lex commented Jul 18, 2025

Download and install simultaneously:

curl -sSL https://gist.github.com/ar-lex/8dd947f4968f15d758d13a3854af171b/raw/vscodium-install.sh | sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment