Skip to content

Instantly share code, notes, and snippets.

Last active Aug 23, 2017
What would you like to do?
AlpineLinux: Fix LaTex
# Simple script used to get the latest laTeX package working with Alpine
# It assumes that testing repository is already added.
# If not:
# echo "" >> /etc/apk/repositories && apk update
# (c) 2017 Francesco Colista
# Email:
URL="$(date +%Y)/"
apk info -qe texlive-full || apk add texlive-full
apk info -qe curl || apk add curl
mkdir -p $TMP && cd $TMP
curl -s $URL > /dev/null
if [ $? -ne "0" ]; then
URL="$(date --date '-1 year' +%Y)/"
latest_tlmgr=$(curl -s $URL | grep texmf | grep -v sha | awk '{print $9}')
latest_tlmgr_sum=$(curl -s $URL | grep texmf | grep sha512 | head -1 | awk '{print $9}' )
echo "Downloading the latest texlive-full package ..."
wget -q ${URL}${latest_tlmgr}
wget -q ${URL}${latest_tlmgr_sum}
echo "Checking integrity of $latest_tlmgr ..."
sha512sum -c $TMP/$latest_tlmgr_sum || ( echo "$latest_tlmgr is corrupted, download it again."; exit 1 )
tar -C /usr/share --strip-components=1 -xvf $latest_tlmgr
apk fix texlive
rm -rf $TMP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment