opkg upgrade all packages

OpenWrt does not have bash by default. The following commands are in pure busybox.

  1. Get installed packages by calling opkg list_installed
  2. Remove everything after ‘ – ‘ with sed
  3. Add opkg upgrade at the beginning of each line
  4. Finally we evaluate the sed output with eval

Full command:

# eval $(opkg list_installed | sed 's/ - .*//' | sed 's/^/opkg upgrade /')