Installing packages offline with dependencies?

I would like to install packages on my x86/64 offline before connecting it to the internet.
One of the packages that is required for internet access on my device is the kmod-usb-net-rtl8152 this has its own dependencies kmod-usb-net and this has its own dependencies kmod-mii, then kmod-usb-core, and kmod-nls-base.

How would one go about installing these offline?
I could probably just connect into router via ethernet cable from computer to router but where would these files be copied too so that when you use opkg from ssh or luci to install the first package it detects the packages dependencies (that are downloaded offline and transferred over as well).

The desktop would be running linux so no need for putty but not sure what commands to use.

opkg can install packages provided to it explicitly, but it doesn't really help you with this task - meaning you need to provide all necessary packages (including their dependencies) by hand.

The imagebuilder probably makes more sense - especially for basic network drivers.

Ah okay that makes sense. I was little worry of image builder because of this

The Image Builder images are not identical to official images as they obtain pre-generated packages. When recent/important changes are made, there can be some delay for these packages to propagate and it is best to check that packages were uploaded after the date of the imagebuilder/change.

Another confusion is that the x86 page says you do not need to set a profile.
Does the image builder not download the image file itself?

Never used this before so a bit confused.

imagebuilder assembles new monolithic firmware images from the downloaded binary packages. There are no device specific profile for x86, only the generic target profile, so need to further diversify the target profile.

Okay after re-reading the documents I think I understand a bit more.
You download your firmware-image builder for example
"openwrt-imagebuilder-21.02.3-x86-64.Linux-x86_64.tar.xz".
Once extracted you edit packages file in the "packages folder" with the names of packages you need.
After you are finished with that you can then use make image, it will download and setup the packages and generate the new image with the included packages?

Also curious, the imagebuilder.tar.xz does specify if its efi like the out of the box image files do.
Does this need to be specified in the profile section before building for a efi image?

You could download all of them as .ipk files, transfer them from the PC to the router with scp, and then opkg install them in the correct order, starting from the lowest in dependency hierarchy, so that when you install the next package, it already find the dependencies installed. (start with kmod-nls-base.)

If the .ipk files are in /tmp dir, you can "opkg install /tmp/packagename.ipk"

If you only need a few packages, that is viable, but if you need much more, the imagebuilder approach is likely easier in the long run.

1 Like

What directory would you recommend placing them in when using scp?
If you use luci to upload/install them offline, would it have issues?

/tmp/ would make sense, as it's tmpfs (RAM) backed and will disappear on its own after the next reboot (you don't need the *.ipks anymore, once they're installed to the system).

Did you mean uci? LuCi is the web interface.

@hnyman has this nailed down for scp as in WinSCP or Putty:
I did this just last week for/as a walkthrough in a different post.


Luci, comes pre installed on openwrt x86 images.

awesome thank you :slight_smile:

I thought a question was left unanswered.
Were you asking @hnyman if you could install these packaged offline via LuCi once they were manually downloaded and and placed in a directory LuCi would capture (see as available to install.)?

Ok
Keeping it simple thanks!

Yes, sorry. Luci allows you install packages via file-upload so it seemed easier to try and use luci to do this if its possible?

Beats all the typing and copy paste, I did not think to log in and see. I had placed the downloaded file into the /tmp/opkg-lists but just plowed thru the list I had.

Be interested in knowing if LuCi sees these file. But I'm past that point.

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