Did You Know?
Donate to TecMint

LFCS - Linux Foundation Certified SysAdmin - Exam Preparation Guide

Install Sublime Text (a Text Editor) in RHEL/CentOS/Fedora and Debian/Ubuntu

Download Your Free eBooks NOW - 10 Free Linux eBooks for Administrators

Sublime Text is a most popular, lightweight and smart cross-platform text and source code editor with a Python API, that available for Linux, Windows and Mac OS X. It is really an awesome application for programming and offers a wide range of file types to manage has it supports syntax highlighting for C, C++, C#, CSS, HTML, Java, JavaScript, PHP, Groovy, LaTeX and the list goes on. The user interface is much similar to most famous editor called “vim“.

Install Sublime Text in Linux

Install Sublime Text in Linux

By default there is no official repository available for Sublime Text 2 and there is no any magical way to install using “yum” or “apt-get” command as you use these command frequently to install packages on your Linux systems.

But due to high volume of users requests, the WebUpd8team created a up-to-date PPA for Sublime Text 2 for Ubuntu users. So, here in this article we will show you two methods to install Sublime Text.

At the time of writing this article, Sublime Text 3 beta is available to registered Sublime Text users only at a license costs USD $70. However, now it’s available to all users.

  1. The first method is using source tarball on RHEL, CentOS, Fedora, Debian, Ubuntu and Linux Mint.
  2. The Second method is using PPA on Debian, Ubuntu and Linux Mint.

Method 1: Installing from Source Tarball

The latest stable version can be downloaded from Sublime Text website or you can use the following “wget” command to download the tar-file that suits you better and extract it as shown below.

On 32-Bit Systems
# cd ~
# wget http://c758482.r82.cf2.rackcdn.com/Sublime\ Text\ 2.0.2.tar.bz2
# tar vxjf Sublime\ Text\ 2.0.2.tar.bz2
On 64-Bit Systems
# cd ~
# wget http://c758482.r82.cf2.rackcdn.com/Sublime\ Text\ 2.0.2\ x64.tar.bz2
# tar vxjf Sublime\ Text\ 2.0.2\ x64.tar.bz2

Once unpacked, you will get a directory called “Sublime Text 2″, inside this directory you will see a list files that required by Sublime Text to run. For security reason, we move this folder under “/opt” location.

# sudo mv Sublime\ Text\ 2 /opt/

Next create a symbolic link to call “Sublime Text” from the command line as “sublime”. To do, create a symbolic link under “/usr/bin” as shown below.

# sudo ln -s /opt/Sublime\ Text\ 2/sublime_text /usr/bin/sublime
For Ubuntu Unity Lancher

If you are using Unity and want to add “Sublime Text” to the Unity launcher. Create a “sublime.desktop” file under “/usr/share/applications”.

# sudo sublime /usr/share/applications/sublime.desktop

Then Copy and Paste the following content into it. Save and close.

[Desktop Entry]
Name=Sublime Text 2
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Text Editor

Icon=/opt/Sublime Text 2/Icon/48x48/sublime_text.png

[NewWindow Shortcut Group]
Name=New Window
Exec=sublime -n

Install Sublime Text in Ubuntu

If you would like to open all your text files with “Sublime Text“. Open a “defaults.list” file and replace all occurrences of “gedit.desktop” with “sublime.desktop” as shown.

# sudo sublime /usr/share/applications/defaults.list

Install Sublime Text in Fedora

Method 2: Installing Sublime Text Using PPA

Add WebUpd8team PPA to your Synaptic Manager to install Sublime Text using following steps.

# sudo add-apt-repository ppa:webupd8team/sublime-text-2
# sudo apt-get update
# sudo apt-get install sublime-text

NOTE: As I said the Sublime Text 3 Beta is released, if you would like to install Sublime Text 3, use this following command.

# sudo apt-get install sublime-text-installer
Start Sublime Text

To Launch Sublime Text from command line, call the “sublime” as shown.

# sublime

Install Sublime Text in Debian
That’s It! If you are using any other editor, please do tell us via comment section.

Ravi Saive

Owner at TecMint.com
Simple Word a Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux.

Your name can also be listed here. Work as a Paid freelancer/writer at TecMint.
Download Free eBooks
Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Ubuntu Linux Toolbox: 1000+ Commands

17 Responses

  1. Sergiu Niculescu says:

    Too bad it’s not free …

  2. Joseph says:

    $ sublime
    bash: /usr/bin/sublime: Permission denied
    $ sudo sublime
    [sudo] password for user:
    sudo: sublime: command not found

    I use Debian 7.2 and that’s what I got after I tried this. It showed I didn’t have permissions to it when I tried it at first. Then I tried with sudo and it failed showing ‘command not found’

  3. Ehsan says:

    Thank you so much . It’s work very well

  4. Geek says:

    bash-3.2# sublime
    sublime: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.11′ not found (required by sublime)
    sublime: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9′ not found (required by sublime)
    sublime: /lib64/libc.so.6: version `GLIBC_2.11′ not found (required by sublime)

  5. Justin says:

    I’m new to Linux. I’m getting this and I’m not sure what this means.

    Gtk-WARNING **: cannot open display:

  6. Velunce says:

    Thank you ! It works !

  7. Rhebie says:

    how to create shortcut icon of sublime to my panel? can you please help me thanks.

  8. Jon Hyde says:

    Great article – the only one that I could successfully complete – many thanks :)

  9. vasi says:

    I am on CentOs. I can follow only first 3 steps

    • Ravi Saive says:

      Which version of CentOs?

      • ramya says:

        I’m running a CentOS version 2.16.0.

        I get similar error as someone already posted:

        /usr/bin/sublime: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.11′ not found (required by /usr/bin/sublime)
        /usr/bin/sublime: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9′ not found (required by /usr/bin/sublime)
        /usr/bin/sublime: /lib/libc.so.6: version `GLIBC_2.11′ not found (required by /usr/bin/sublime)

        Thanks for your help in advance!

Leave a Reply

This work is licensed under a (cc) BY-NC | TecMint uses cookies. By using our services, you comply to use of our cookies. More info: Privacy Policy.
© 2012-2014 All Rights Reserved.