Opkg: install a specific package version


#1

Hi!

Is it possible to install a specific version of a package using opkg? According to this link I can use this syntax: opkg install a=1.0. But I can't get it working:

~# opkg find kmod-usb-serial-cp210x
kmod-usb-serial-cp210x - 4.14.105-1 - Kernel support for Silicon Labs cp210x USB-to-Serial converters
kmod-usb-serial-cp210x - 4.14.98-1 - Kernel support for Silicon Labs cp210x USB-to-Serial converters

~# opkg install kmod-usb-serial-cp210x=4.14.98-1
Unknown package 'kmod-usb-serial-cp210x=4.14.98-1'.
Collected errors:
 * opkg_install_cmd: Cannot install package kmod-usb-serial-cp210x=4.14.98-1.
~# opkg info opkg
Package: opkg
Version: 2019-01-31-d4ba162b-1
Depends: libc, uclient-fetch, libpthread, libubox20170601
Status: install user installed
Section: base
Essential: yes
Architecture: arm_cortex-a9
Size: 66954
Filename: opkg_2019-01-31-d4ba162b-1_arm_cortex-a9.ipk
Conffiles:
 /etc/opkg.conf f38c19f696ea87c0b30eb5bfeb8657237f4625e1a749c58b99f01595edfb6446
 /etc/opkg/customfeeds.conf 61d1f3aa62fe977614ed0c2f0ad3b2ee2f7b451bfb34812071d86d31a4d43d4a
Description: Lightweight package management system
 opkg is the opkg Package Management System, for handling
 installation and removal of packages on a system. It can
 recursively follow dependencies and download all packages
 necessary to install a particular package.
 
 opkg knows how to install both .ipk and .deb packages.
Installed-Time: 1550050656

Any help would be appreciated.


#2

First, I swear this was answered in the last two weeks.

“No”

Search on opkg upgrade if you want reasons


#3

Thanks jeff.

Oh, bad news for me.

Search on opkg upgrade if you want reasons

You mean googling? It just gives info on how to update all installed packages and if that's a good idea.

P.S.
I did a search before posting but failed to find anything.


#4

In short, opkg on OpenWrt is intended to add a limited number of end-user packages to a ROM-based device. As outlined in those threads, because of its intended use and the resource constraints of all-in-one routers, opkg does not provide ABI-compatibility "guarantees" that you might find on desktop/server distros' tools like apt. Kernel modules must always be from the same kernel as that you have in the ROM. The kernel and base system may not be upgraded without re-flashing a newer ROM.

What is the reason you need a specific version?

Building your own ROM, from source, would be an approach if you truly needed that specific version.


#5

You are right: Installing specific package versions?


#6

The reason I need a specific version of a certain package is that I have OpenWrt 18.06.2 that gives me 4.14.98 of Linux. The package I need has a version for this kernel and works just fine. But the latest version of this same package is for 4.14.105 and obviously can't be installed on 4.14.98 with which I flashed a newly bought router. I guess I'll be able to find a newer fw, flash my router and that will give me 4.14.105. But I thought there was a simpler path - telling opkg I need an older version of a certain package.

Thanks everyone for the help.


#7

If you truly "need the latest", building your own firmware from master (or a select point on that branch) would be an appropriate approach.


#8

BTW, no - he's referencing, the forum's search feature:

Screenshot%20from%202019-03-12%2010-33-53

https://forum.openwrt.org/search


#9

And is it possible to download the ipk-file for a previous version of a package and then install it manually? Opkg sees both versions:

~# opkg find kmod-usb-serial-cp210x
kmod-usb-serial-cp210x - 4.14.105-1 - Kernel support for Silicon Labs cp210x USB-to-Serial converters
kmod-usb-serial-cp210x - 4.14.98-1 - Kernel support for Silicon Labs cp210x

so I thought maybe it's somehow possible to do this.

Thx!


#10

Unlikely.

Kernel modules only should be expected to work with the exact kernel they were compiled with. Those two are from different kernel versions.

What you are probably seeing is the current, installed version, and a version from the repo.

Do not upgrade it.


#11

I guess I didn't make myself clear.

My desire is to use 4.14.98 and install kmod-usb-serial-cp210x on it.

I made a fresh install of 4.14.98 on my router:

root@OpenWrt:~# uname -a
Linux OpenWrt 4.14.98 #0 SMP Wed Feb 13 09:37:36 2019 armv7l GNU/Linux

root@OpenWrt:~# opkg list-installed | grep usb
kmod-phy-bcm-ns-usb2 - 4.14.98-1
kmod-phy-bcm-ns-usb3 - 4.14.98-1
kmod-usb-bcma - 4.14.98-1
kmod-usb-core - 4.14.98-1
kmod-usb-ehci - 4.14.98-1
kmod-usb-ledtrig-usbport - 4.14.98-1
kmod-usb-ohci - 4.14.98-1
kmod-usb2 - 4.14.98-1
kmod-usb3 - 4.14.98-1

