At this point you should be able to update the system via
sudo apt-get update <== this refreshes the list of available packages
sudo apt-get upgrade <== This examines the system to see what needs to be updated.
If you get a bunch of errors during apt-get update
, make sure you have a good network connection that’s connected to the external Internet and that the clock is set to the correct time. You must resolve any network issues before you continue.
Apt-get upgrade will offer you a long list of things to update. Allow it to continue.
Note that this will take a long time to complete with the time being longer or shorter depending on your network speed. : Now is a good time to:
(One or more of the following)
- Get a cup of tea or coffee and read.
- Run errands for your wife/girlfriend.
- Cut the grass.
- Do laundry.
- Finish homework for classes or attend that lab session you’ve been putting off forever.
- Study for the exam that’s going to be 50% of your final grade.
- Etc.
Once the update is complete, do the following two things:
sudo apt-get autoremove. <== select "yes"
sudo apt-get clean
This cleans up the package cache which is a desirable maintenance thing periodically.
==============================
OPTIONAL (but highly recommended)
One of the things I recommend for systems like this, is to set up a periodic forced disk check, just in case something begins to go wrong. It’s cheap insurance.
I am assuming that you’re using a SD card plugged into the Raspberry Pi directly. If not, use “mount” in a terminal window to find out what the root device is.
My root device is set to:
/dev/mmcblk0p2 on / type ext4 (rw,noatime,discard)
(Yours probably won’t say “discard”. That’s a further refinement that we can discuss later if you wish.)
In this case, “/dev/mmcblk0p2” is the device/partition the ext-4 filesystem is mounted on. Yours should be virtually identical to mine if you are running a stock GoPiGo O/S image.
Execute the following command in a terminal window:
sudo tune2fs -c 5 -C 6 -i 5 -e remount-ro /dev/mmcblk0p2
Translation:
- tune2fs is a utility that allows you to set various important parameters of the filesystem that define how it works. For example, you can change the UUID if you need to, to prevent signature collisions.
- -c 5 This sets the maximum number of times the filesystem can be mounted before forcing a fsck. After five reboots, the filesystem will automatically check itself for any discrepancies that might have crept in.
- -C 6 This sets the current mount count - that is, you are telling the system that the filesystem has already been mounted six times since the last fsck - and this will force a fsck the very next time the robot boots up. (a good idea)
- -i 5 This tells the system that, no matter how many times the filesystem has been mounted, if five days have passed without a fsck, do one now.
This protects the system against “bit rot” if the system is left idle for days at a time.
- -e remount-ro This sets what happens if the filesystem fails a fsck in a way that cannot be repaired, or the system detects an error when the system is running. This tells the system to remount the root filesystem read-only.
Note that these are very conservative settings designed to provide the maximum protection for the filesystem.
Also note that, especially for a school project or something else important, frequent periodic backups are essential as systems can go pear-shaped for seemingly unknown reasons.
At this point you can reboot the robot and prepare to have fun with it.
Next: Other things you can do.