Opkg: how to downgrade system package?

Hello so one day I decided to update system packages like "firewall" and such. I saw the available space going down very quickly, so I stopped doing it and searched on the web what was going on.
So basically as far as I know when you update a system package the original "stock" package remains installed in the firmware area, so that the new updated package cannot overwrite it.

My question is: how can I safely remove the updated version of the system packages I upgraded, and revert back the stock ones, in order to regain space? I don't really want to reflash the entire firmware after all the time I invested in its configuration.

Thanks

Probably easiest to just backup the config, restore to defaults, then restore the config. That should wipe any software you have installed so you may need to add back the packages that you want to keep (but their configs should be stored in the backup unless they don't store things properly).

3 Likes
  • backup the config
  • reset the router (which removes installed packages and config). Either via LuCI or via "firstboot" command.
  • reinstall possible add-on packages
  • restore config
2 Likes

What happens if instead I uninstall the upgraded system package? Wouldn't it work?

Not really, yes you would free up the space of the new package from the overlay, but that wouldn't bring you back the old version (neither functionality, nor space).

--
Yes, it is possible to operate on the overlay manually, on a file-by-file basis and remove files and whiteouts, but if you have to ask, you won't be able to do this properly. A full firstboot cycle is by far easier and recommended in this case.
While that doesn't appear to be the issue here, but if you really filled up your overlay beyond its maximum capacity, firstboot remains the only option anyways, as jffs2 doesn't recover gracefully (without reformatting) from disk full conditions.

2 Likes

Alright then. I'm not going to do it right now, but it's good to know there's a way to do this.

Also, is there a way to hide upgradable system packages in luci?

If your trying to have lean firmware with just the packages you need and even with your configuration as default you could use IMAGEBUILDER to build your own.

https://openwrt.org/docs/guide-user/additional-software/imagebuilder

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.