When installing a package, in this case, tanzu-tc-server-10.1.33-C, you may encounter the below error message stating "priority '###' must be an integer."
Step 34/39 : RUN dpkg -i /tmp/tanzu-tc-server-10.1.33.C_1. deb && apt-get clean && rm-rf /var/lib/apt/lists/* /tmp/*.deb
--> Running in f4cc492fd36b
Selecting previously unselected package tanzu-tc-server-10-1-33-c.
(Reading database ... 7979 files and directories currently installed.)
Preparing to unpack .../tanzu-tc-server-10.1.33.C_1.deb ...
Unpacking tanzu-tc-server-10-1-33-c (1-1) ...
Setting up tanzu-tc-server-10-1-33-c (1-1) ...
update-alternatives: priority '133C' must be an integer
Use 'update-alternatives --help' for program usage information.
dpkg: error processing package tanzu-tc-server-10-1-33-c (--install):
installed tanzu-tc-server-10-1-33-c package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
tanzu-tc-server-10-1-33-c
This suggests that there's an issue with the configuration of the update-alternatives system or a misconfiguration in the installation script.
Unpack the debian package and extract the contents to a directory
dpkg-deb -R tanzu-tc-server-10.1.33.C_1.deb /tmp/tanzu-tc-server
Navigate to this file and find the parameter from the error messasge, 133C. In the dpkg install error it states it is expecting an integer value.
root@a2404415c907:/tmp/tanzu-tc-server/DEBIAN# cat postinst
#!/bin/sh -e
ec() {
echo "$@" >&2
"$@"
}
case "$1" in
configure)
update-alternatives --install /usr/bin/tc-server-10.1 tc-server-10.1 /opt/tc-server/10.1/dist/tc-server-10.1.33.C/tcserver 133C
;;
esac
Updated the field with:
`sed -i ‘s/133C/133/’ postinst`
The resulting line is:
update-alternatives --install /usr/bin/tc-server-10.1 tc-server-10.1 /opt/tc-server/10.1/dist/tc-server-10.1.33.C/tcserver 133
Repack the Debian and try the install again.
dpkg-deb -b /tmp/tanzu-tc-server tanzu-tc-server-10.1.33.C_1_fixed.deb
dpkg -i tanzu-tc-server-10.1.33.C_1_fixed.deb