How to Update Raspberry Pi 4
Ensuring that you keep your Raspberry Pi updated will help increase the security and stability of your Raspberry Pi. In this article I will cover how to quickly and easily update your Raspberry Pi 4.
Check for Raspberry Pi Updates
Begin by opening a new Terminal window. Then type in the following command which will retrieve the latest available packages.
sudo apt update
The SUDO command stands for Super User DO which gives root authorization to your currently logged in account (pi).
The APT command stands for Advanced Packaging Tool which manages installing, upgrading and removing software from your Raspberry Pi.
The UPDATE command obtains your system’s packages so they can be compared to the online versions.
Updating Raspberry Pi 4
To actually install the updates your Raspberry Pi, enter the following command which will show how much data will be downloaded and how much space it will take up on your disk.
sudo apt full-upgrade
Upon completion, it advisable to reboot your Raspberry Pi. But first you may want to remove any left over junk or clear your update directory cache. To reboot your Raspberry Pi 4 type in the following command into your Terminal window.
Removing Software Junk
Whenever you install an application (using apt or apt-get) the system will also install any required, dependent, software. This ensures that your recently installed software will operate correctly. However, when a program is updated or you remove a program one or more dependent files remain that are no longer needed. To help keep things in order it may be wise to remove these files which are no longer needed. To clean up your installation files, open a Terminal window and type in the following command and follow the on screen prompts.
sudo apt autoremove
Clear your Update Cache
By default your Raspberry Pi will keep every update it downloads and installs in a cache folder on your disk. This is very useful if you regularly add and remove apps (for testing), or you find yourself needing to reconfigure/reinstall a specific software package. But if you have limited disk space or are not in need of such a feature, you can clear this cache after updating by using the following command within a Terminal window:
sudo apt clean
I welcome your thoughts, questions or suggestions on my article on updating a Raspberry Pi 4.
You may support my work by sending me a tip using your Brave browser or by sending me a one time donation using your credit card.
Let me know if you found any errors within my article or if I may further assist you by answering any additional questions you may have.