Do You Need To Update Raspberry Pi? Let’s Find Out!

I’ve been a Windows user for a while now, and what I’ve come to expect of it are updates. Windows constantly bugs me about updating it. Moreover, the updates seem to take forever, which deters me from accepting the updates. Now that I’m working with Raspberry Pi, I’m starting to wonder: “Do you need to update Raspberry Pi?”

You should often perform updates on your Raspberry Pi so that it can run at its optimal performance. Updating your Raspberry Pi will improve your device’s security as well as making sure the packages it’s running is the most up-to-date version. These updated version could include security updates and bug fixes, which only adds to the overall wellbeing of your Raspberry Pi.

With this in mind, I will go over how you can update your Raspberry Pi, how long it should generally last, how often you need to update it, and a secret sauce method to have your Raspberry Pi automatically update itself.

How Do You Update Raspberry Pi?

Here are some easy steps to start updating your Raspberry Pi:

  • Open up the terminal
    • You can do this by clicking on the terminal icon. You would usually find this icon on the taskbar, which is usually located on the top of your screen. Starting from the top left and moving to the right, the terminal icon should be the fourth icon you see. For more clarification, it looks like a blackboard with the symbols “>_” on it.
    • An alternative easier way of opening your terminal is using the keyboard shortcut: CTRL + ALT + T.
  • Type the following command in the command line:
sudo apt update

This command basically updates the repository package.

  • Next, type the following command in the terminal:
sudo apt dist-upgrade

This command upgrades the packages, but it can also remove some files

You may encounter a prompt that asks “Do you want to continue?”. All you’ll need to do is type “y” and press enter.

  • After that, you should get rid of any unwanted files that were part of the upgrade by typing in the command:
sudo apt clean

Note: You won’t see any messages from the terminal after successfully running this command.

Finally, you should restart the whole system by typing either of the two following commands:

sudo reboot
sudo shutdown -r

How Often Do You Need To Update Raspberry Pi?

You should be updating your Raspberry Pi every 1-2 weeks. It’s not likely that there are new updates every day, so it’s okay to even perform the updates every 2 weeks.

How Long Does A Raspberry Pi Update Last?

A typical Raspberry Pi update should last anywhere between 10 to 20 minutes as long as you have good Internet connection. At maximum, the update would only last around 30 minutes.

You should encounter 2 stages of installation. The first stage of installation just downloads the necessary files, and it is usually safe to abort it by unplugging. The second stage is when it installs the necessary components, and it is not safe to abort the installation by unplugging it.

Does Raspberry Pi Automatically Update?

Raspberry Pi does automatically update itself by default.

You can check this by typing the following command in the terminal:

systemctl status apt-daily-upgrade.timer
You can see that my Raspberry Pi automatically updates (I highlighted the word enabled for you to see)

You can see if it’s enabled or disabled by looking at the second line of the result in between the two semicolons.

You can easily check the last time it was run by running the command:

stat -c %z /var/lib/apt/daily_lock
As you can see from the highlighted section, the last time my Raspberry Pi automatically updated was January 1, 2022 at 6:05 pm

On the other hand, if you don’t want your Raspberry Pi to continuously automatically update itself, you can always disable it.

Here are the four commands you’ll need to type in your terminal to disable it:

sudo systemctl mask apt-daily-upgrade
sudo systemctl mask apt-daily
sudo systemctl disable apt-daily-upgrade.timer
sudo systemctl disable apt-daily.timer

Now that you’ve finished, you can always check to see if it’s truly disabled by running this command again:

stat -c %z /var/lib/apt/daily_lock

If you want to enable auto-updates, you can do it by:

Installing Unattended Upgrades

To do this perform the following steps:

  • Open up your terminal
  • Type in the following command:
sudo apt-get install unattended-upgrades
  • Now, you’ll be asked “Do you want to continue?”. To get pass this, type “y” and press enter
  • After that, type in the following command to check if it was successfully installed:
systemctl status unattended-upgrades
You can see that unattended-upgrades is enabled here
  • Now, you’ll need to find the unattended-upgrades configuration files and modify it. To do that, type in the following command:
sudo nano /etc/apt/apt.conf.d/20auto-upgrades

Now, you’ll see a file like this:

This file contains information regarding whether you want auto updates and how often you want it. Here’s a table to break down what it means:

Update-Package-Lists1 – means that you want auto-update enabled
0 – means that you want auto-update disabled
Unattended-Upgrade1 – means that you want auto-upgrade enabled
0 – means that you want auto-upgrade disabled
AutocleanIntervalThis automatically cleans your packages for a certain amount of days. For example, I set it to 7, so my packages will be automatically cleaned every 7 days

Note: You might not see the AutoCleanInterval line when accessing the file, so you’ll need to add the following line:

APT::Periodic::AutocleanInterval “7”;

Summary – tl;dr (Too Long; Didn’t Read)

Here are some key take away points you need to keep in mind for the future after reading this article:

  • Like with any other computer, you need to frequently update your Raspberry Pi.
    • Doing this ensures that future packages you install will be up-to-date and that the security that’s running on your Raspberry Pi is updated too.
      • You’d want to install the latest package because it usually contain the latest bug fixes and security updates.
  • You can easily update your Raspberry Pi by typing in the following commands:
    • sudo apt update
    • sudo apt dist-upgrade
    • sudo apt clean
      • This will get rid of any unnecessary files
    • sudo reboot
      • This will restart your Raspberry Pi
  • An update for your Raspberry Pi should only take between 10 to 20 minutes (no more than 30 minutes tops)
  • You should be frequently updating your Raspberry Pi
    • You could update it once a week or once every 2 weeks
  • Your Raspberry Pi will automatically update itself
    • You can check the last time it updated itself by typing the following command in your terminal:
    • stat -c %z /var/lib/apt/daily_lock

In the end, I hope this article has updated you on all you need to know about updating your Raspberry Pi!

Similar Posts