Getting started with Linux and the Raspberry Pi can be daunting. Hopefully this post helps alleviate the pain for those just starting out.

 

Before you start, I'm assuming you already have a Raspberry Pi (RPi) and an SD card (microSD for the model B+). Life will be a bit easier if you have a monitor and keyboard that you can use with the RPi, although it's not essential.

 

Download an OS image

Firstly you want to choose a Linux image. I normally use the Raspbian distribution. You can also try the NOOBS image, which provides a number of options of operating systems.

http://www.raspberrypi.org/downloads/

 

Burn the image to your SD card

I use the free tool Win32 Disk Imager on Windows to write the image to my SD card. Full instructions are documented at http://www.raspberrypi.org/documentation/installation/installing-images/README.md

 

Boot the Raspberry Pi

Once the image has been written to the SD card, put the card into your RPi.  Also plug the ethernet cable into the RPi to connect it to the network.

 

If you are using a monitor you also want to connect the HDMI cable to the RPi before you power it up.

 

Now turn on the Rpi by plugging your power cable into the microUSB socket.

 

If you have a monitor , you'll see a bunch of messages will while the RPi is starting up - it will take around 30 seconds.

 

 

Finding your Pi on the network

If you have a monitor and keyboard connected to the Pi, you can skip this step.

If you don't have an external monitor connected to the Pi, you'll need to connect to it via Ethernet. To do this we'll need to find its IP address.

 

The tool I use is Advanced IP Scanner. It generally picks up the subnets automatically, so you just need to hit "Scan" and wait.

 

Once it's done, you want to look down the Manufacturer column for entries called "Raspberry Pi Foundation". Make a note of the IP address.

 

advanced ip scanner.png

 

Connecting to the Pi

You can connect to the Pi using SSH over ethernet to run commands, install software, etc.

The best tool on Windows is Putty. Enter the IP address of your Pi, and make sure the port is 22 and the connection type is SSH, then click "Open".

putty.png

 

Logging in

You can either log in over SSH or using an attached keyboard and monitor.

The default username for Raspbian is "pi" (without the quotes) and the password is "raspberry".

 

Extending the partition on the SD card

By default, the image you burned to the SD card earlier doesn't actually use the entire space of the SD card.

You will want to run sudo raspi-config and select  "Expand Filesystem" . After you have rebooted (sudo reboot) the partition will be extended to the size of your SD card.

 

 

Updating software

Generally one of the first things I will do is make sure the latest packages are installed. This is done with 2 commands:

 

  • sudo apt-get update makes sure the list of packages is up to date
  • sudo apt-get upgrade installs the latest packages

 

apt-get upgrade.png

 

There is another command sudo rpi-update which will update the firmware and kernel to the latest (bleeding-edge) versions. Typically you don't need to do this unless a particular app requires it.

 

rpi-update.png

 

Miscellaneous commands

You may find these useful:

  • sudo dpkg-reconfigure tzdata - change your timezone