Free cookie consent management tool by TermsFeed Policy Generator

/dev/blog/ID10T

OpenWRT: Upgrade all packages with opkg

OpenWRT, Codebites Comments

Advertisement

Update April 2020: J. Reis rightfully mentioned in the comments this is not a good way. OpenWRT recommends flashing a sysupgrade.

There seems to be some indication that this may be a terrible idea and isn’t actually supported by OpenWRT in any official way (which may account for the lack of any simple GUI way of performing this function): https://forum.openwrt.org/t/okpg-upgrade-safeguards/30326

https://forum.openwrt.org/t/opkg-upgrade-vs-flashing-sysupgrade/58906 https://forum.openwrt.org/t/sysupgrade-instead-of-opkg-upgrade/32897/4

Original Post

I’m using OpenWRT on my Linksys WRT3200ACM. As the integrated package manager opkg does not have a pendant to apt-get dist-upgrade, this is the command I regularly execute, to upgrade the system:

opkg update && opkg list-upgradable| awk '{print $1}'| tr '\n' ' '| xargs -r opkg upgrade

I recommend running this command in a session detached from SSH. This way you’re safe in case your machine or the router get network problems. I’ve ran into that problem once which cost me a couple of hours for debuggin. Therefor I run the command in a detached tmux session:

tmux new -d "opkg update && opkg list-upgradable| awk '{print $1}'| tr '\n' ' '| xargs -r opkg upgrade"

If you are brave, you can automate this via cron. I prefer doing supervised updates regularly, as my router is a rather critical part of my infrastructure.

Advertisement

comments powered by isso

Advertisement