/dev/blog/ID10T

OpenWRT: Upgrade all packages with opkg

OpenWRT, Codebites Comments

Advertisement

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