Delete Old Ubiquiti EdgeRouter Firmware

The directions to upgrade firmware on the Ubiquiti EdgeRouter X suggest that you can optionally delete the old firmware, before adding the new one. I elected to skip this step, in case I needed to roll back for some reason. However, after performing the firmware upgrade, and rebooting the device, I felt comfortable cleaning up the older firmware.

Here’s the command you can use to accomplish this task.

$ sudo /usr/bin/ubnt-upgrade --delete
The system currently has the following image(s) installed:

v1.10.8.5142457.181120.1809    (running image) (default boot) 
v1.7.1.4821926.151103.1114     

You are about to delete image [v1.7.1.4821926.151103.1114]
Are you sure you want to delete ? (Yes/No) [Yes]: yes
Removing old image... Done

If you’d like to run this command silently, without prompts, inside of your automation scripts, you can use the –delete-noprompt parameter instead.

Before cleaning up the old firmware, I had very limited space.

Filesystem                Size      Used Available Use% Mounted on
ubi0_0                  214.9M    137.8M     72.4M  66% /root.dev
aufs                    214.9M    137.8M     72.4M  66% /
devtmpfs                124.3M         0    124.3M   0% /dev
tmpfs                   124.4M    248.0K    124.2M   0% /run
tmpfs                   124.4M    248.0K    124.2M   0% /run
tmpfs                   124.4M     60.0K    124.4M   0% /var/log
tmpfs                   124.4M      8.0K    124.4M   0% /tmp
none                    124.4M    472.0K    124.0M   0% /opt/vyatta/config

After cleaning up the old firmware, I reclaimed a significant portion of the small storage space.

Filesystem                Size      Used Available Use% Mounted on
ubi0_0                  214.9M     74.3M    135.9M  35% /root.dev
aufs                    214.9M     74.3M    135.9M  35% /
devtmpfs                124.3M         0    124.3M   0% /dev
tmpfs                   124.4M    248.0K    124.2M   0% /run
tmpfs                   124.4M    248.0K    124.2M   0% /run
tmpfs                   124.4M     60.0K    124.4M   0% /var/log
tmpfs                   124.4M      8.0K    124.4M   0% /tmp
none                    124.4M    472.0K    124.0M   0% /opt/vyatta/config