Update Raspbian on your Raspberry Pi

Before you begin to install any software it’s best to make sure the package files are up-to-date (essentially just a file pointing to the latest version of compatible software – for example when we install Midnight Commander later in the guide). Make sure you have an internet connection and run the following command. It may take a few minutes.

All you’ve got to do is follow these terminal commands and you’ll be up and running in, well, quite a while actually (it can takes ages, but you can leave it to it).

Note: No can never be too careful, so maybe it’s a good time to backup your most important files? If any…:-)

Start-up your Raspberry Pi as normal to the command prompt :

Make sure you have an internet connection and run the following command. It may take a few minutes.

Next, run

which will cause any packages with newer versions available to be updated.

Updating the kernel and firmware

Now update the Raspberry Pi’s firmware by typing:

Once that’s complete follow the command line prompt to reboot your Raspberry Pi with the following command:

Your Raspbian image should be up-to-date.


Sudo on Raspberry Pi

Root User / Sudo

Most users are allowed to run most programs, and to save and edit files stored in their own home folder. Normal users are not normally allowed to edit files in other users folders or any of the system files. There is a special user in Linux known as the superuser, which is usually given the username root. The superuser has unrestricted access to the computer and can do almost anything.


You will not normally log into to the computer as root, but can instead use the sudo command to provide access as the superuser. If you log into your Raspberry Pi as the pi user then you are logging in as a normal user. You can run commands as the root user by using the sudo command before the program you want to run.

For example if you want to install additional software on Raspbian then you normally use the apt-get tool. To be able to update the list of available software then you need to prefix the apt-get command command with sudo. sudo apt-get update

On a Raspberry Pi for example, you may already know that there are at least two users by default – the user pi that you normally log in as, and the user root, that is the superuser. With the root user you can do some completely damaging things, such as reboot the system delete all the users, and completely destroy the filing system on your disk. As the user pi, you can’t do any of those things, because you don’t have sufficient privileges to the files in the filing system required to do those things.

So, when you install new software or configure your hard disk, or reboot the system, we need a way to “temporarily elevate” our privilege so we can do that. All this does is change your “effective user id” to root – you are still really pi, you still have all the same settings as pi, you are still in the same directory as pi, but you temporarily have all the rights of the superuser root.


(Credit: Sudo on Raspberry Pi )



 Next Tutorial (Output)