Update packages: Needed free space = size of package, not different size between versions. How to upgrade?

My device which runs OpenWRT has it's internal memory almost exhausted:

df -h:

Filesystem                Size      Used Available Use% Mounted on
/dev/root                 3.5M      3.5M         0 100% /rom
tmpfs                    59.7M      1.0M     58.6M   2% /tmp
/dev/mtdblock6           10.0M      9.7M    324.0K  97% /overlay
overlayfs:/overlay       10.0M      9.7M    324.0K  97% /
tmpfs                   512.0K         0    512.0K   0% /dev

324.0 KiB left.

Now, I want to upgrade. But upgrade fails, because the upgrade process needs free space as much as a new installation of a package would be, not just the difference between the old package and the upgrade:
opkg upgrade wpad-wolfssl:

Upgrading wpad-wolfssl on root from 2023-06-22-599d00be-1.2 to 2023-09-08-e5ccbfc6-4...
Collected errors:
 * verify_pkg_installable: Only have 324kb available on filesystem /overlay, pkg wpad-wolfssl needs 699

Is there a way to upgrade packages "in place" or so, so that only that amount of free space is needed that is the difference of the package size of the new version and the old version?

Regards!

You shouldn't do this:

Use the firmware-selector to upgrade to a newer OpenWrt version instead.

4 Likes

So I need to extract the list of installed packages to feed this into "Customize installed packages and/or first boot script"? -- Without custom packages, I don't easily have internet with the device which makes installing the required packages after the update a hassle, since it requires special packages for USB 4G dongle.

yes, that's correct

1 Like

And using attended sysupgrade?

