Skip to content

Instantly share code, notes, and snippets.

@tiagox
Last active March 26, 2016 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiagox/b47b2611cba2502dd0de to your computer and use it in GitHub Desktop.
Save tiagox/b47b2611cba2502dd0de to your computer and use it in GitHub Desktop.
This is an installation guide for Debian GNU/Linux

Installation Guide for GNU/Linux Debian.

Disclaimer: for more help please use man <command> or go to http://explainshell.com/ and paste your command for a detailed explanation.

Create a booteable USB drive.

Identify the USB drive devise:

$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 298.1G  0 disk
├─sda1   8:1    0   200M  0 part
├─sda2   8:2    0    50G  0 part
├─sda3   8:3    0     1K  0 part
├─sda4   8:4    0  14.8G  0 part
├─sda5   8:5    0    29G  0 part
├─sda6   8:6    0  47.7G  0 part /
├─sda7   8:7    0   1.9G  0 part [SWAP]
└─sda8   8:8    0 154.6G  0 part /home
sdb      8:16   1   1.9G  0 disk
├─sdb1   8:17   1   627M  0 part /media/tiagox/Kingston
└─sdb2   8:18   1   416K  0 part
sr0     11:0    1  1024M  0 rom

You can figure it out through the SIZE of the unit or through the MOUNTPOINT path. In this case the UBS stick correspond to /dev/sdb and it's mounted, so you have to unmount it:

$ sudo umount /media/tiagox/Kingston
$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 298.1G  0 disk
├─sda1   8:1    0   200M  0 part
├─sda2   8:2    0    50G  0 part
├─sda3   8:3    0     1K  0 part
├─sda4   8:4    0  14.8G  0 part
├─sda5   8:5    0    29G  0 part
├─sda6   8:6    0  47.7G  0 part /
├─sda7   8:7    0   1.9G  0 part [SWAP]
└─sda8   8:8    0 154.6G  0 part /home
sdb      8:16   1   1.9G  0 disk
├─sdb1   8:17   1   627M  0 part
└─sdb2   8:18   1   416K  0 part
sr0     11:0    1  1024M  0 rom

The MOUNTPOINT should be empty. Now we're able to copy the ISO image into the pen drive, with the dd application.

$ sudo dd if=debian-7.4.0-amd64-netinst.iso of=/dev/sdb bs=4M; sync

This process will take a while, please wait. Once it finishes, reboot your PC and begin the installation.

Make me a sudoer.

Reference: https://wiki.debian.org/sudo

$ su -
# apt-get install sudo
# adduser tiagox sudo # or replace tiagox with other username.

Edit the /etc/sudoers file.

# visudo

Add the following line to the sudoers config file:

Defaults        env_keep += HOME

The user should logout and login to make this changes available.

Remove CD-ROM repositories.

  1. Open synaptic
  2. Go to Settings > Repositories
  3. Select and Delete all the repositories that starts with cdrom:.
  4. Close the window and the repository list will be updated.

Also you can edit the file /etc/apt/sources.list, and remove the CD-ROM related lines manually.

Add more and better repositories.

Make sure to use redirector for your sources: http://http.debian.net/

This is a possible sources.list file for Debian Jessie.

deb http://httpredir.debian.org/debian/ jessie main contrib non-free
deb-src http://httpredir.debian.org/debian/ jessie main contrib non-free

deb http://httpredir.debian.org/debian/ jessie-backports main
deb-src http://httpredir.debian.org/debian/ jessie-backports main

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

# jessie-updates, previously known as 'volatile'
deb http://httpredir.debian.org/debian/ jessie-updates main
deb-src http://httpredir.debian.org/debian/ jessie-updates main

Then update the packages list and upgrade your system:

$ sudo apt-get update
$ sudo apt-get upgrade -y
$ sudo apt-get dist-upgrade -y

Install a lot of things.

This is a list of all the packages that will be necessary in your system. This list correspond to the packages that probably don't need to much information about how or why install them.

$ sudo apt-get install \
    zsh vim tmux curl build-essential openssh-server rar unrar meld xchat vlc \
    trash-cli \
    git git-gui gitk \
    php5 php5-curl \
    docker.io \
    mysql-client mysql-workbench redis-tools mongodb-clients grc \ # db stuff
    hplip hplip-gui \ # printers stuff
    python-pip \
    ttf-mscorefonts-installer libcanberra-gtk-module fonts-knda texlive-fonts-extra \
    openjdk-7-jdk \
    libxml2-dev libbz2-dev libxslt1-dev # PHPBrew

