Weekly Raspberry Pi Maintenance

I have three Raspberry Pi Model B machines I use for Mono experiments. Like any other system, these require periodic maintenance. Prior to getting the Raspberry Pi machines, it had been years since I did anything with Linux (mostly Slackware and Red Hat Linux, circa 2000 or so) and, as a result, I was forever looking up the steps and parameters I need to keep the software up to date and the free space maximized.

So, mostly for my own sanity, I've listed my weekly maintenance steps here.

  1. sudo apt-get update
    Use this to download the list of package from the repositories and discover the newest versions of packages and their dependencies.
  2. sudo apt-get dist-upgrade
    Since these aren't production machines, I'm comfortable using dist-upgrade rather than upgrade. If these machines were for something other than goofing around, then I'd be concerned with system predictability and switch over to upgrade.
  3. sudo apt-get clean
    This option clears out the local repository of retrieved package files. I used to run autoclean, as well. But, seeing as how autoclean only removes package files that can no longer be downloaded while clean removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/ I've started using clean.
  4. sudo apt-get autoremove
    Use this to remove packages that were automatically installed to satisfy dependencies for another package and are no longer needed. I'd have to do more research to see if this is redundant with clean.
There's a few tools, like localepurge, which can clean unnecessary local files. Plus there's other steps and tools I'm missing.

(This post on StackExchange addressed remove versus autoremove, in case you're interested. Plus, there were several useful posts on StackOverflow concerning upgrade versus dist-upgrade.)

Don't forget: The Raspberry Pi Foundation website has plenty of good documentation concerning maintenance and other topics.

And, of course, the next step is throw all these steps into a cron job and run it weekly.

Thoughts?

Update: To update the Raspberry Pi firmware, you can run the following command:
sudo rpi-update

Comments

Popular posts from this blog

Using Reference Aliases

List of Visual Studio Keyboard Shortcuts