You can do this using
image-util may also give you a smaller
.img file, and run more quickly. Additionally, if you need to make changes to the original
.img file, you may do so without creating a new image - you may simply "update" the existing image.
As an alternative to the download link above, you may also install it from GitHub as follows:
git if you don't already have it:
sudo apt-get install git
$ git clone https://github.com/seamusdemora/RonR-RPi-image-utils.git
Cloning into 'RonR-RPi-image-utils'...
remote: Enumerating objects: 74, done.
remote: Counting objects: 100% (74/74), done.
remote: Compressing objects: 100% (56/56), done.
remote: Total 74 (delta 41), reused 34 (delta 13), pack-reused 0
Unpacking objects: 100% (74/74), done.
$ cd RonR-RPi-image-utils
$ chmod 755 image-*
To keep up-to-date with any changes, run this periodically:
git -C ~/RonR-RPi-image-utils pull https://github.com/seamusdemora/RonR-RPi-image-utils.git
You can put this command in your
crontab if you like to run once a week. There aren't many changes at present.
NOTE: I am not the author of
image-utils, nor do I make any changes at all to the source. I have put it on my GitHub site for my own convenience. I'm happy to share that if you prefer using git to keep your local sources updated (rather than dealing with the .zip file). I maintain sync with the master copy on the Raspberry Pi org's forum with a small script I've written to automate the process.