Opkg-extras does not restore packages anymore

Hi all, hi @vgaetera

I facing the issue with newest OpenWrt 21.02.1 that my packages would not be restored anymore. Was a little of work but I restored everything manually and also reinstalled opkg-extras. But it does nothing... the packages should be stroed under /etc/backup/...? No file is generated anymore.... in my memory I do nothing different like before. :slight_smile: Did I missed something....

Test with MC package:

root@OpenWrt:/etc# opkg save
root@OpenWrt:/etc# opkg remove mc
Removing package mc from root...
root@OpenWrt:/etc# opkg restore
root@OpenWrt:/etc# opkg install mc
Installing mc (4.8.27-2) to root...
Downloading https://downloads.openwrt.org/releases/21.02.1/packages/arm_cortex-a15_neon-vfpv4/packages/mc_4.8.27-2_arm_cortex-a15_neon-vfpv4.ipk
Configuring mc.
root@OpenWrt:/etc#

Cheers,
Nils

the packages are stored under /etc/config/opkg

cat /etc/config/opkg
md5sum /etc/profile.d/opkg.sh
cat /etc/backup/installed_packages.txt
ls -1 /etc/hotplug.d/online/
logread -e opkg
mount

also state your device / image filesystem type when seeking support...


to best assist you we'd need to know the state of those files before upgrade... and what commands if any were run in what sequence manually after sysupgrade...

are the commands you posted EXACTLY the only sequence that occured after upgrade?

how did mc end up on the new install?

1 Like

Hi,

its an Netgear R7800.
I manually restored the packages to get the router running again and tried to identify the issue after it. The simplest example was to uninstall a package and tried to restore it. It shows the same behaviour than after the upgrade. The package was not restored probably. MC is not running uninstalled and running fine installed again.

At first I restored a backup because nothing worked to be sure that everything is fine. But at least I think it was not necessary. In my opinion we should focus on the simple opkg save/restore command that does not do anything if a package is missing.

root@OpenWrt:/etc/config# cat /etc/config/opkg

config opkg 'defaults'

config opkg 'custom'

config opkg 'rwm'

config opkg 'auto'
        list rpkg 'wpad-basic-wolfssl'
        list ipkg 'avahi-dnsconfd'
        list ipkg 'collectd'
        list ipkg 'collectd-mod-cpu'
        list ipkg 'collectd-mod-interface'
        list ipkg 'collectd-mod-iwinfo'
        list ipkg 'collectd-mod-load'
        list ipkg 'collectd-mod-memory'
        list ipkg 'collectd-mod-network'
        list ipkg 'collectd-mod-ping'
        list ipkg 'collectd-mod-rrdtool'
        list ipkg 'glib2'
        list ipkg 'iptables-mod-conntrack-extra'
        list ipkg 'iptables-mod-ipopt'
        list ipkg 'kmod-ifb'
        list ipkg 'kmod-ipt-conntrack-extra'
        list ipkg 'kmod-ipt-ipopt'
        list ipkg 'kmod-ipt-raw'
        list ipkg 'kmod-sched-cake'
        list ipkg 'kmod-sched-core'
        list ipkg 'kmod-tun'
        list ipkg 'libattr'
        list ipkg 'libavahi-nodbus-support'
        list ipkg 'libblkid1'
        list ipkg 'libdaemon'
        list ipkg 'libffi'
        list ipkg 'libgd'
        list ipkg 'libjpeg-turbo'
        list ipkg 'libltdl7'
        list ipkg 'libmnl0'
        list ipkg 'libmount1'
        list ipkg 'libncurses6'
        list ipkg 'libopenssl1.1'
        list ipkg 'liboping'
        list ipkg 'libpng'
        list ipkg 'libreadline8'
        list ipkg 'librrd1'
        list ipkg 'librt'
        list ipkg 'libsodium'
        list ipkg 'libsqlite3-0'
        list ipkg 'libssh2-1'
        list ipkg 'libuuid1'
        list ipkg 'libwebp'
        list ipkg 'luci-app-commands'
        list ipkg 'luci-app-sqm'
        list ipkg 'luci-app-statistics'
        list ipkg 'luci-app-vnstat2'
        list ipkg 'luci-app-watchcat'
        list ipkg 'luci-compat'
        list ipkg 'mc'
        list ipkg 'nano'
        list ipkg 'rrdtool1'
        list ipkg 'smcroute'
        list ipkg 'softethervpn5-bridge'
        list ipkg 'softethervpn5-libs'
        list ipkg 'sqm-scripts'
        list ipkg 'tc-mod-iptables'
        list ipkg 'tc-tiny'
        list ipkg 'terminfo'
        list ipkg 'vnstat2'
        list ipkg 'vnstati2'
        list ipkg 'watchcat'
        list ipkg 'wpad-wolfssl'
        list ipkg 'zlib'

root@OpenWrt:/etc/config# md5sum /etc/profile.d/opkg.sh
f182c2837fee35ebf0fb1e79fe235a45  /etc/profile.d/opkg.sh
root@OpenWrt:/etc/config# cat /etc/backup/installed_packages.txt
cat: can't open '/etc/backup/installed_packages.txt': No such file or directory
root@OpenWrt:/etc/config# ls -1 /etc/hotplug.d/online/
30-sleep
50-opkg-restore
root@OpenWrt:/etc/config# logread -e opkg
root@OpenWrt:/etc/config# mount
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/ubi0_1 on /overlay type ubifs (rw,noatime,assert=read-only,ubi=0,vol=1)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
root@OpenWrt:/etc/config#
1 Like
uci set opkg.defaults.import='/etc/backup/installed_packages.txt'
uci set opkg.defaults.save='auto'
uci set opkg.defaults.restore='auto'
uci set opkg.defaults.rollback='auto'
uci set opkg.defaults.upgr='ai'
uci set opkg.defaults.export='ai'
uci set opkg.defaults.proc='--force-depends'
uci set opkg.defaults.reinstall='--force-reinstall'
uci set opkg.defaults.newconf='/etc'
uci commit opkg
2 Likes

With this commands it is working. In newest opkg-extras it could be restored with opkg init. I done it with this command. It seems that I had installed a broken opkg-extras in the past as on my other APs these command does not exist and also the defaults are missing.

So Tasks to fix it.

  • Update opkg-extras
  • opkg init
  • opkg save

It can be corrected by setting it manually with @anon50098793 commands but at best it would be to update opkg-extras. :slight_smile: Perhaps opkg-extras should be moved inside a package that it will be updated with help of opkg. That would be nice.

1 Like

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