(btw., while trying, ppp-multilink triggers an error building the package, since the package builder seems not to notice that ppp-multilink also provides ppp and thus wants to install both ppp and ppp-multilink, resulting in a conflict:

[...]
Collected errors:
 * check_data_file_clashes: Package ppp-multilink wants to install file /builder/build_dir/target-mipsel_24kc_musl/root-ramips/etc/ppp/chap-secrets
	But that file is already provided by package  * ppp
 * check_data_file_clashes: Package ppp-multilink wants to install file /builder/build_dir/target-mipsel_24kc_musl/root-ramips/etc/ppp/filter
	But that file is already provided by package  * ppp
 * check_data_file_clashes: Package ppp-multilink wants to install file /builder/build_dir/target-mipsel_24kc_musl/root-ramips/etc/ppp/options
	But that file is already provided by package  * ppp
 * check_data_file_clashes: Package ppp-multilink wants to install file /builder/build_dir/target-mipsel_24kc_musl/root-ramips/lib/netifd/ppp-down
	But that file is already provided by package  * ppp
 * check_data_file_clashes: Package ppp-multilink wants to install file /builder/build_dir/target-mipsel_24kc_musl/root-ramips/lib/netifd/ppp-up
	But that file is already provided by package  * ppp
 * check_data_file_clashes: Package ppp-multilink wants to install file /builder/build_dir/target-mipsel_24kc_musl/root-ramips/lib/netifd/ppp6-up
	But that file is already provided by package  * ppp
 * check_data_file_clashes: Package ppp-multilink wants to install file /builder/build_dir/target-mipsel_24kc_musl/root-ramips/lib/netifd/proto/ppp.sh
	But that file is already provided by package  * ppp
 * check_data_file_clashes: Package ppp-multilink wants to install file /builder/build_dir/target-mipsel_24kc_musl/root-ramips/usr/sbin/pppd
	But that file is already provided by package  * ppp
 * opkg_install_cmd: Cannot install package ppp-multilink.
[...]
Request to the sysupgrade server:
{
    "url": "https://sysupgrade.openwrt.org",
    "revision": "r23389-5deed175a5",
    "advanced_mode": "1",
    "sha256_unsigned": "",
    "branch": "23.05",
    "efi": null,
    "request_hash": "418e536eaac26c8dfb5b301a399e8e65",
    "profile": "vocore,vocore2",
    "target": "ramips/mt76x8",
    "version": "23.05.0-rc3",
    "packages": [
        "auc",
        "base-files",
        "busybox",
        "ca-bundle",
        "cgi-io",
        "comgt-ncm",
        "dnsmasq",
        "dropbear",
        "f2fsck",
        "firewall4",
        "fstools",
        "fwtool",
        "getrandom",
        "gpioctl-sysfs",
        "gpiod-tools",
        "hostapd-common",
        "ip6tables-nft",
        "iptables-nft",
        "iw-full",
        "iwinfo",
        "jansson",
        "jshn",
        "jsonfilter",
        "kernel",
        "kmod-cfg80211",
        "kmod-crypto-acompress",
        "kmod-crypto-aead",
        "kmod-crypto-ccm",
        "kmod-crypto-cmac",
        "kmod-crypto-crc32c",
        "kmod-crypto-ctr",
        "kmod-crypto-gcm",
        "kmod-crypto-gf128",
        "kmod-crypto-ghash",
        "kmod-crypto-hash",
        "kmod-crypto-hmac",
        "kmod-crypto-manager",
        "kmod-crypto-null",
        "kmod-crypto-rng",
        "kmod-crypto-seqiv",
        "kmod-crypto-sha512",
        "kmod-fs-f2fs",
        "kmod-gpio-beeper",
        "kmod-gpio-button-hotplug",
        "kmod-i2c-gpio",
        "kmod-leds-gpio",
        "kmod-ledtrig-activity",
        "kmod-ledtrig-audio",
        "kmod-ledtrig-gpio",
        "kmod-ledtrig-oneshot",
        "kmod-ledtrig-pattern",
        "kmod-ledtrig-transient",
        "kmod-ledtrig-tty",
        "kmod-lib-crc-ccitt",
        "kmod-lib-crc32c",
        "kmod-lib-lzo",
        "kmod-mac80211",
        "kmod-macvlan",
        "kmod-mdio-gpio",
        "kmod-mhi-wwan-mbim",
        "kmod-mmc-spi",
        "kmod-mt76-core",
        "kmod-mt7603",
        "kmod-mux-gpio",
        "kmod-nf-conntrack",
        "kmod-nf-conntrack6",
        "kmod-nf-flow",
        "kmod-nf-log",
        "kmod-nf-log6",
        "kmod-nf-nat",
        "kmod-nf-reject",
        "kmod-nf-reject6",
        "kmod-nfnetlink",
        "kmod-nft-core",
        "kmod-nft-fib",
        "kmod-nft-nat",
        "kmod-nft-offload",
        "kmod-ovpn-dco",
        "kmod-ppp",
        "kmod-pppoe",
        "kmod-pppox",
        "kmod-sdhci-mt7620",
        "kmod-slhc",
        "kmod-spi-gpio",
        "kmod-usb-ledtrig-usbport",
        "kmod-usb-net-cdc-eem",
        "kmod-usb-net-cdc-ether",
        "kmod-usb-net-cdc-ncm",
        "kmod-usb-net-cdc-subset",
        "kmod-usb-net-huawei-cdc-ncm",
        "kmod-usb-net-qmi-wwan",
        "kmod-usb-ohci",
        "kmod-usb-serial",
        "kmod-usb-serial-ftdi",
        "kmod-usb-serial-option",
        "kmod-usb-serial-simple",
        "kmod-usb-serial-wwan",
        "kmod-usb-storage",
        "kmod-usb-storage-extras",
        "kmod-usb-storage-uas",
        "kmod-usb-wdm",
        "kmod-usb2",
        "libblobmsg-json",
        "libiwinfo",
        "libiwinfo-data",
        "libjson-c",
        "libjson-script",
        "liblucihttp",
        "liblucihttp-ucode",
        "libmnl",
        "libnftnl",
        "libnl-tiny",
        "libubox",
        "libubus",
        "libuci",
        "libuclient",
        "libucode",
        "libustream-wolfssl",
        "logd",
        "luci",
        "luci-app-attendedsysupgrade",
        "luci-app-firewall",
        "luci-app-ledtrig-rssi",
        "luci-app-ledtrig-switch",
        "luci-app-ledtrig-usbport",
        "luci-app-openvpn",
        "luci-app-opkg",
        "luci-app-sqm",
        "luci-app-uhttpd",
        "luci-app-watchcat",
        "luci-base",
        "luci-light",
        "luci-mod-admin-full",
        "luci-mod-network",
        "luci-mod-status",
        "luci-mod-system",
        "luci-proto-3g",
        "luci-proto-ipv6",
        "luci-proto-mbim",
        "luci-proto-modemmanager",
        "luci-proto-ncm",
        "luci-proto-ppp",
        "luci-proto-qmi",
        "luci-proto-wireguard",
        "luci-theme-bootstrap",
        "mbim-utils",
        "mmc-utils",
        "mtd",
        "netifd",
        "nftables-json",
        "odhcp6c",
        "odhcpd-ipv6only",
        "openvpn-mbedtls",
        "openwrt-keyring",
        "opkg",
        "picocom",
        "ppp-mod-pppoe",
        "ppp-multilink",
        "procd",
        "procd-seccomp",
        "procd-ujail",
        "px5g-wolfssl",
        "rpcd",
        "rpcd-mod-file",
        "rpcd-mod-iwinfo",
        "rpcd-mod-luci",
        "rpcd-mod-rrdns",
        "rpcd-mod-ucode",
        "spi-tools",
        "spidev-test",
        "swconfig",
        "tc-full",
        "ubox",
        "ubus",
        "ubusd",
        "uci",
        "uclient-fetch",
        "ucode",
        "ucode-mod-fs",
        "ucode-mod-html",
        "ucode-mod-math",
        "ucode-mod-ubus",
        "ucode-mod-uci",
        "udns-dnsget",
        "uhttpd",
        "uhttpd-mod-ubus",
        "urandom-seed",
        "urngd",
        "usb-modeswitch",
        "usbutils",
        "usign",
        "wireless-regdb",
        "wpad-wolfssl",
        "wwan"
    ],
    "diff_packages": true,
    "filesystem": "squashfs",
    "client": "luci/git-23.132.65998-fa9fb2f"
}

(:arrow_upper_right: Issue report).)

Regards!

try using -ppp.
attended sysupgrade is probably a dead end, I think it required internet access post flash.

I wish I had read that advice earlier - I wiped out a perfectly good setup by upgrading packages without fully understanding what I was doing, a couple of days ago. It's taken me until now to get my router back to a stage where its behaving well (because of all the troubleshooting and reinstalling firmware etc.)
Excellent post - one I will always bear in mind from now onward

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