How to Install Sublime Text 3 using Homebrew cask
Solution 1
As of late May, 2021, Sublime Text 4 has been released. As a result, the old solution to installing Sublime Text 3 via Homebrew will now install Sublime Text 4 instead. If this is what you actually want, then the following brew
installation command will install it:
brew install --cask sublime-text
Currently, there is no available cask on Homebrew which will allow the installation of Sublime Text 3 instead of Sublime Text 4.
As a side note, Sublime Text 2 is available in the sublime-text2
cask.
Historical note: This question originally was motivated by the fact that the sublime-text
cask was Sublime Text 2 instead of Sublime Text 3. As of around May 2016, this is no longer the case.
Solution 2
brew install caskroom/cask/brew-cask
brew tap caskroom/versions
brew cask install sublime-text
Weird how I will struggle with this for days, post on StackOverflow, then figure out my own answer in 20 seconds.
[edited to reflect that the package name is now just sublime-text
, not sublime-text3
]
Solution 3
An update
Turns out now brew cask install sublime-text
installs the most up to date version (e.g. 3) by default and brew cask
is now part of the standard brew
-installation.
Solution 4
$ brew tap caskroom/cask
$ brew install brew-cask
$ brew tap caskroom/versions
$ brew cask install sublime-text
Solution 5
To install Sublime Text 3 run:
brew install --cask sublime-text
reference: https://formulae.brew.sh/cask/sublime-text
Related videos on Youtube
Comments
-
ZakTaccardi almost 3 years
How can I use Homebrew cask to install Sublime Text 3? I only see Sublime Text 2 when using Homebrew's search. I even tried tapping homebrew/versions, but no luck.
-
Setheron over 8 yearsWhy isn't 3 the default in the normal cask. So weird
-
Snekse almost 8 yearsYou might want to change the accepted answer since the answer has changed. @frizkie has provided the new procedure, which funny enough is the same as the downvoted answer that was accepted.
-
-
Sergey Kostrukov over 9 yearsCannot find cask sublime-text3 on my machine, only sublime-text, which is 2.0.2 now.
-
Sergey Kostrukov over 9 yearsActually needed this tap: caskroom/versions
-
KylePDavis about 9 yearsThanks. Also, for what it's worth, you can tap and install in one command like this:
brew cask install caskroom/versions/sublime-text3
-
Paul Rad about 9 yearsOk, but you need the "cask" plugin before :
brew install caskroom/cask/brew-cask
-
STEEL almost 9 yearscaskroom.io has all instructions u need ;)
-
jsalonen over 8 yearsDoesn't work unless you run
brew tap caskroom/versions
too. -
SteamDev about 8 yearsSidenote: if you try this and get the error "Error: Cask 'sublime-text3' definition is invalid: Bad header line: parse failed", run
brew uninstall --force brew-cask && brew update
then retry. -
Abdulla Abu Zakham almost 8 yearsYes jsalonen, you are right, I will update my answer. Thank you
-
jdek almost 8 yearsYes, as of this commit, sublime text 3 is now the default.
-
Snekse almost 8 years
$ brew install brew-cask
warnsYou must uninstall this formula. It is no longer needed to stay up to date, as Homebrew now takes care of that automatically.
-
realhu over 7 yearsSublime text is 3114 now. So the last step should be replaced with brew cask install sublime-text
-
hannson over 7 yearsthen use Caskroom/versions/sublime-text2
-
Robin Wieruch over 7 yearsTry
brew cask install sublime-text
when gettingNo available Cask for sublime-test3.
-
Borealis over 7 yearsThis should be the accepted answer. Also, as other comments state, the last line should be
brew cask install sublime-text
. -
rfreytag about 3 yearsOr for newer versions of brew use:
brew install --cask sublime-text
. -
taylorthurlow about 3 years@rfreytag Of course, updating my answer. Thanks for the reminder.