Created
July 18, 2025 21:38
-
-
Save ar-lex/8dd947f4968f15d758d13a3854af171b to your computer and use it in GitHub Desktop.
Latest VSCodium installation/upgrade from .deb for local user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Download and install simultaneously: