Install Sublime Text 3 on Ubuntu Linux

In order to install Sublime Text 3 on Ubuntu, we first need to add a repository to our sources.

Before we add the required repository to our sources, we need to make sure to have the add-apt-repository package available. If you don’t start with step1, otherwise proceed to step2.

Step 1: install the add-apt-repository packages providing the command:

for Ubuntu version <= 12.04

sudo apt-get install python-software-properties

for Ubuntu version >= 12.10

sudo apt-get install software-properties-common

Step2:

sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install sublime-text-installer

First the repository is added, then a update to find the new packages is made and finally you’re installing sublime text 3.

Install MRI 2.1.0 on Ubuntu 13.04

MRI – Matz’s Ruby Interpreter

1. We need curl on a fresh install if it so happens that it is not present:

sudo apt-get update
sudo apt-get install curl

2. Download and run the RVM installation script

2.1 Installing the stable release version:

user$: curl -sSL https://get.rvm.io | bash -s stable

2.2 To get the latest development state:

user$: curl -sSL https://get.rvm.io | bash

3. Reopen terminal and run:

rvm install ruby-2.1.0

or paste this in the current terminal and then install ruby: source ~/.rvm/scripts/rvm

4. If you’re getting the “RVM is not a function” message you need to enable login shell (optional):

With the the terminal window open go to:

Terminal > Edit > Profile Preferences > Title and Command > Run command as a login shell (make sure this check-box is enabled)

Install an experimental fork of Homebrew for Linux

1. Reference: https://github.com/Homebrew/linuxbrew

2. Installation

2.1 Pre-requisites:

2.1.1 Debian or Ubuntu:

sudo apt-get install build-essential curl git ruby libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev

2.1.2 Fedora:

sudo yum groupinstall 'Development Tools' && sudo yum install curl git ruby bzip2-devel curl-devel expat-devel ncurses-devel

3. Homebrew Install:

git clone https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew

4. Edit .bashrc ( sudo nano ~/.bashrc ) or .zshrc and add the following 2 lines at the end of the file:

export PATH="$HOME/.linuxbrew/bin:$PATH"
export LD_LIBRARY_PATH="$HOME/.linuxbrew/lib:$LD_LIBRARY_PATH"

5. and restart the terminal.

6. Usage:

basic package install with brew:

brew install $WHATEVER_YOU_WANT

7. Full example help/usage:

brew [info | home | options ] [FORMULA...]
brew install FORMULA...
brew uninstall FORMULA...
brew search [foo]
brew list [FORMULA...]
brew update
brew upgrade [FORMULA...]
brew pin/unpin [FORMULA...]
Troubleshooting:
brew doctor
brew install -vd FORMULA
brew [--env | --config]
Brewing:
brew create [URL [--no-fetch]]
brew edit [FORMULA...]
open https://github.com/Homebrew/homebrew/wiki/Formula-Cookbook
Further help:
man brew
brew home

8. Available packages to be used with brew:

– you can browse the formula directory on GitHub
– or type brew search for a list (in the terminal window)
– or visit braumeister.org to browse packages online.

Creating a zip archive under linux that is windows compatible

zip -9 -y -r -q file.zip folder/

-9 Indicates the slowest compression speed (optimal compression, ignores the suffix list)
-y Store symbolic links as such in the zip archive, instead of compressing and storing the file referred to by the link
-r Travel the directory structure recursively
-q Quiet mode
folder Refers to the folder to be zipped

zip package needs to firstly be installed:

sudo apt-get install zip

Install / upgrade to latest Nginx without compiling from source

Nginx server update without compiling

You can install the Nginx package from the regular Ubuntu/Debian repositories, but the versions there are generally lagging behind the current stable/development releases.

In this post, I’ll show you how to install/upgrade the latest stable or development version through Ubuntu’s package manager without having to compile Nginx from source!

1. Ubuntu guide:

1.1 Switch to root:

 sudo -i 

1.2 Update your local list of packages:

 apt-get update

1.3 Install the python-software-properties package:

 apt-get install python-software-properties

1.4 Add the Nginx Launchpad Repository:

1.4.1 Option 1 (the easy way using add-apt-repository):

 add-apt-repository ppa:nginx/development

or if you want the latest stable release use

 add-apt-repository ppa:nginx/stable

1.4.2 Option 2:

1.4.2.1 Add the repository to your sources.list using the following command:

 echo "deb http://ppa.launchpad.net/nginx/development/ubuntu $(lsb_release -cs) main" >> /etc/apt/sources.list

or if you want the latest stable release use

 echo "deb http://ppa.launchpad.net/nginx/release/ubuntu $(lsb_release -cs) main" >> /etc/apt/sources.list

Note: lsb_release -cs will grab your current ubuntu install codename

1.4.2.2 get and add the repository public key:

 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C

1.5 Update your local list of packages again:

 sudo apt-get update

1.6 Check current Nginx version:

 nginx -v
nginx version: nginx/1.2.4

1.7 Now, you can install (actually upgrade) the latest version of Nginx just like any other package (we must use forced install otherwise it will fail):

1.7.1 To upgrade:

 apt-get upgrade nginx -f

When asked what to do with the Nginx configuration file /etc/nginx/nginx.conf select
N in orer to keep your current Nginx configuration file.

1.7.2 To install (if not performing an upgrade):

 apt-get install nginx -f

1.8 When the install is done, check your current version of nginx:

 nginx -v

It should read: nginx version: nginx/1.3.8

1.9 Now just to be on the safe side and make sure everything is ok, restart the nginx service followed by a reload of the configuration to make sure statuses are OK:

 service nginx restart
service nginx reload

You are done!
Things on Debian are a little bit different since we cannot use the add-apt-repository ppa:nginx/development command since add-apt-repository is a Ubuntu specific utility that comes along in the python-software-properties packages, however since nginx isn’t all that different for Debian from Ubuntu, we can use Ubuntu development repositories to install the nginx development version bu manually modifying the sources.list file.

2.1 Switch to root:

 sudo -i

2.2 Open for edit your sources.list repositories:

 nano /etc/apt/sources.list

2.3 And add the following line at the bottom of the file:

 deb http://ppa.launchpad.net/nginx/development/ubuntu lucid main

Note: for latest stable version use

 deb http://ppa.launchpad.net/nginx/stable/ubuntu lucid main

or

 deb http://ppa.launchpad.net/nginx/development/ubuntu quantal main

Note: for latest stable version use

 deb http://ppa.launchpad.net/nginx/stable/ubuntu quantal main

Note: check out ubuntu develoment codenames here if you want to use others: https://wiki.ubuntu.com/DevelopmentCodeNames if you’d like to use a different ubuntu version repository.

2.3 Next, download and add the repository private key:

  apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C

2.4 Update your local list of packages:

 apt-get update

2.5 Check current Nginx version:

 nginx -v
nginx version: nginx/1.2.8

2.6 Perform the Nginx webserver upgrade (use forced version):

2.6.1 To upgrade:

 apt-get upgrade nginx -f

When asked what to do with the Nginx configuration file /etc/nginx/nginx.conf select
N in order to keep your current Nginx configuration file.

2.6.2 To install (if not performing an upgrade):

 apt-get install nginx -f

2.7 When the install is done, check your current version of Nginx:

 nginx -v
It should read: nginx version: nginx/1.3.8

2.8 Now just to be on the safe side and make sure everything is ok, restart the Nginx service followed by a reload of the configuration to make sure statuses are OK:

 service nginx restart
service nginx reload

You are done!

3. Now to see the status of your current services type in the following:

 service --status-all

Guide tested on:

Distributor ID: Ubuntu
Description:    Ubuntu 12.10
Release:        12.10
Codename:       quantal

  AND

Distributor ID: Debian
Description:    Debian GNU/Linux 6.0.6 (squeeze)
Release:        6.0.6
Codename:       squeeze

Post inspired from Clay Richardson.