I'm a bit confused. Are you using a Pi? If so you would be updating everything with sudo apt update and sudo apt upgrade. If it's failing to update the Duet because it's on a beta firmware you can manually update the Duet over USB to get back in sync.

https://duet3d.dozuki.com/Wiki/Duet_3_Mini_5plus_Firmware#Section_Updating_firmware_via_USB