Application runtimes have more capabilities and features than simple binaries 
and it can be tricky to deconstruct them into the folder structure used by 
Debian (and other distros). Also, most package managers struggle installing 
multiple versions of the same package, so to work around it you need to create 
a package-per-version and use a wrapper package to point to the ‘latest’ 
version.

I think your best bet would be to follow the JDK approach to installing on 
distributions.

1. Full self-contained directory as-is and allow roll-forward, rollback and 
multiple simultaneous installations
2. Use symlinks to create the effect of deconstructed installation 
(/usr/bin/karaf etc)
3. Write a helper script to allow users to switch between the ‘active’ version 
of the distrubiton 

$ update-karaf-versions -l
  
    .. lists available karaf versions with the ‘active’ one marked

$ update-karaf-versions -s 4.4.8
    .. set the active karaf version by updating symlinks

karaf (wrapper package that gets updated to latest version)
karaf-4.4.7
karaf-4.4.8

Matt Pavlovich

> On Aug 30, 2025, at 3:55 AM, Steinar Bang <s...@dod.no> wrote:
> 
>>>>>> Steinar Bang <s...@dod.no>:
> 
>>> Do you have the resources in etc folder same as karaf vanilla ? The
>>> bnd version policy could cause such issues.
> 
>> Aaah... I am leaving some of the etc files from the previous version
>> during APT package upgrade (trying to keep user modifications, such as
>> e.g. added maven repos).
> 
>> But maybe the default should be overwrite by maintainer's version for
>> all of them...? It is only added maven repos I want to keep out of alle
>> the provided etc files, as far as I can remember...?
> 
>> I'll look into it! Thanks, JB!
> 
> Well that was interesting!
> 
> I first uninstalled karaf 4.4.7 and then manually removed /etc/karaf,
> then created a new /etc/karaf with the same ownership, group and access
> and copied in org.ops4j.datasource-*.cfg files from the old /etc/karaf
> 
> But then "apt install karaf" of 4.4.8 failed because I had removed the
> /etc/karaf files.
> 
> So I did "apt purge karaf" which deleted everything installed by the
> package, but left /etc/karaf/org.ops4j.datasource-*.cfg in place.
> 
> And then did "apt install karaf" which worked without error.
> 
> But ssh ran into two problems
> 1. There was a new ssh-key, forcing me to delete the old key in the
>    client (probably one of the reasons I left old files in /etc/karaf
>    on uninstall/upgrade back when...?)
> 2. After I deleted the cached key on the client I was unable to login
>    with ssh, same as on the karaf from the 4.4.8 tarball, i.e. the
>    problem JB is looking into that will cause 4.4.9
> 
> So the reason my 4.4.8 deb ssh seemed to be working was presumably
> because I was upgrading from 4.4.7?
> 
> So there will be no 4.4.8 release of the deb package, but I will try to
> figure out a better strategy for /etc/karaf (I know at least one file I
> should keep: the ssh host key and I know that I would like to keep the
> repo list),
> 

Reply via email to