Installing Sublime Text 2 on Linux Mint/Ubuntu (for Linux Newcomers)

Posted on April 23 2013 07:08 PM by John Atten in Linux, CodeProject, Learning Linux   ||   Comments (3)

 

TL:DR – For a newcomer to Linux, likely starting out with Ubuntu or Linux Mint, installing applications that are not part of the Software Manager or Synaptic Package Manager catalog for the chosen distro is not always intuitive at first. I take a rather long look at how to get Sublime Text 2 properly installed on your machine, and do my best to explain what is going on, rather than simply provide terminal entries to copy and paste. I would be happy to hear from experience Linux users about how I might improve, or where I have explained something poorly.

A few months back, I decided to expand my horizons and explore Ruby and Rails. I also decided that I would do so in the more native Linux environment, rather than go the Ruby-on-Windows route. This was one of the best decisions I have made in terms of developing my skills and experience as a programmer.

Sublime_Text_LogoThe learning continues. I started with Linux Mint 13, which has a friendly enough GUI, but for most of what I am doing, I try to use the Bash CLI as much as possible. I've never been very comfortable with the command line, and so long as I am learning a new language, in a new OS environment, I figured it was time to overcome that limitation as well.

If you are an experienced Linux user, there is probably nothing here for you. This is really basic, and yet I had to look around and cull some information from a variety of sources in order to figure out how to do this.

Why Sublime Text 2

Unless you have been in a coma, you have no doubt at least heard of Sublime Text 2. Sublime Text 2 is a cross-platform (Mac/Windows/Linux), highly customizable text editor with an outstanding compliment of features. I have found it to be my preferred, go-to tool for text manipulation. While it is not an IDE, Sublime Text presents sufficient IDE-like features that for many purposes, you won't miss the extra cruft. Also, of course, in many programming communities (Ruby, JavaScript), code is more often written in a text editor.

NOTE: As of this writing, Sublime Text 3 is available to registered Sublime Text users as a beta release.

Sublime Text 2 is not currently part of the Synaptic Package Management system on Linux Mint (or Ubuntu). Therefore, there is no magical apt-get install command as you might use to install other software on your Linux system, so we have to do a little more work.

Installing Sublime Text on Linux Mint/Ubuntu – The First Method

Of course, the straightforward method of installing Sublime Text 2 on your Linux Box is to download the appropriate (23 or 64-bit) .tar file from the Sublime Text site, unpack, and locate in the directory of your choice. You can do this manually by going to the Sublime Text 2 Downloads page and clicking the appropriate download link, or you can do it all from the terminal, as described below.

If you are not as familiar with Bash command line as you would like, see my previous posts. While these were written in the context of using Git for Windows developers, the basic Bash commands are explained:

This method is described on the Sublime Text Site/Support/Linux/Installation page. Simply open a terminal in the directory you use for applications, and enter the following command (use the appropriate version fro your machine):

NOTE: As of this writing, Sublime Text 2.0.1 is the most recent stable release. If the stable release is updated, the URL's in the links below will change, and you will need to copy the updated URL from the Sublime Text site.

Download the Linux 32-Bit Version of Sublime Text 2:
$ wget http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1.tar.bz2

 

Download the Linux 64-Bit Version of Sublime Text 2:
$ wget http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1%20x64.tar.bz2

 

Extract the "Sublime Text 2.0.1.tar.bz2" file (this will be "Sublime Text 2.0.1 x64.tar.bz2" for the 64 bit version):

Extract the Sublime Text .tar file:
tar vxjf "Sublime Text 2.0.1.tar.bz2"

 

