Opkg upgrade confusion

I am used to sudo dnf upgrade (previously sudo yum update)

I suspect that I am doing this wrong. Currently:

  • opkg update
  • opkg list-upgradable
  • opkg upgrade (type list of packages from previous query)

Is there an easier way to do all of this? Pipes don't work because the package list requires escapes around the spaces. Moreover, should I be doing this in the first place?

No. Unless you know what you are doing.

You can upgrade vanilla packages (like nano, mwan3, htop) that have no relevance to the core functionality.

You should not update core system packets (procd, ubox, ubus etc.) as doing that may break things pretty badly. And may even prevent you from re-installing things easily.

And note that as you can't delete those package files that are in the originally flashed firmware, upgrading those packages will consume double flash space (as you will have both the new version and old version files there).

opkg in Openwrt/LEDE is meant for lightweight package installation, but the core functionality is not the mass update of all packages. The system is not built for that.

If you want to update core packages, the easiest method is to flash a new firmware that includes those.

1 Like

Adding to what @hnyman said, you could also compile your own firmware, which I always recommend, as it's the most convenient since your own config files and packages are included within it.

  • Compiling is fairly straight forward and I created a script for Ubuntu that auto sets up the buildroot, so the only thing you'd need to manually do is add the toolchain to your PATH in your bashrc, add the STAGING DIR variable, and export it.

  • ~/.bashrc additions example:

    • Add toolchain and staging directory to PATH (this will vary by device):

      • Toolchain :/home/jw0914/lede/source/staging_dir/toolchain-arm_cortex-a9+vfpv3_gcc-5.5.0_musl_eabi/bin:
      • Staging Directory :/home/jw0914/lede/source/staging_dir/host/bin:
    • Add STAGING_DIR variable:

      • STAGING_DIR=/home/jw0914/lede/source/staging_dir/toolchain-arm_cortex-a9+vfpv3_gcc-5.5.0_musl_eabi
    • Export STAGING_DIR variable:

      • export STAGING_DIR
    • It would also be helpful to add the following for when errors/warnings occur during make

      • export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

You can use the following command to install all available upgrades:
opkg update && opkg list-upgradable | awk -F ' - ' '{print $1}' | xargs opkg upgrade

But as others mentioned before, you should probably not do this.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.