Set zsh as your default shell

$ chsh tiagox -s /bin/zsh

The user should logout and login to make this changes available.

Install Google Chrome

Download from https://www.google.com/chrome/browser/desktop/

$ cd ~/Downloads/
$ sudo dpkg -i google-chrome-stable_current_amd64.deb
$ sudo apt-get install -f

Install Skype

Download from http://www.skype.com/en/download-skype/skype-for-computer/

Reference: https://wiki.debian.org/skype#Debian_7_.22Wheezy.22

$ sudo dpkg --add-architecture i386
$ sudo apt-get update
...
$ cd ~/Downloads
$ sudo dpkg -i skype-debian_4.3.0.37-1_i386.deb
$ sudo apt-get install -f

Install Sublime Text 3

Download from http://www.sublimetext.com/3

$ cd ~/Downloads/
$ sudo dpkg -i sublime-text_build-3083_amd64.deb
$ sudo apt-get install -f

Install Dropbox

Download from https://www.dropbox.com/install?os=lnx

$ cd ~/Downloads/
$ sudo dpkg -i dropbox_2015.02.12_amd64.deb
$ sudo apt-get install -f

Install nvm

Reference: https://github.com/creationix/nvm

$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.26.1/install.sh | bash
$ nvm install stable
$ nvm alias default stable

Install Ruby

ruby-install

Reference: https://github.com/postmodern/ruby-install

$ wget -O ruby-install-0.5.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.5.0.tar.gz
$ tar -xzvf ruby-install-0.5.0.tar.gz
$ cd ruby-install-0.5.0/
$ sudo make install
...
$ ruby-install ruby # Install the last ruby version.
$ ruby-install ruby 1.9 # Install and older and stable ruby version.

It would be nice to check the repository in case the installation process changed.

chruby

Reference: https://github.com/postmodern/ruby-install

$ wget -O chruby-0.3.9.tar.gz https://github.com/postmodern/chruby/archive/v0.3.9.tar.gz
$ tar -xzvf chruby-0.3.9.tar.gz
$ cd chruby-0.3.9/
$ sudo make install
...
$ chruby
   ruby-1.9.3-p547
   ruby-2.1.3
$ chruby 2.1.3

It would be nice to check the repository in case the installation process changed.

Giving non-root access to use docker

$ sudo groupadd docker
$ sudo gpasswd -a ${USER} docker
$ sudo service docker restart

Docker services

In order to be able to use different version of some services. Docker container will be used.

For some database container, we'll create a folder in our home directory, to store all the data for each engine, as follows:

$ mkdir ~/Databases
$ cd ~/Databases
$ cd ~/mysql_data
$ cd ~/mongo_data

Run MySQL as a Docker container

Create the container:

docker run \
    --name mysql \
    -v /home/tiagox/Databases/mysql_data:/var/lib/mysql \
    --publish 3306:3306 \
    --environment MYSQL_ROOT_PASSWORD=root \
    --detach mysql:5.5

Once the container was created, you don't need to create a new one. docker run actually creates a container and should be executed just for the first time. After that, you can start/stop the container when you need it.

Start the container:

$ docker start mysql

Stop the container:

$ docker stop mysql

Connect to the service:

$ # Note that the IP address is used instead of the hostname.
$ mysql -u root -p -h 127.0.0.1 -P 3306

Run Redis as a Docker container

Create the container:

$ docker run \
    --name redis \
    --publish 6379:6379 \
    --detach redis

Once the container was created, you don't need to create a new one. docker run actually creates a container and should be executed just for the first time. After that, you can start/stop the container when you need it.

Start the container:

$ docker start redis

Stop the container:

$ docker stop redis

Connect to the service:

Run MongoDB as a Docker container

Create the container:

$ docker run \
    --name mongo \
    -v /home/tiagox/Databases/mongo_data:/data/db \
    --publish 27017:27017 \
    --detach mongo --smallfiles

Once the container was created, you don't need to create a new one. docker run actually creates a container and should be executed just for the first time. After that, you can start/stop the container when you need it.

Start the container:

$ docker start mongo

Stop the container:

$ docker stop mongo

Connect to the service:

Useful commands

  • dconf-editor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment