nicholasadamou
9/14/2017 - 11:07 AM

Installs Sublime Text 3 on Ubuntu.

Installs Sublime Text 3 on Ubuntu.

#!/bin/sh

# Sublime Text 3 install with Package Control
# http://simonewebdesign.it/blog/install-sublime-text-3-on-fedora-20/

# Run this script with:
# $ curl LINK_TO_THIS_SCRIPT | sh


subl_url="https://download.sublimetext.com/sublime_text_3_build_3143_x64.tar.bz2"

wget -O ~/st3.tar.bz2 "$subl_url"

if tar -xf ~/st3.tar.bz2 --directory=$HOME; then
  sudo mv ~/sublime_text_3/ /opt/
  sudo ln -s /opt/sublime_text_3/sublime_text /bin/subl
fi

if [ -e ~/st3.tar.bz2 ]; then
  sudo rm -rf ~/st3.tar.bz2
fi

if [ -d ~/sublime_text_3/ ]; then
  sudo rm -rf ~/sublime_text_3/
fi

# Package Control - The Sublime Text Package Manager: https://sublime.wbond.net
curl -o ~/Package\ Control.sublime-package https://sublime.wbond.net/Package%20Control.sublime-package
sudo mv ~/Package\ Control.sublime-package /opt/sublime_text_3/Packages/

if [ -e ~/Package\ Control.sublime-package ]; then
  sudo rm -rf ~/Package\ Control.sublime-package
fi 

# Add to applications list
cat << EOF > ~/.local/share/applications/sublime.desktop
[Desktop Entry]
Name=Sublime Text
Exec=subl %F
MimeType=text/plain;
Terminal=false
Type=Application
Icon=/opt/sublime_text_3/Icon/128x128/sublime-text.png
Categories=Utility;TextEditor;Development;
EOF

Installing the Latest Sublime Text in Ubuntu

Here's a short shell script to quickly install the latest Sublime Text in Ubuntu.

  • Run the script, like this: curl https://gist.github.com/nicholasadamou/406798c81d6895fae6f18e22f8f45615/raw/bf9149a2436cd53260a2b943fce6e04b1ac2dd21/install_sublime_text.sh | sh

  • The script will install OpenJDK, download Eclipse, patch the icon so it looks less ugly, and put all of the right files in the right places.