opkg update
opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade
- List any available upgradable packages
opkg update opkg list-upgradable
- Upgrade any packages listed (if any were listed) – more than one package can be included
- Note: on a device with only 4MB of NVRAM, these updates may not fit – check free space on / first with “df -h /” and ensure there is at least 600KB or so free
opkg list-upgradable | sed -e "s/\s.*//" | while read PKG_NAME; do opkg upgrade "${PKG_NAME}"; done
- Verify no more packages can be upgraded; the command should display no output now
opkg list-upgradable
Reinstall user-installed packages
After a successful upgrade, you will need to reinstall all previously installed packages. You made a list of these above. Package configuration files should have been preserved due to steps above, but not the actual packages themselves.
- Restore pre-upgrade packages “automagically”
If you have used “sysupgrade -k” you should be able to run the following code to restore all packages (credits to rnio)
opkg update && opkg list-installed | cut -f 1 -d ' ' | sort -u > /tmp/currentpkg && cat /etc/backup/installed_packages.txt | cut -f 1 | sort -u > /tmp/oldpkg && grep -v -F -x -f /tmp/currentpkg /tmp/oldpkg > /tmp/inst && opkg install $(cat /tmp/inst | sort -u) && rm /tmp/currentpkg /tmp/oldpkg /tmp/inst
- Install packages manually
opkg update
opkg install snmpd-static
没有评论:
发表评论