Hacker Public Radio

HPR3266: Upgrading Debian on my raspberry pi


Listen Later

Pi13 upgrade from Jessie 8 to Stretch 9 - performed 15/12/20
History
Upgraded my raspberry pi 13, which I think had a minimal install Raspbian, Debian i.e. has no desktop installed. The Pi had a PiFaceIO board installed, refer to my previous HPR episode Hpr2901
Backup process, in case something went wrong
I first moved all the unnecessary files to free up as much space as possible
Shrunk the Pi partition on the installed 128GB SD card down to 25106MB (24.52GB), (25708544K), 26,325,549,056 bytes using partition magic
I calculated that this would be 51,417,088 blocks of 512 bytes
I used dd to make an image file and grabbed some unallocated space after partition by using count=55417088, refer to the command below
sudo dd if=/dev/sdb of=/home/stuart/pi-13-img-backup.img bs=512 count=55417088
I used the following command to image files to a spare 64GB SD card
sudo dd if=/home/stuart/pi-13-img-backup.img of=/dev/sdb bs=512 status=progress
I then expanded the partition to fill the full 64GB of the card
Booted from the 64GB card to make sure that I had a backup in case anything went wrong
Removed the 64GB card which I can go back to if things don't work out
Booted from 128GB card and expanded the partition using Gparted to fill 128GB SD card
I used the 128GB SD card to perform the upgrade, remember I have 64GB card to fall back on if things go wrong
Upgrade process
Source of information below
Step 1: Check available disk space
In order to update to Raspbian Stretch, there must be enough space on the SD card. Therefore you should check the available and used disk space usage first:
$ df -h
Step 2: Check package status
You must also check that all packages are in a state that is suitable for upgrade. The following command displays all packages that have the status semi-installed or configuration failed, and those with error status:
$ sudo dpkg --audit
$ sudo dpkg --get-selections | grep hold
Step 3: Update system
Before upgrading, the Raspbian should be completely updated:
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
Step 4: Modify Release
For upgrading to the new Raspbian version, the package lists must be adapted to the "Stretch" release. To do this, only the word "jessie" has to be replaced by "stretch". In order not to overlook any position, we simply let the replacement be done by the following command:
$ sudo sed -i /deb/s/jessie/stretch/g /etc/apt/sources.list
$ sudo sed -i /deb/s/jessie/stretch/g /etc/apt/sources.list.d/*.list
Step 5: Updating package lists
The new package lists must then be updated and imported:
$ sudo apt-get update
Step 6: Update to "Stretch"
Now we are ready to start the upgrade:
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
Step 7: Clean up installation
Old, unnecessary packages are removed after the system update with the following commands:
$ sudo apt-get autoremove
$ sudo apt-get autoclean
What was reported during upgrade
repo for get_iplayer no longer available so had to comment them out. On my Pi these were loca
...more
View all episodesView all episodes
Download on the App Store

Hacker Public RadioBy Hacker Public Radio

  • 4.2
  • 4.2
  • 4.2
  • 4.2
  • 4.2

4.2

34 ratings


More shows like Hacker Public Radio

View all
The Changelog: Software Development, Open Source by Changelog Media

The Changelog: Software Development, Open Source

290 Listeners

Defensive Security Podcast - Malware, Hacking, Cyber Security & Infosec by Jerry Bell and Andrew Kalat

Defensive Security Podcast - Malware, Hacking, Cyber Security & Infosec

372 Listeners

LINUX Unplugged by Jupiter Broadcasting

LINUX Unplugged

268 Listeners

SANS Internet Stormcenter Daily Cyber Security Podcast (Stormcast) by Johannes B. Ullrich

SANS Internet Stormcenter Daily Cyber Security Podcast (Stormcast)

651 Listeners

Curious Cases by BBC Radio 4

Curious Cases

820 Listeners

The Strong Towns Podcast by Strong Towns

The Strong Towns Podcast

422 Listeners

Late Night Linux by The Late Night Linux Family

Late Night Linux

164 Listeners

Darknet Diaries by Jack Rhysider

Darknet Diaries

8,061 Listeners

Cybersecurity Today by Jim Love

Cybersecurity Today

179 Listeners

CISO Series Podcast by David Spark, Mike Johnson, and Andy Ellis

CISO Series Podcast

189 Listeners

TechCrunch Daily Crunch by TechCrunch

TechCrunch Daily Crunch

42 Listeners

Strict Scrutiny by Crooked Media

Strict Scrutiny

5,794 Listeners

2.5 Admins by The Late Night Linux Family

2.5 Admins

98 Listeners

Cyber Security Headlines by CISO Series

Cyber Security Headlines

139 Listeners

What the Hack? by DeleteMe

What the Hack?

228 Listeners