Sublime Forum

Automatically update Sublime Text 3 on Linux


I wrote a little python 3 script to automatically check for an updated version and install it for debian-based Linux systems, maybe this will be useful to someone.

You can set it on the dev or stable channel and retries automatically if gives http 500 errors.
Needs to be run as root to run apt and dpkg.

I added sudo python3 to my update script and works flawlessy. Any contribution or correction is welcome, just open a PR on github.



any reason why you chose to not use the JSON API to get the latest version?



Didn’t know about that. Just pushed an update, the script now fetches the latest version from the JSON API.

1 Like


for debian based systems, including Ubuntu and Linux Mint, there is a ppa for sublime text 3:

You can add the ppa to your repositories and any updates will be applied through the normal apt based package control system for your distribution.



I use the following to install the latest dev version of ST3.

LATESTNUMBER=$(wget -O - | grep -o 'href=" Text Build [0-9][0-9][0-9][0-9].dmg"' | grep -o -E '[0-9]+')

# wget --quiet && sudo dpkg -i sublime-text_build-3112_amd64.deb
wget --quiet${LATESTNUMBER}_amd64.deb && sudo dpkg -i sublime-text_build-${LATESTNUMBER}_amd64.deb


mkdir -p ~/.config/sublime-text-3/Installed\ Packages
cd ~/.config/sublime-text-3/Installed\ Packages/
wget --quiet

mkdir -p ~/.config/sublime-text-3/Packages/User
cd ~/.config/sublime-text-3/Packages/User/
wget --quiet
wget --quiet

# Revert back to previous directory
cd $cwd

This will search for the latest ST3 dev version, download the file, install, then I ‘install’ the package control and fetch a list of the packages i use from my github account.

Modified my shell script to the following, taking into account the previous comments.


echo --------------------

if [ "$channel" = "dev" ]

localversion=$(dpkg -s sublime-text | grep Version  | grep -o -E '[0-9]+')

json=$(wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 20 -O - ${remoteversionurl})
remoteversion=$(echo ${json} | grep -Po '"latest_version": \K[0-9]+')

# remoteversion=$(wget -O -${channel} | grep -o 'href=" Text Build [0-9][0-9][0-9][0-9].dmg"' | grep -o -E '[0-9]+')


echo --------------------

echo version json=${json}

echo --------------------
echo ${cwd}
echo channel=${channel} 
echo localversion=${localversion}
echo remoteversion=${remoteversion}
echo remoteurl=${remoteurl}
echo remoteversionurl=${remoteversionurl}
echo filename=${filename}
echo --------------------

if [ -z "$remoteversion" ]
	echo 'remoteversion variable is undefined'
	exit 1

if [[ "$localversion" != "$remoteversion" ]]
	echo Update Sublime Text 3 from ${localversion} to ${remoteversion} 
	wget --quiet ${remoteurl} && sudo dpkg -i ${filename}
	rm ${filename}
	echo Sublime Text 3 local version ${localversion} is up to date  

echo --------------------

The only issues I have with this new script is sometimes the script returns ERROR 500: Internal Server

1 Like


Updated my shell script to install/update Sublime Text 3 and posted the result to github:

The script determines the latest available version, then downloads and installs the tarball. Tested successfully on Fedora 25. There are a few parameters that allow on to choose between DEV and STABLE, specify a specific version number, and specify the installation folder.

Usage: {script} [ OPTIONS ] TARGET BUILD

  TARGET        Installation target. Default target is "/opt".
  BUILD         Build number, e.g. 3126. If not defined uses a Sublime Text 3 
                  web service to retrieve the latest stable or dev version number.

  -h, --help    Displays this help message.
  -d, --dev     Install the dev version
  -s, --stable  Install the stable version (default)

The following will install the latest stable version of ST3:

cd sublime-text-3-install
chmod +x

This will install the latest dev version of ST3:

./ -d

This will install a specific stable version of ST3 in a non-standard folder:

./ -s /usr/local 3126

Uses the JSON API to determine the latest available version.

1 Like


Good news- Linux repository support added today.

1 Like