Then you can add a sym link to the executable file with a short name for convenience (it seems to be a convention to use the alias "subl" for ease of use from the terminal. The executable file will be located in the extracted Sublime Text 2 directory. For example, if you extracted the .tar contents into a directory ~/apps then the sublime_text executable will be "home/Sublime Text 2/sublime_text" (since there are spaces in the directory name, we need to use quotes around the path).

Add a Sym link:
sudo ln -s "~apps/Sublime Text 2/sublime_text" /usr/bin/subl

 

The above method is easiest, but does not leave you with a convenient way to update Sublime Text in the future short of removing the current installation, re-downloading, and re-installing. There is an arguably better method, which relies on the Personal Package Archive system.

Installing Sublime Text on Linux Mint /Ubuntu– The Better Method

Canonical, the company which supports Ubuntu, has created the Launchpad.net site which, among other things, hosts a repository for Personal Package Archives (PPA's). Here, individuals and teams can upload their own software and installation packages, and it is possible to find deployment packages for software that is not included in the Ubuntu or Linux Mint Synaptic Package Manager for your specific distribution. It is also possible to add the PPA to your Synaptic catalog, so that you can then run apt-get install, apt-get update and the like to keep your package up to date.

Or, at least as up to date as the package maintainer at Launchpad keeps theirs.

The WebUpd8team at Launchpad has created (among other things) a PPA for Sublime Text 2 which is up to date with version 2.0.1 as of this writing. To add Sublime Text 2 to your Synaptic catalog, and install according to the install script published with the PPA, follow these steps:

Add the Sublime Text 2 Repository to your Synaptic Package Manager:
sudo add-apt-repository ppa:webupd8team/sublime-text-2

 

Update:
sudo apt-get update

 

Install Sublime Text:
sudo apt-get install sublime-text


Next, check the usr/bin directory. You should see at least one file, named sublime-text-2, and you should also see two others, named sublime-text and subl. These create aliases you can use to invoke Sublime Text 2 from the command line. If the subl and sublime-text files are not present, copy the sublime-text-2 file and make them:

Create alias files (if not present):
$ sudo cp /usr/bin/sublime-text-2 /usr/bin/sublime-text
$ sudo cp /usr/bin/sublime-text-2 /usr/bin/subl

 

There you have it. You can now use Sublime Text 2 from you command line. Also, you should see it available in your GUI in the applications menu.

This has been a long post about a relatively simple operation. My goal has been to explain the concepts as fully as possible, under the assumption that there are those out there, like myself, new enough to Linux to need the extra handholding. Thanks for reading!

 

Posted on April 23 2013 07:08 PM by John Atten     

Comments (3)

Find The IP Address of Your Computer on the Home or Local Area Network (LAN) -Windows 7

Posted on November 18 2012 12:48 PM by John Atten in Linux, Networking   ||   Comments (0)

This is a short post on how and where to find the IP address and static/dynamic status for your Windows 7 machine within your Local Area Network (LAN). If you are using a Linux machine, follow this link:

Find The IP Address of Your Computer on the Home or Local Area Network (LAN) -Linux (Debian-Based Systems)

Every now and then, we need to know something trivial, such as the current IP address of the machine at which we sit. Within limits, this is simple enough to do.

With a pair of useful Terminal Commands at the Windows Command Prompt, we can find the information we need:

Private (internal to our LAN) IP Address of our current computer, and our router:
> ipconfig

 

Static/Dynamic status of IP Addresses within our LAN:
> arp -a

 

Current LAN IP Address - Windows:

Open a terminal window using Start Menu (on Windows 7) by typing cmd into the “Search” field:

Open the Start Menu:

Start-Menu-Before-Search

 
Type cmd into the Search field:

Start-Menu-Found-Cmd

 
Click on the cmd Item Listed Under Programs:

Command-Prompt-On-Open

Type ipconfig into the Terminal Window:

Command-Prompt-Type-ipconfig

After you hit the enter key, the terminal window will fill with a bunch of network-related information. Depending upon your network and machine configuration, the contents of the window may well scroll down until the first few items are no longer in view (as it did here on my machine, visible below). If so, use the scrollbar to move the top of the list following the ipconfig command back into view:

Command-Prompt-After-Enter-ipconfig

In the section called “Ethernet adapter Local Area Connection”, the item named IPv4 Address represents the current IP address assigned to your machine. In my case, my current machine is assigned the IP Address 192.168.0.100.

Also in the same section, the item named “Default Gateway” represents the private, or internal IP Address of your router. In my case, my router’s internal IP Address is 192.168.0.1.

Both of these represent addresses internal to our Local Area Network, and are not exposed to the internet-at-large. Using the IP Addresses within our LAN allows us to access the other machines on our network (subject to proper permissions, of course).

For the moment, write these two addresses down. In my case:

  • The private IP Address of my computer is 192.168.0.100
  • the private IP Address of my router is 192.168.0.101

Static or Dynamic IP Assignment?

Note that these addresses are not necessarily static (or, permanent). Routers often assign IP Addresses dynamically. While a given dynamic IP address on your home network is unlikely to change very often, it CAN.  In order to check out which type of IP Address(es) we are dealing with, we can execute the arp -a command in our terminal:

Type arp -a into the terminal:

Command-Prompt-Type-apr-a

Then hit the Enter Key:

Command-Prompt-After-Enter-arp-a

Since I know that my computer’s IP Address on my network is 192.168.0.100, I can find that address in the list displayed in my terminal and see that, indeed, I am using a dynamic IP address. Further, I can see that my router, too, is using a dynamically-assigned IP Address.

On my system, these address assignments are unlikely to change. I have a small, private home network, and it is improbably that circumstances would require my router to assign them differently.

 

 

Posted on November 18 2012 12:48 PM by John Atten     

Comments (0)

Find The IP Address of Your Computer on the Home or Local Area Network (LAN) -Linux (Debian-Based Systems)

Posted on November 18 2012 12:48 PM by John Atten in Linux, Networking   ||   Comments (3)

This is a short post on how and where to find the IP address and static/dynamic status for your Linux machine within your Local Area Network (LAN). If you are using a Windows machine, follow this link:

Find The IP Address of Your Computer on the Home or Local Area Network (LAN) -Windows 7

Every now and then, we need to know something trivial, such as the current IP address of the machine at which we sit. Within limits, this is simple enough to do. NOTE: These appear to be mostly universal, but I feel compelled to mention that I am assuming a Debian-based Linux here. I am not widely versed on all the various distributions!).

With a pair of useful Commands at the Bash Terminal, we can find the information we need:

Private (internal to our LAN) IP Address of our current computer, and our router:
$ ifconfig

 

Static/Dynamic status of IP Addresses within our LAN:
$ cat / etc/network/interfaces

 

Current LAN IP Address - Linux:

Open the Bash terminal and type ifconfig

Linux-Find-IP-Address-Before-Enter

The hit the Enter Key:

Linux-Find-IP-Address-After-Enter

Note in the above that the section of the terminal output we are interested in is eth0. Within that section, we find the item inetaddr:192.168.0.113. This is the internal IP address assigned to our current machine within the Local Area Network (LAN). This address is private to our LAN, and is not exposed to the internet-at-large. Note this address, as it is how you will address this specific machine within the confines of your Local Area Network.

Static or Dynamic IP Assignment?

Note that this and other IP addresses found on our LAN are not necessarily static (or, permanent). Routers often assign IP Addresses dynamically. While a given dynamic IP address on your home network is unlikely to change very often, it CAN. In order to check out which type of IP Address we are dealing with, we can use the cat command in our Bash terminal to examine the contents of the network interfaces configuration file used by our computer. Under Most Debian-based Linux systems, we can do this as follows:

Use cat to open the network interfaces file:

Linux-Type-Network-Config-Before-Enter

The hit the Enter key:

linux-network-config-after-enter

If what you see is similar to the above, this indicates a dynamic IP assignment (the auto lo is the key phrase here. My Linux box receives a dynamic IP assignment from my home network router, as do most.

If you’re the IP assigned to your machine is static, the output to the terminal window would have looked a little like THIS (I can’t show terminal output here because I do not have a static IP assignment for my Linux Machine):

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
  address 10.1.1.20
  netmask 255.255.255.0
  network 10.1.1.0
  broadcast 10.1.1.255
  gateway 10.1.1.1

 

 

 

 

Posted on November 18 2012 12:48 PM by John Atten     

Comments (3)

About the author

My name is John Atten, and my username on many of my online accounts is xivSolutions. I am Fascinated by all things technology and software development. I work mostly with C#, Java, SQL Server 2012, learning ASP.NET MVC, html 5/CSS/Javascript. I am always looking for new information, and value your feedback (especially where I got something wrong!).

Web Hosting by