Installing Raspbian on a Raspberry Pi
Congratulations on getting a Raspberry Pi. I am guessing you are building something cool with it and you want to get started. In this tutorial, you will learn about installing Raspbian OS and initiating a desktop environment on your raspberry pi. You might be trying to build a Raspberry Pi supercomputer or a server or anything else, Raspbian will help you a lot.
If you have already checked out the official Raspberry Pi website, might have seen them recommending the “NOOBS” or “NOOBS LITE” Operating System. They recommend this OS for beginners. But using the Pi is very easy and from being a beginner, one will turn pro in no time. So, it’s better to go with the more powerful and more efficient OS, the Raspbian. The main reason why Installing Raspbian and using it is extremely popular is that it has thousands of pre-built libraries. They optimise the OS and help in performing other tasks. This forms a huge advantage while building applications.
1 Downloading Raspbian and Image writer
Download the latest version of Raspbian from here. You can download it directly or via the torrents.
You will be needing an image writer to write the downloaded OS into the SD card (micro SD card in case of Raspberry Pi B+ model). So download the “win32 disk imager” from here.
2 Writing the image
Insert the SD card into the laptop/pc and run the image writer. Once open, browse and select the downloaded Raspbian image file. Select the correct device, that is the drive representing the SD card. If the drive (or device) selected is different from the SD card then the other selected drive will become corrupted. SO be careful.
After that, click on the “Write” button in the bottom. As an example, see the image below, where the SD card (or micro SD) drive is represented by the letter “G:\”
Once the write is complete, eject the SD card and insert it into the Raspberry Pi and turn it on. It should start booting up.
3 Setting up the Pi
This is one of the most important steps while installing Raspbian. Please remember that after booting the Pi, there might be situations when the user credentials like the “username” and password will be asked. Raspberry Pi comes with a default username and password and so always use it whenever it is being asked. The credentials are:
login: pi password: raspberry
When the Pi has been booted for the first time, a configuration screen called the “Setup Options” should appear and it will look like the image below.
If you have missed the “Setup Options” screen, its not a problem, you can always get it by typing the following command in the terminal.
sudo raspi-config
Once you execute this command the “Setup Options” screen will come up as shown in the image above.
Now that the Setup Options window is up, we will have to set a few things. After completing each of the steps below, if it asks to reboot the Pi, please do so. After the reboot, if you don’t get the “Setup Options” screen, then follow the command given above to get the screen/window.
-
The first thing to do:
select the first option in the list of the setup options window, that is select the “Expand Filesystem” option and hit the enter key. We do this to make use of all the space present on the SD card as a full partition. All this does is, expand the OS to fit the whole space on the SD card which can then be used as the storage memory for the Pi.
-
The second thing to do:
select the third option in the list of the setup options window, that is select the “Enable Boot To Desktop/Scratch” option and hit the enter key. It will take you to another window called the “choose boot option” window that looks like the image below.
In the “choose boot option window”, select the second option, that is, “Desktop Log in as user ‘pi’ at the graphical desktop” and hit the enter button. Once done you will be taken back to the “Setup Options” page, if not select the “OK” button at the bottom of this window and you will be taken back to the previous window. We do this because we want to boot into the desktop environment which we are familiar with. If we don’t do this step then the Raspberry Pi boots into a terminal each time with no GUI options.
Once, both the steps are done, select the “finish” button at the bottom of the page and it should reboot automatically. If it doesn’t, then use the following command in the terminal to reboot.
sudo reboot
4 Updating the firmware
After the reboot from the previous step, if everything went right, then you will end up on the desktop which looks like the image below.
Once you are on the desktop, open a terminal and enter the following command to update the firmware of the Pi. You are now almost done with installing Raspbian.
sudo rpi-update
Updating the firmware is necessary because certain models of the Pi might not have all the required dependencies to run smoothly or it may have some bug. The latest firmware might have the fix to those bugs, thus it’s very important to update it in the beginning itself.
That’s It, Folks! Installing Raspbian is now Complete
So, that would be the completion of the installing Raspbian. Do share this posts on Facebook, twitter, google plus, etc. Comment if you have any issues or just share your thoughts. All the best in building your amazing application with the Raspberry Pi.