During a sysupgrade, all previously-installed packages are lost. It's a drag to find and install them. It would be great to have an automated way to retain the list of scripts.
On the OpenWRT forum (at https://forum.openwrt.org/viewtopic.php?pid=194478#p194478) there is a script that purports to do this, but it does not work with LEDE 17.01.2. That script refers to a non-existent opkg config file (it has moved) and doesn't seem to understand the current format - the output is empty. Nonetheless, it appears to have a good user interface so maybe it could be tweaked to current opkg format.
Has anyone found/produced a script that lists installed pkgs? Thanks.
Update: The script does work as desired. See the script in the OpenWrtScripts repo on Github
@richb-hanover The script you linked seems to work for me.
First you call it with "write" and it creates an /etc/config/opkg.installed file. This file is simply the output of opkg list-installed. Such a file never was part of opkg's routine activities. Storing the file under /etc/config will have it survive a sysupgrade. Then after upgrading, you'd run the script again with the "install" action and it will parse the previously stored file and re-install any packages that are missing.
Granted I didn't actually upgrade, but I did write and the file was created. Then I removed a package on purpose and the script's install option was able to re-install it.
@mk24 Right you are. On a second read, I see that the script provides a good tool for archiving the installed scripts, and re-installing after the upgrade.
Update: Here are the major commands of the script:
sh opkgscript.sh writeuse before sysupgrade to save the current set of packages
sh opkgscript.sh installuse after successful sysupgrade, to restore those packages
sh opkgscript.sh helpdisplay full help information for the script
Really one of those codes would need to be integrated as a opkg command, as for now only users who go for discussions here or on OpenWRT forum gets these scripts.
I'm not sure that this needs to be baked into the opkg command.
An alternative would be to create a convention of putting "useful scripts" into a well known directory in every LEDE/OpenWrt distribution, so that documentation writers can refer to them. (That was my goal for the OpenWrtScripts repo - a collection of scripts that I found to be useful...)
The problem stays in opkg not tagging the packages as explicitly installed by the user as other package managers do, so it goes by workaround in getting the wanted result.
Having one of those scripts as an internal opkg command would not require a rewrite of opkg itself.
Sorry to resurrect an old thread, but are these scripts still applicable to the latest Master SNAPSHOT builds?
They look like a great way to quicken the upgrade process.
I'm new to OpenWrt coming from DD-WRT.
I have a WRT32X running OpenWrt SNAPSHOT r7301-b8bdeac / LuCI Master (git-18.169.62979-e380cf5)
Thanks in advance!
It would actually be cool, if the builtin backup and sysupgrade function could include the export-installedapps-list-script and then auto-install the list on system upgrades.
What about the above mentioned scripts? Specifically: sh opkgscript.sh write sh opkgscript.sh install
The last update was 9 months ago. A lot of changes to OpenWrt since then. I am just wondering if anything needs to be modified or if they can be used as is.
on OpenWrt 18.06RC1
I got no output and no error feedback from opkgscript.sh.
But the 4-liner of ehlers in this thread works like a charm.
I've just remove the line breaks and added a "sort" - Here is ehlers MVP code as a copy&paste 1-liner, you can just paste that to an OpenWrt SSH prompt:
Can someone confirm that this also works on LEDE v17?
(I currently have no more v17 devices running, so I can't test it now)
....I can easily add this to the OpenWrt install description Mediawiki page as an option for easier migration once we have confirmation.
After using the above scripts for several upgrades now, I can confirm that they work great!
I use the second 'one liner' script provided by @alexmow after each upgrade and it cuts package reinstallation down to seconds.
Thank you to all who contributed!
Correct. As an example here is my upgrade procedure:
SSH in and run the script. It will give an output of: opkg update ; opkg install user installed package 1 user installed package 2 user installed package 3 etc...
Then copy the single line output and save. I also, generate a backup in LuCI and store in the same folder as the script output.
After I have upgraded I use SSH to manually install LuCI with: opkg update and opkg install luci-ssl
Then I copy and run the script output (package list) minus the opkg update ; to reinstall all my packages.
Lastly I log into LuCI, set my password and check that everything installed correctly. Then I'll either restore my configuration from backup or reconfigure from scratch (preferred).