[yocto] opkg behavior

Alejandro del Castillo alejandro.delcastillo at ni.com
Tue Apr 11 11:42:38 PDT 2017



On 04/11/2017 08:03 AM, Gary Thomas wrote:
> I'm using opkg (IPK) packaging with my Yocto builds (using recent
> master 633ad6c9f).  For the most part, this seems to work well,
> but occasionally I'll rebuild a recipe along with the packaging
> indexes on my build machine only to find that opkg doesn't want
> to upgrade to the changes.  Here's an example:
> 
> * Update the package databases on the target board
>   root at teton-p7621:~# opkg update
>   Downloading http://192.168.1.12/teton-p7621-feeds/all/Packages.gz.
>   Updated source 'poky_am-all'.
>   Downloading
> http://192.168.1.12/teton-p7621-feeds/cortexa7hf-neon/Packages.gz.
>   Updated source 'poky_am-cortexa7hf-neon'.
>   Downloading
> http://192.168.1.12/teton-p7621-feeds/teton_p7621/Packages.gz.
>   Updated source 'poky_am-teton_p7621'.
> 
> * Try to update the package I just rebuilt.  Normally, this does the
> right thing
>   root at teton-p7621:~# opkg install production-tests
>   No packages installed or removed.
> 
> * Odd, check the packaging
>   root at teton-p7621:~# opkg list-installed | grep prod
>   production-tests - 1.0-r0.74
> 
> * Force the install by removing the existing package, etc
>   root at teton-p7621:~# opkg remove production-tests
>   Removing production-tests (1.0) from root...
>   root at teton-p7621:~# opkg install production-tests
>   Installing production-tests (1.0) on root
>   Downloading
> http://192.168.1.12/teton-p7621-feeds/teton_p7621/production-tests_1.0-r0.76_teton_p7621.ipk.
> 
>   Configuring production-tests.
> 
> So from this you can see that the package has been rebuilt (using
> the PR server) and that I can indeed install the new version.  That
> said, why did opkg not "upgrade" as expected.  Note: I often use
> the 'opkg upgrade' command but I recently updated my Poky/Yocto
> repository which caused nearly every package to be rebuilt and I
> didn't want to have to download everything (none of which affected
> my current program which is just a python script), so I chose the
> 'opkg install ...' method instead, which does seem to work sometimes.
> 
> Any ideas what I can look at or tweak to get this to work the way
> I expect?

Opkg uses libsolv as it's solver backend. When you say 'opkg install
production-tests', the solver doesn't do anything since package
'production-tests' is already installed.

What you want is a targeted upgrade, which can be done by calling 'opkg
upgrade production-tests'. Another option is to do a by version install,
which can be done by calling 'opkg install production-tests=1.0-r0.76'


-- 
Cheers,

Alejandro



More information about the yocto mailing list