How to use sysupgrade -k for package reinstall


the option -k for the sysupgrade command is quite new to OpenWrt. It creates a file at /etc/backup/installed_packages.txt. As manually installed packages get lost during an upgrade this seems like a good approach to reinstall them after the upgrade.

Yet I cannot find any kind of information on how to make use of this file. Ideally there would also be a checkmarker saying: "Reinstall packages after upgrade". But even if I wanted to reinstall them manually by using this backup file, I have no idea, how.

Could someone please shed light into this topic please.

It looks like it's merely for convenience so you know what to reinstall after upgading. You could of course mangle the file with xargs or the likes, and feed that to opkg. That's what I would do.

Personally I'd be very hesitant to use automatism like that (other than using it as visual reminder), the package sets (and the naming of individual packages) is fluent between different (major-) releases, be it the the switch from wpad to wpad-basic or the move from fw3 to fw4, both are 'wanted' changes, but shuffle the installed package sets around to quite some extent.


Why not remember every package that a user requested as additional install and offer them to reinstall after an upgrade. I guess that would not cost very much effort to realize something like that.

I assume best practice would be to only remember the requested packages exactly, not their dependencies because they might have changed after an upgrade.
If the exact same name of a package is not available any more, the user can be informed about what's missing and maybe offered alternatives.

I really think this topic needs improvement. I used this forums hint a lot and hardly had any problems.

1 Like