Always Update and Upgrade

Overview:

apt-get and apt are ways to manage the packages installed on a linux system. apt commands are functionally equivalent to apt-get and apt-cache.

apt is recommended. However, either apt or apt-get can be used on raspbian.

apt or apt-get update loads the latest package index files into the repository index. The repository index is located in /etc/apt/sources.list.

apt upgrade installs the latest packages as identified by the repository index.

Step 2. Always update and upgrade before installing anything

To update the repository and then install the new packages run the commands (apt replaces apt-get):

$ sudo apt update -y

$ sudo apt upgrade -y

Step 3. [optional] Remove unneeded modules

Often after an upgrade, some modules will no longer be required. The following command removes them. It doesn't hurt to run it.

$ sudo apt autoremove -y

$ sudo reboot