Skip to content

Instantly share code, notes, and snippets.

@nedix
Last active December 31, 2023 18:18
Show Gist options
  • Save nedix/b5d868044205642376085ccf51be0b76 to your computer and use it in GitHub Desktop.
Save nedix/b5d868044205642376085ccf51be0b76 to your computer and use it in GitHub Desktop.
Aptitude firefox snapshot install
#!/usr/bin/env sh
FIREFOX_VERSION=117.0.1-1
test -n "$ARCHITECTURE" || case $(uname -m) in \
amd64|x86_64) ARCHITECTURE=amd64; ;; \
arm64|aarch64|armv8b|armv8l) ARCHITECTURE=arm64; ;; \
*) echo "Unsupported architecture, exiting..."; exit 1; ;; \
esac \
&& echo "deb http://deb.debian.org/debian stable main" > /etc/apt/sources.list \
&& echo "deb http://deb.debian.org/debian unstable main" >> /etc/apt/sources.list \
&& apt update \
&& apt install -t stable -y $BUILD_DEPS \
&& FIREFOX_INFO=$(curl -s "https://snapshot.debian.org/mr/binary/firefox/${FIREFOX_VERSION}/binfiles?fileinfo=1" \
| jq -r '.fileinfo as $fileinfo | .result[] | select(.architecture == "'"$ARCHITECTURE"'") | .hash as $hash | $fileinfo[$hash][0] | $hash + " " + .name') \
&& FIREFOX_HASH="${FIREFOX_INFO%% *}" \
&& FIREFOX_FILE="${FIREFOX_INFO#* }" \
&& curl -sSL "https://snapshot.debian.org/file/${FIREFOX_HASH}" -o "$FIREFOX_FILE" \
&& apt install -y "./${FIREFOX_FILE}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment