How to Install Sublime Text 3 using Homebrew cask

112,931

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

Share:
112,931

Related videos on Youtube

ZakTaccardi
Author by

ZakTaccardi

Android App Developer!

Updated on June 08, 2021

Comments

  • ZakTaccardi
    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
      Setheron over 8 years
      Why isn't 3 the default in the normal cask. So weird
    • Snekse
      Snekse almost 8 years
      You 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
    Sergey Kostrukov over 9 years
    Cannot find cask sublime-text3 on my machine, only sublime-text, which is 2.0.2 now.
  • Sergey Kostrukov
    Sergey Kostrukov over 9 years
    Actually needed this tap: caskroom/versions
  • KylePDavis
    KylePDavis about 9 years
    Thanks. 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
    Paul Rad about 9 years
    Ok, but you need the "cask" plugin before : brew install caskroom/cask/brew-cask
  • STEEL
    STEEL almost 9 years
    caskroom.io has all instructions u need ;)
  • jsalonen
    jsalonen over 8 years
    Doesn't work unless you run brew tap caskroom/versions too.
  • SteamDev
    SteamDev about 8 years
    Sidenote: 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
    Abdulla Abu Zakham almost 8 years
    Yes jsalonen, you are right, I will update my answer. Thank you
  • jdek
    jdek almost 8 years
    Yes, as of this commit, sublime text 3 is now the default.
  • Snekse
    Snekse almost 8 years
    $ brew install brew-cask warns You must uninstall this formula. It is no longer needed to stay up to date, as Homebrew now takes care of that automatically.
  • realhu
    realhu over 7 years
    Sublime text is 3114 now. So the last step should be replaced with brew cask install sublime-text
  • hannson
    hannson over 7 years
    then use Caskroom/versions/sublime-text2
  • Robin Wieruch
    Robin Wieruch over 7 years
    Try brew cask install sublime-text when getting No available Cask for sublime-test3.
  • Borealis
    Borealis over 7 years
    This should be the accepted answer. Also, as other comments state, the last line should be brew cask install sublime-text.
  • rfreytag
    rfreytag about 3 years
    Or for newer versions of brew use: brew install --cask sublime-text.
  • taylorthurlow
    taylorthurlow about 3 years
    @rfreytag Of course, updating my answer. Thanks for the reminder.