Tuesday, December 13, 2016
Ubuntu Linux Installing a program and making it accessible through CLI and Unity
Ubuntu Linux Installing a program and making it accessible through CLI and Unity
So, today, I wanted to install a famous text editor called "Sublime Text 2" in my Ubuntu installation. I downloaded the tar file provided by them. Like many programs, I found no installer package or program but just the executables. Yes it was usable but I wanted more. I wanted to call the program with its name not always navigate to the directory where I downloaded it just to use it. So I found this tutorial here and made it accessible via both Unity Dash and CLI (Terminal). I realized I often fall into this kind of problem when Im using Ubuntu / Linux in general. So, I decided to write down the things I have to know when Im doing such a thing.
First of all, you need to move your executables folder to the /usr/lib directory. Suppose youre too installing Sublime Text. You extract it via the tar tool like this.
First of all, you need to move your executables folder to the /usr/lib directory. Suppose youre too installing Sublime Text. You extract it via the tar tool like this.
tar xf Sublime Text 2 Build 2181 x64.tar.bz2Then you get the folder "Sublime Text 2". You move it to the /usr/lib directory using this command.
sudo mv Sublime Text 2 /usr/lib/Now you create a Symbolic Link, more like a Command to call the application via command line interface (CLI) using this
sudo ln -s /usr/lib/Sublime Text 2/sublime_text /usr/bin/sublimeNow create a launcher (icon you search for using HUD)
sudo sublime /usr/share/applications/sublime.desktopEdit that .desktop file (specify what it does) and configure it to run Sublime Text when its clicked on, paste all this in it, you can even spend time trying to understand it (for future applications)
[Desktop Entry]Thats it, now you can run the program using terminal (without pointing to where its stored) and click on a launcher to run it. :)
Version=1.0
Name=Sublime Text 2
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntus language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Text Editor
Exec=sublime #The symbolic link
Terminal=false #Dont run it using terminal
Icon=/usr/lib/Sublime Text 2/Icon/48x48/sublime_text.png #Which icon to use
Type=Application #Type type type :P
Categories=TextEditor;IDE;Development #More info
X-Ayatana-Desktop-Shortcuts=NewWindow
[NewWindow Shortcut Group]
Name=New Window
Exec=sublime -n
TargetEnvironment=Unity
Go to link download