What happens to installed packages on a sysupgrade in OpenWRT?

7

5

I've just upgraded my OpenWRT router from 10.03.1-rc4 to rc5 (testing).

It looks like all my installed packages are gone. Is that the expected behaviour? If yes, I should be able to just reinstalled them and load the configs from the backup, correct?

Georg Schölly

Posted 2011-05-01T13:29:50.200

Reputation: 1 146

Answers

7

The OpenWRT Wiki says you can't keep existing binaries, but need to reinstall them.

In particular, any manually installed software packages you may have installed after the initial OpenWrt installation have to be reinstalled after an OpenWrt upgrade. That way everything will match, e.g. the updated Linux kernel and any installed kernel modules.

Any configuration files or data files placed in locations not specifically listed as being preserved below will also be lost in an OpenWrt upgrade. Be sure to check any files you have added or customized from a default OpenWrt install to back up these items before an upgrade.

However, Tolaris gives the following command to take a list of your installed packages:

opkg list-installed | cut -f 1 -d ' '

TBBle

Posted 2011-05-01T13:29:50.200

Reputation: 185

8

You can backup your list of installed packages:

opkg list-installed | cut -f 1 -d ' ' > /etc/config/packages.list

(Put it into /etc/config folder so it will get retained between firmware updates)

and then after the update:

cat /etc/config/packages.list | opkg install

Janno

Posted 2011-05-01T13:29:50.200

Reputation: 81

2The cat part of this command never works for me so instead I do opkg install $(cat /etc/config/packages.list) which works perfectly :) – edude05 – 2014-07-25T13:41:51.550

The second command should probably be cat /etc/config/packages.list | xargs opkg install. – Julien Langlois – 2019-07-31T17:51:18.140