When you’re ready to install Sublime Text on Ubuntu, follow the steps below: There are multiple ways to install Sublime Text Option #1: Install Sublime Text from Repository. To install Sublime Text using its official repository, you’ll have to add it to Ubuntu.
I installed Sublime Text 2 on 12.04 as per this tutorial.
However I don't have adequate permissions when launching the program from the Unity launcher. For example I cannot install packages, or if I add a folder to the sidebar when I close Sublime and reopen, the folder is no longer listed. If I run
sudo sublime
in the terminal all changes remain after closing.I've tried chown-ing the Sublime Text 2 folder in usr/lib
Jared Burrowssudo chown -R mylogin:mylogin /usr/lib/'Sublime Text 2'
but this seemed to have no effect.8,16411 gold badge1313 silver badges1616 bronze badges
Michael GruberMichael Gruber2,45133 gold badges1111 silver badges88 bronze badges
12 Answers
Simply add to your packages:
For Sublime-Text-2:
For Sublime-Text-3:
Download from the Sublime Site:
32-bit:
64-bit:
For Both:
Source: http://www.tecmint.com/install-sublime-text-editor-in-linux/
Check out this nice script on Github('Install Sublime Text on Fedora.') that you can run, just make sure to edit the '*.tar.bz2' in the script to download the latest version of Sublime Text!
Source:https://gist.github.com/henriquemoody/3288681
This helped me and I hope it helps everyone else as well!
user606063
Jared BurrowsJared Burrows
8,16411 gold badge1313 silver badges1616 bronze badges
Basically, your problem is that you're using a wrong article :) If it was on an SE site I would down-vote it.
Manually copying stuff which does not come from Ubuntu repositories into
/usr
is WRONG. This directory is managed by Ubuntu's package manager and messing with it is going to cause you trouble at some point or another - for example, the next time you upgrade your system Sublime will likely be removed without a trace. Running the program as root is even wronger, especially in the case of SublimeText which has its own package manager which basically downloads stuff from Internet and lets it run on your computer. A simple typo in a plugin could destroy all data on your machine.
A proper solution, if you want to install the program system-wide, would be to find/build a .deb file and install it - this way package manager would be aware of the package. Webupd8 maintains a PPA for SublimeText2, so you can just use that.
However, there's a much lazier solution which I am personally using - just unpack SublimeText somewhere in your home directory, create a
bin
directory in your home directory and symlink sublime_text
executable into that directory:After which you'll be able to run Sublime Text by typing
sublime_text
in the console, from any directory. This does not require root privileges at all and the editor runs just fine.The article also does some shell integration, such as registering sublime_text as a default editor and adding an icon, and I was too lazy to do that - however, I'm sure that it can be done without messing with system-wide settings.
This does not explain, however, the problems with permissions you're having - SublimeText stores all its settings in your home folder anyway, so even if you installed it system-wide it should not have problems. What probably happened is that you started it the first time with superuser privileges (i.e. from the sudo shell), so the editor's config directory (in
~/.config/sublime-text-2
) is owned by root
now. You need to do something liketo fix this.
SergeySergey37.1k99 gold badges9090 silver badges101101 bronze badges
Here is how to solve this.
1) undo all the steps in the linked webpage in reverse order.
1a) if you didn't save a copy of your original defaults.list then open a terminal and run
2) get the version of sublime you want and extract it to the current directory.
3) in bash
cd
to the directory where you extracted sublime4)
mv Sublime Text 2 ~/.local
4a) if you want to be able to run sublime from the command line then run
mkdir -p ~/bin && ln -s ~/.local/Sublime Text 2/sublime_text ~/bin/sublime
. The default .bashrc
will add ~/bin to your $PATH the next time your shell launches.5) Make a file called
sublime.desktop
in ~/.local/share/applications/
and paste the following inside.6)
test -e ~/.local/share/applications/defaults.list -a 1$(grep -sc [Default Applications] ~/.local/share/applications/defaults.list) != 10 || echo '[Default Applications]' >> ~/.local/share/applications/defaults.list; grep gedit.desktop /usr/share/applications/defaults.list | sed 's/gedit.desktop/sublime.desktop/g' >> ~/.local/share/applications/defaults.list
7) done.
It should now be installed locally in your home directory and you should have no more issues with permissions.
Alex L.Alex L.
I think @Alex L. is completely right. I recommend never editting your
/usr
fs, add-on commercial software should be installed in either /opt
for multi-user or ~/opt
for single user (see Linux Filesystem Hierarchy especially /opt
and /home
). Here are just a few more additions to make it really nice.- You don't have to move your app to
.local
or/local
; I usually just leave them in~/opt
(n.b.: the tilde is your home directory or$HOME
). - Make a symlink to sublime_text in
~/bin
, but call itsublime
; see step 4a in Alex L.'s answer above. - Same as Alex L.'s step 5, make a file called
sublime.desktop
in~/.local/share/applications/
but add%f
aftersublime
in theExec
field so that you can open it from Nautilus, as described in this post. Also don't escape spaces for theIcon
field and use the full path, no tilde. Replace<user>
with your username. - You shouldn't have to log off, but if it doesn't show up in your dash, right away maybe you do. Then look for a file to open in Nautilus, right-click and select Open With Other Applicaton ... then Show other applications button at the bottom, find Sublime Text 2 in the list, select it and hit Select. Your file should open in Sublime Text 2, and from now on for files of that type you will see Sublime Text 2 already listed as an option. You can also set it as the default from Nautilus by right-clicking, selecting Properties then Open With and finally Set as default button after highlighting Sublime Text 2. Of course you could have used Add to select Sublime Text 2 to open the file type from the Properties window as well.
Community♦
Mark MikofskiMark Mikofski
You can also also download the Debian package for your particular architecture fromthe sublime website
and then run the following;
for example if my download for a 64 bit architecture is in the
Downloads
directory and is called sublime-text_build-3080_amd64.deb
then I will runIn my case it was sublime text 3, you can get for your sublime text 2 also
Leonard KakandeLeonard Kakande
Type the following commands in the terminal, for Sublime Text 2 :
For Sublime Text 3 :
Nidhin MohammadNidhin Mohammad
- Download the deb package from the official site.
- Install the package by
$sudo dpkg -i path_to_the_file.deb
- Start the program from
/opt/sublime_text/sublime_text
25911 gold badge66 silver badges2323 bronze badges
golopotgolopot
As mentioned by Leonard Kakande, you can install it from official repository. It works for Sublime Text 3 only, though.
Run the following commands in your terminal:
(1) Install the GPG key:
(2) Select the channel to use:
Stable
Dev
(3) Update apt sources and install Sublime Text
Artur BarseghyanArtur Barseghyan
I recently made this for your convenience:https://github.com/TCattd/sublime-text-linux-installer
A Sublime Text 2 and Sublime Text 3 bash script installer. Just download one of the scripts, ST2 or ST2.
For ST2 is: st2install
Put ir in your home folder. Then form a terminal (and in the same home folder) run:
That will take care of all.
You can upgrade with that very same script too, in case a new ST2 version pop out. Same apply for installing/upgrading ST3.
And both versions, using those installers, can live together without conflicts.
Hope it helps ;)
TCattdTCattd
Installing Snap on Ubuntu
Installing Sublime text
Note: snapd is only works for ubuntu 16.04 or later versions
rhoitjadhavrhoitjadhav
I had the same problem and followed the above provided solutions without success. What did it for me was the following solution.
Essentially:
- Close all of your sublime app instances
- Open up the sublime desktop file
- Edit the file by replacingwith
- Delete sublime profile configuration folders
- Start sublime from the top menu or shortcut
Community♦
MauricioMauricio
Maybe there has simply something gone wrong during the installation. I'm using Sublime Text 2 on 12.04 and it doesn't need sudo. I suggest you type
sudo apt-get purge sublime-text
in a terminal (depends on which version you've installed. Use the tab key after having typed the line until 'subl' twice - each installed version will be displayed).This will completely remove the installation. After that, go to the homepage of sublime text and make sure you download the .deb package. Browse the package in Nautilus (home folder), right-click on the .deb-package and choose 'open with Software Center'. In the Software Center, click install and follow the instructions. After that you should be able to launch the application without sudo.speterspeter
protected by heemaylAug 4 '15 at 18:15
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
Would you like to answer one of these unanswered questions instead?
Not the answer you're looking for? Browse other questions tagged software-installation or ask your own question.
Sublime Text is a cross-platform source code editor with a Python application programming interface (API). It natively supports many programming languages and markup languages, and its functionality can be extended by users with plugins, typically community-built and maintained under free-software licenses.
This article describes “How to install Sublime Text Editor on Ubuntu”
Features
- Editing files side by side.
- It supported all Platforms.
- It provides functionality to find and replace with regular expressions.
- The Command Palette gives fast access to functionality.
- “Goto Anything,” quick navigation to files, symbols, or lines.
- Python-based plugin API.
- Compatible with many language grammars from TextMate.
Installing Sublime
There are two version’s of Sublime Text is available to install, To install Sublime 2, use the following commands –
The sample output should be like this –
To update package index, use the following command-
The sample output should be like this-
To install Sublime Text Editor, use the follwoing command –
The sample output should be like this –
To install sublime 3, use the following commands-
To open sublime, use the following command –
The sample output should be like this –
Congratulations! Now, you know “How to Install Sublime Text Editor on Ubuntu ”. We’ll learn more about these types of commands in our next Linux post. Keep reading!