root@OpenWrt:~# opkg find kmod-usb-serial-cp210x
kmod-usb-serial-cp210x - 4.14.105-1 - Kernel support for Silicon Labs cp210x USB-to-Serial converters
kmod-usb-serial-cp210x - 4.14.98-1 - Kernel support for Silicon Labs cp210x USB-to-Serial converters

I guess it really means that both versions of kmod-usb-serial-cp210x exist in the repo, so maybe there's a way of getting the version for 4.14.98?

Thanks again for the help.


#12

To install a specific version, couldn't you just wget the specific version into /tmp and then opkg install /tmp/pkg_name.ipk?
No it's not a built in solution, but i think it will achieve what you want.


#13

That's exactly what I want to do! I just don't know the url of the previous version.

The url for the latest one is http://downloads.openwrt.org/snapshots/targets/bcm53xx/generic/packages/kmod-usb-serial-cp210x_4.14.105-1_arm_cortex-a9.ipk but if I replace 105 with 98 I get HTTP 404.

Looks like I managed to solve it, though. I was very lucky to have one router with 4.14.98 up and running and I just used opkg files kmod-usb-serial-cp210x to list the files and then copied them to the new router with 4.14.98 but without cp210x driver installed.


#14

This is the wrong repository url for 18.06.2. Should be http://downloads.openwrt.org/releases/18.06.2/targets/bcm53xx/generic/packages/


#15

What do you mean "wrong"?

root@OpenWrt:~# uname -a
Linux OpenWrt 4.14.98 #0 SMP Wed Feb 13 09:37:36 2019 armv7l GNU/Linux

root@OpenWrt:~# opkg install kmod-usb-serial-cp210x
Installing kmod-usb-serial-cp210x (4.14.105-1) to root...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm53xx/generic/packages/kmod-usb-serial-cp210x_4.14.105-1_arm_cortex-a9.ipk
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-usb-serial-cp210x:
 * 	kernel (= 4.14.105-1-dcab2363a3f36331ab9d464c48f19c1d)
 * opkg_install_cmd: Cannot install package kmod-usb-serial-cp210x.

I know this is a snapshot, but for some reason, I can't remember right now, I needed 4.14.98. Is there a stable build with 4.14.98?


#16

Wrong -- meaning that it is not consistent with your build, resulting in

 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-usb-serial-cp210x:
 * 	kernel (= 4.14.105-1-dcab2363a3f36331ab9d464c48f19c1d)

for a system running 4.14.98

jow suggested that the "matching" repo might be that associated with 18.06.2, rather than that for the nightly snapshots.

Edit: Did you install 18.06.2, a snapshot, or a self-built ROM?


#17

Eh... I see. But I just downloaded a firmware file from my router page at openwrt.org.

Wasn't that enough?

Edit: I installed a snapshot.


#18

Ah, OK, snapshot package repos are "moment in time". Tomorrow's snapshot's packages generally can't be used with today's snapshot.

There might be some relief (that I have never tried) based on


#19

Oh, I see.

Well, I'm using a snapshot with a persistent repository:

root@OpenWrt:~# cat /etc/opkg/distfeeds.conf
src/gz openwrt_core http://downloads.openwrt.org/snapshots/targets/bcm53xx/generic/packages
src/gz openwrt_kmods http://downloads.openwrt.org/snapshots/targets/bcm53xx/generic/kmods/4.14.98-1-8880200db9c13596328f3d6e96dbeabe
src/gz openwrt_base http://downloads.openwrt.org/snapshots/packages/arm_cortex-a9/base
src/gz openwrt_luci http://downloads.openwrt.org/snapshots/packages/arm_cortex-a9/luci
src/gz openwrt_packages http://downloads.openwrt.org/snapshots/packages/arm_cortex-a9/packages
src/gz openwrt_routing http://downloads.openwrt.org/snapshots/packages/arm_cortex-a9/routing
src/gz openwrt_telephony http://downloads.openwrt.org/snapshots/packages/arm_cortex-a9/telephony

And how come I'm using a snapshot that gives me 4.14.98 and opkg update && opkg install kmod-usb-serial-cp210x is looking for a version compiled with kernel 4.14.105?


#20

It’s not looking for that specific version. It’s looking for that package, and then evaluates if the version is correct. It always takes the latest version from my understanding.

Yes you have the persistent link (#2 in the list), but you also have the generic link (#1) providing the updated (and incompatible version).

So you still could have used the wget method, you were just looking in the wrong URL.