• The friendly Linux forum for all users.
Dismiss Notice
Welcome to Linux Forum! As we have just launched, please help us grow by telling your friends about us and posting in the forum. Thanks!

Installing and using Raspbian

Discussion in 'LF Linux Articles' started by Jarret, Dec 15, 2016.

  1. Jarret

    Jarret Moderator Staff Member

    The Raspberry Pi, a small motherboard, has a special Operating System (OS) for it. Raspbian is a Debian based Linux distribution optimized for the hardware. For a beginner, Raspbian is a very powerful OS to use for learning the Raspberry Pi (RPi).

    Current Raspbian

    The current version of Raspbian is called Raspbian 'Jessie' which uses the kernel version 4.4. 'Jessie' was released on September 17th, 2016 which is also known as Debian 8.6.

    The Raspbian image file can be downloaded from https://www.raspberrypi.org/downloads/raspbian/. On this page you can either download the file with PIXEL or the LITE version.

    PIXEL stands for 'Pi Improved Xwindow Environment, Lightweight' and is based off of LXDE. The LITE version is a minimal installation version for the RPi.

    Raspbian Installation

    To use Raspbian download the image (IMG) file. To place it on the SD card you must have at least a 4 GB SD card which is compatible with the RPi. If you want you can order an SD card with the image preloaded on it from https://thepihut.com/products/raspbian-preinstalled-sd-card. The cost is around $7.50 with shipping being around $3.15 (depending on currency rates).

    If you wish to install it yourself, download the image you prefer. Insert the SD card into a USB port with the appropriate converter. Use Gparted or some such program to determine the designation of the SD card. Open a terminal and change the current directory to that of the downloaded image. Make sure you extract the compressed file (ZIP) if it is compressed. In the terminal type the following command replacing the filename and SD designation as needed:

    sudo dd if=raspbian-filename of=/dev/sdc bs=4m

    The 'raspbian-filename' is the image file downloaded containing Raspbian. The SD card was assumed in the command to be '/dev/sdc', but this can be sdb or any other designation. Be sure to have the appropriate one or you will overwrite the wrong device. The copying of the image to the SD card can take a few minutes, so be patient.

    Once done, place the SD card in the Pi and hook up your video connector, mouse, keyboard and possibly an Ethernet cable, unless you plan on using the WiFi device. Once all of this is done plug in the power connection to the micro USB port.

    If you have issues with power for the Pi, you need to use a 2.5 Amp charger. If power is a concern, use a wired connection and not the WiFi. Also, use a Bluetooth keyboard and mouse dongle to preserve power consumption. These hardware changes can help with low power issues.

    The system should now power on and boot to Raspbian and you should see a screen similar to Figure 1. After I booted Raspbian on my Raspberry Pi I found the free memory was around 560 MB of the 1 GB of RAM. To find the available RAM use the command 'free -h' in a terminal.

    Figure 01.jpg
    FIGURE 1

    Raspberry Pi Blink Codes

    During the boot process watch the lights on the end of the Raspberry Pi 3 (and others). The lights are located on the corner of the Pi between the power connector and the HDMI port. The one closest to the corner is the Power light (Red) and the other is the Activity light (green).

    When started the Red light should blink and remain solid. If the Red light blinks continuously then there is a power issue – most likely low power. No Red light at all means no power.

    If the Red light is on and the Green light is off, then there could be a few different issues. The main issue is the SD Card. It may not be inserted properly, the image on the card may not be complete or functioning or there is still a power issue.

    The following list shows what the issue may be if the Green LED is flashing the specified number of times:
    • 1 - the software is out of date. Update the software and try again. Make sure the SD card is 4 GB or larger
    • 2 - the SD card cannot be read
    • 3 - start.elf not found
    • 4 - start.elf not launched
    • 7 - kernel.img not found
    • 8 - SDRAM not recognized. Get newer bootcode.bin/start.elf firmware
    Once started you can then access all of the applications installed in Raspbian.

    Raspbian Applications

    Raspbian comes loaded with many applications. The programs preinstalled are as follows:

    Programming

    BlueJ Java IDE
    Geany
    Greenfoot Java IDE
    Mathematica
    Node-RED
    Python 2
    Python 3
    Scratch
    Sense HAT Emulator
    Sonic Pi
    Wolfram​
    Office
    LibreOffice (v.4.3.3.2)​
    Internet
    Chrome Browser
    Claws Mail
    Raspberry Pi Resources
    MagPi
    VNC Address Book
    VNC Viewer​
    Games
    Minecraft Pi Edition
    Python Games​
    Accessories
    Archiver
    Calculator
    File Manager
    Image Viewer
    PDF Viewer
    SD Card Copier
    Task Manager
    Terminal
    Text Editor​

    Other applications can be installed using the 'apt-get' commands in a terminal or by using the software installer similar to Synaptic.

    If you want to update your 'Jessie' system to fix a security issue as well as get the updated apps, execute the following commands from a terminal:
    • sudo apt-get update
    • sudo apt-get dist-upgrade
    • sudo apt-get install -y pprompt
    • sudo apt-get install -y rpi-chromium-mods
    • sudo apt-get install -y python-sense-emu python3-sense-emu
    • sudo apt-get install -y python-sense-emu-doc
    • sudo reboot
    The update is already included in the current download. The security issue is caused by the original image having SSH enabled by default. With SSH enabled the username and password is set to a default. The default username is 'pi' and the password is 'raspberry'. Once you have the RPi started you should enable SSH, if needed, and always change the default password. Even if you get the updated download you need to change the default password.

    To change the password go to the Raspberry Pi Configuration tool or open it from the terminal with the command 'raspi-config'. On the System tab select 'Change Password' and then type in the current password then specify a new password.

    PIXEL

    PIXEL, as mentioned before, is based off LXDE and provides a High Definition (HD) resolution. The resolution can be something like 1920x1080. There are a few wallpapers included, but you can add your own to the list by placing the files in the '/usr/share/pixel-wallpaper/' folder.

    On the desktop in the top right corner is where two icons may appear. The first is a lightning bolt. The lightning bolt shows that the Raspberry Pi does not have enough power. It is time to get a charger which is 5 volts, but more amps – up to 2.5 (some people may go as high as 3). A thermometer can appear to show that the Raspberry Pi is overheating. If overheating is an issue, then you need to look into a cooling fan. Cooling fans can be found for less than $5 on Ebay.

    Rasbian 'Jessie' now uses the Chromium Browser instead of the Epiphany browser. You can still start the Epiphany Browser from a terminal with the command 'epiphany-browser'.

    OS Updates

    Those of you familiar with Linux will already know this, but I think it may be best to cover this for newcomers.

    Occasionally you should update Raspbian to any newer drivers, apps and other files to help fix glitches, improve performance and the like. The following commands can be used in a terminal to check for updates:
    • sudo apt-get update
    • sudo apt-get dist-upgrade
    You may need to check often how much available free space you have left on your SD card. The command to check the free space is 'df -h'.

    It is important to know that any updated files are downloaded and kept in '/var/cache/apt/archives', but you can easily remove the files with the command 'sudo apt-get clean'.
     

Share This Page