Prereqs on your Raspberry Pi!
I’m seeing several posts where folks say they are new to programming, or new to the hardware. I see errors that indicate software may be out of date … All in all, it’s essential that we all keep the Raspberry Pi itself up to date. With that in mind, some house chores everyone should perform every once in a while - I do it once a week, others do it more often:
Keeping your Raspberry Pi distribution up to date - also applicable for those setting up their Raspberry Pis for the first time!
Please note, this is entirely separate from MagicMirror itself! This is strictly maintenance on the Raspberry Pi itself!
To update the actual operating system and the various software packages that are installed, run the following commands:
'sudo apt-get update'followed by
'sudo apt-get upgrade'(or you can combine both into one as
'sudo apt-get update; sudo apt-get upgrade')
The first one updates the mirror list of where those packages are on the internet. Each maintainer will have their own repository, so the list has to be updated before you attempt to run an upgrade. The upgrade command then lists all of the packages that need to be upgraded. It does this by comparing what version you have, and what version the current released one is. Unless you see errors, it will ask if it’s ok to download and install the updates. You would want to say yes. :) Why do we want to do this? Most package updates are due to some fault, error, or security issue discovered after it was originally released. So you want to stay up to date.
Another command to follow up with is
'sudo rpi-update'. This updates the core firmware on the Raspberry Pi. In some cases, when you perform an
'apt-get upgrade', it will trigger the
'rpi-update'as well, however that’s not always the case. I make it a habit to run it every time (and so far, every time I did so, there was firmware that needed upgrading.) The firmware is specific to the actual hardware itself. You want to do this.
Occasionally when you run the upgrade command, you might see a note about packages no longer needed which you can remove by typing in
'sudo apt-get autoremove'after the upgrade is done. This will remove software packages that aren’t needed anymore. It happens …
After this, you’ll want to restart your Raspberry Pi with a short and easy
'sudo reboot'command. It will restart, refresh its core files, and boot back up like it normally would. Life is good.
Make it a habit to do this on a regular basis. Whether once a week, once every other week, just make a habit of checking every so often.
Keeping your MagicMirror installation up to date with the current releases
Every once in a while, a new version will get pushed out onto GitHub. A post will be made on the forum with the CHANGELOG comments of what has been added, fixed, enhanced, and hopefully never broken, although I have seen that happen. When a new release gets pushed out, you’d want to update your local installation.
First, log into your Raspberry Pi. Change to the MagicMirror folder:
'cd MagicMirror', and then type in
'git pull'. This will compare your local installation with the master repository and download any new files into your installation. If all goes well, you can issue the command
'pm2 restart 'and your MagicMirror will restart with the updated files.
DISCLAIMER: We are not responsible if you light your house on fire because your Raspberry Pi decided to go BOOM. :) Honestly, I’ve never had any of my micros do that in the years that I’ve been working with them … treat them right, keep them updated and happy, and they last for ages.
NOW GO PLAY!