Installing multiple .ipk files from text file or directory

Hey all I am new to the world of OpenWRT and am compiling my own kernel for my Raspberry Pi CM4.

My question is - I have about 65 .ipk files that I will be needing to install once the basic things are loaded up and I can access the ssh.

I know about doing the opkg install command but I have not seen where it can support multiple ipk installs from a directory or from a text list all at once without me having to copy/paste each individually like:

opkg install kernel_5.10.197-1-8e526e5d5646791dda518a1056031a08_aarch64_cortex-a72.ipk
opkg install fstools_2022-06-02-93369be0-1_aarch64_cortex-a72.ipk
opkg install kmod-crypto-crc32c_5.10.197-1_aarch64_cortex-a72.ipk
etc....

Is there an option where I can define a text/json file that has each ipk that i need and have it go to each line and install it until it reaches the end or point it to a directory with all the ipk files inside it?

while IFS= read -r ipk; do opkg install /somedir/$ipk; done < somefile.txt
for ipk in $(ls /somedir/*.ipk); do opkg install $ipk; done

This will not work as expected if you need to install the packages in a strict order due to dependencies.

3 Likes

If the text file contains no blanks and no comments, then the following will do as well:

cat file-with-one-.ipk-per-line.txt | xargs -r opkg install
4 Likes

Thanks to you both @jow @pavelgl !

1 Like

If you compile your own build why not compile it in?

Uhm, yes it can, I sometimes use opkg install /tmp/*.ipk and it works just fine.

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