Possible missing dependency in 6.3.x deb package

NOTE: Let me start off by saying I was (by mistake) trying to build release-6.3 branch instead of 6.3.10 release. If that is the main cause of the following issue, you can ignore this as operator error. I am going to retry with 6.3.10 release.

I built the branch using docker on linux and also ran cmake -G DEB to create debian packages. However when I tried to install it it failed with a post-install error as follows

I understand 6.3.11 is not released.

   $ sudo dpkg -i foundationdb-6.3.11--clients-versioned.deb
    Selecting previously unselected package foundationdb-clients-6.3.11.
    (Reading database ... 85986 files and directories currently installed.)
    Preparing to unpack foundationdb-6.3.11--clients-versioned.deb ...
    Unpacking foundationdb-clients-6.3.11 (6.3.11) ...
    Setting up foundationdb-clients-6.3.11 (6.3.11) ...
    /var/lib/dpkg/info/foundationdb-clients-6.3.11.postinst: line 16: alternatives: command not found
    dpkg: error processing package foundationdb-clients-6.3.11 (--install):
     installed foundationdb-clients-6.3.11 package post-installation script subprocess returned error exit status 127
    Errors were encountered while processing:
    $ dpkg -l | grep foundation
    iF  foundationdb-clients-6.3.11            6.3.11                                      amd64        FoundationDB is a 
   scalable, fault-tolerant, ordered key-value store with full ACID transactions.

It is looking for a dependency ‘alternatives’, but I couldn’t find an appropriate package in Ubuntu 18.04 LTS. There is one galternatives, but I doubt if that is the correct dependency.

Anyways, after this, I couldn’t remove the package either because alternatives is referenced in

alternatives --remove fdbclients

in /var/lib/dpkg/info/foundationdb-clients-6.3.11.prerm

Separately, do you have any documentation of how to setup the initial /etc/foundationdb/fdb.cluster file without using a package manager ? I will be building from source many times and it would be good to know how to set it up.



Temporarily fixed by a cd /usr/bin; ln -nfs update-alternatives alternatives

Thanks for bringing this to our attention. This seems to be a bug. I am not familiar with debian and when I implemented the versioned packages I mostly tested this for CentOS. I will try to fix it.

Do you happen to know which debian package provides the alternatives command?

Sorry I was using Ubuntu, but I believe debian is also similar. update-alternatives (notice the longer name) is part of dpkg - so it must be part of base already. So we can’t add that as a dependency. https://manpages.debian.org/stretch/dpkg/update-alternatives.1.en.html

The only centos system I have handy is the docker for foundationdb-build. Looking at it , it seems Centos symlinks update-alternative to alternatives already, so your fix could be simple as changing

$ docker run -it foundationdb/foundationdb-build
[root@dc59983c82e4 /]# which alternatives
[root@dc59983c82e4 /]# ls -al /usr/sbin/alternatives
-rwxr-xr-x 1 root root 24152 May 10  2016 /usr/sbin/alternatives
[root@dc59983c82e4 /]# which update-alternatives
[root@dc59983c82e4 /]# ls -al /usr/sbin/update-alternatives
lrwxrwxrwx 1 root root 12 Oct  6  2018 /usr/sbin/update-alternatives -> alternatives

I don’t know much about the history of this change - as in which version was the deprecated name, but for now, you can simply change the references in these files to update-alternatives


interesting, thanks for the help. I’ll do this change asap

I created a PR that should fix this problem. Keep in mind that this means that deb-packages are broken until we create the next patch release on the 6.3 branch.