Last active
July 14, 2022 09:18
-
-
Save sayak-sarkar/11b039f398ddcae88139 to your computer and use it in GitHub Desktop.
Gist to install Sublime Text 3 on RHEL 6 +
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SHORTCUT="[Desktop Entry] | |
Name=Sublime Text 3 | |
Comment=Edit text files | |
Exec=/opt/sublime_text_3/sublime_text | |
Icon=/opt/sublime_text_3/Icon/128x128/sublime-text.png | |
Terminal=false | |
Type=Application | |
Encoding=UTF-8 | |
Categories=Utility;TextEditor;" | |
SCRIPT="#!/bin/sh | |
if [[ \${1} == \"--help\" ]]; then | |
/opt/sublime_text_3/sublime_text --help | |
else | |
/opt/sublime_text_3/sublime_text \$@ > /dev/null 2>&1 & | |
fi" | |
echo "Downloading Sublime Text 3..." | |
curl -L "https://download.sublimetext.com/sublime_text_3_build_3143_x64.tar.bz2" -o "/usr/src/Sublime Text 3.tar.bz2" | |
echo "Installing Sublime Text 3..." | |
echo -ne '##### (33%)\r' | |
cd /usr/src | |
tar -xvjf "Sublime Text 3.tar.bz2" | |
echo -ne '############# (66%)\r' | |
cd "sublime_text_3" | |
mv -fv "/usr/src/sublime_text_3" "/opt/sublime_text_3" | |
echo "${SCRIPT}" > "/usr/local/bin/subl" | |
chmod +x "/usr/local/bin/subl" | |
echo "${SHORTCUT}" > "/usr/share/applications/sublime-text-3.desktop" | |
ln -s /opt/sublime_text_3/sublime_text /usr/bin/sublime3 | |
echo -ne '####################### (100%)\r' | |
# Package Control - The Sublime Text Package Manager: https://sublime.wbond.net | |
echo "Installing Package Control..." | |
wget --no-check-certificate https://sublime.wbond.net/Package%20Control.sublime-package | |
sudo mv Package\ Control.sublime-package "/opt/sublime_text_3/Packages/" | |
cd .config/sublime-text-3/Installed\ Packages/ | |
wget https://packagecontrol.io/Package%20Control.sublime-package | |
echo "Finish!" |
Great!
There was another new update : Build 3083
I believe it to change the file to be downloaded as well.
[UPDATE] Line 18 - http://c758482.r82.cf2.rackcdn.com/sublime_text_3_build_3083_x64.tar.bz2
Fixed the Tarball link and updated the gist to the latest 3103 build along with all of @ThePhoenixBird's fixes! 😄
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi there, just a couple fixes for Fedora 21
first there are a couple problems with the script:
line21
When you decompress the tar.bz2 file it contains a sublime_text_3 folder, no this line results in "not found"
line23
That will move all the content of /usr/src to /opt/sublime-text-3/ (and its a pain, if you have stuff there)
You can easily merge lines 22 and 23 into
take into account no trailing / at the end because you would move sublime_text_3 into another sublime_text_3 folder creating /opt/sublime_text_3/sublime_text_3
with that fixed now only line12 needs a fix
and thats it 😄