UPDMAP="/etc/texmf/web2c/updmap.cfg"
UPDMAPLOCAL="/etc/texmf/web2c/updmap-local.cfg"

echo "Regenerating updmap.cfg..."
cp /usr/share/texmf-dist/web2c/updmap-hdr.cfg $UPDMAP
[ -f "$UPDMAPLOCAL" ] && cat "$UPDMAPLOCAL" >> $UPDMAP

echo "Updating the filename database..."
mktexlsr > /dev/null

echo "Creating all formats..."
fmtutil-sys --all --cnffile /etc/texmf/web2c/fmtutil.cnf 1>/dev/null

echo "Updating the fontmap files with updmap..."
updmap-sys --quiet --nohash 1>/dev/null

