Monday 26 August 2019

Ubuntu 18.04 on ThinkPad P50 (Part 4)

Conflict between libcurl3 and libcurl4

Ubuntu 18.04 includes libcurl4 by default which in fact is required by the packaged version of curl. Some legacy applications depend on libcurl3, which but libcurl3 conflicts with libcurl4. The steps below demonstrate how to alter the control file of such legacy packages to allow libcurl4 instead of libcurl3 and then how to repackage and install these packages.

People following these steps should test the updated legacy applications and confirm they run properly, or revert if they face any issue they cannot resolve.


tb@castor:~$ cd /tmp
tb@castor:/tmp$ mkdir dpkg
tb@castor:/tmp$ cd dpkg/
tb@castor:/tmp/dpkg$ apt download xxxsam osprules 
Get:1 http://ocdc.hursley.xxx.com/ocdc bionic-safe/XXX amd64 xxxsam amd64 3.06-4-ocdc6 [195 kB]
Get:2 http://ocdc.hursley.xxx.com/ocdc bionic-safe/XXX amd64 osprules amd64 1.00.1-2.precise-ocdc2 [34,7 kB]
Fetched 230 kB in 0s (708 kB/s)    
tb@castor:/tmp/dpkg$ ll
total 228
drwxr-xr-x  2 tb   tb       80 aug   26 17:54 ./
drwxrwxrwt 26 root root    680 aug   26 17:54 ../
-rw-r--r--  1 tb   tb   194938 márc  20  2015 xxxsam_3.06-4-ocdc6_amd64.deb
-rw-r--r--  1 tb   tb    34718 júl   13  2012 osprules_1.00.1-2.precise-ocdc2_amd64.deb
tb@castor:/tmp/dpkg$ fakeroot
root@castor:/tmp/dpkg# dpkg-deb -R xxxsam_3.06-4-ocdc6_amd64.deb xxxsam
root@castor:/tmp/dpkg# dpkg-deb -R osprules_1.00.1-2.precise-ocdc2_amd64.deb ospfules
root@castor:/tmp/dpkg# sed -i 's/libcurl3 (>= 7.16.2-1)/libcurl3 (>= 7.16.2-1) | libcurl4/' xxxsam/DEBIAN/control
root@castor:/tmp/dpkg# sed -i 's/libcurl3 (>= 7.16.2-1)/libcurl3 (>= 7.16.2-1) | libcurl4/' ospfules/DEBIAN/control
root@castor:/tmp/dpkg# sed -i 's/\(^Version:.*$\)/\1+dep1/' ospfules/DEBIAN/control
root@castor:/tmp/dpkg# sed -i 's/\(^Version:.*$\)/\1+dep1/' xxxsam/DEBIAN/control
root@castor:/tmp/dpkg# dpkg-deb -b xxxsam xxxsam_3.06-4-ocdc6+dep1_amd64.deb 
dpkg-deb: warning: conffile name '/etc/init.d/xxx-isambios' is duplicated
dpkg-deb: warning: conffile name '/etc/xdg/autostart/xxx-asset-management.desktop' is duplicated
dpkg-deb: warning: ignoring 2 warnings about the control file(s)
dpkg-deb: building package 'xxxsam' in 'xxxsam_3.06-4-ocdc6+dep1_amd64.deb'.
root@castor:/tmp/dpkg# dpkg -b ospfules osprules_1.00.1-2.precise-ocdc2+dep1_amd64.deb 
dpkg-deb: building package 'osprules' in 'osprules_1.00.1-2.precise-ocdc2+dep1_amd64.deb'.
root@castor:/tmp/dpkg# ll
total 452
drwxr-xr-x  4 root root    160 aug   26 18:06 ./
drwxrwxrwt 26 root root    680 aug   26 18:06 ../
drwxr-xr-x  7 root root    140 aug   26 18:00 xxxsam/
-rw-r--r--  1 root root 194938 márc  20  2015 xxxsam_3.06-4-ocdc6_amd64.deb
-rw-r--r--  1 root root 195024 aug   26 18:04 xxxsam_3.06-4-ocdc6+dep1_amd64.deb
drwxr-xr-x  4 root root     80 aug   26 18:00 ospfules/
-rw-r--r--  1 root root  34718 júl   13  2012 osprules_1.00.1-2.precise-ocdc2_amd64.deb
-rw-r--r--  1 root root  29128 aug   26 18:06 osprules_1.00.1-2.precise-ocdc2+dep1_amd64.deb
root@castor:/tmp/dpkg# exit
exit
tb@castor:/tmp/dpkg$ sudo apt install -f ./xxxsam_3.06-4-ocdc6+dep1_amd64.deb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'xxxsam' instead of './xxxsam_3.06-4-ocdc6+dep1_amd64.deb'
The following packages will be upgraded:
  xxxsam
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/195 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 /tmp/dpkg/xxxsam_3.06-4-ocdc6+dep1_amd64.deb xxxsam amd64 3.06-4-ocdc6+dep1 [195 kB]
(Reading database ... 369572 files and directories currently installed.)
Preparing to unpack .../xxxsam_3.06-4-ocdc6+dep1_amd64.deb ...
Unpacking xxxsam (3.06-4-ocdc6+dep1) over (3.06-4-ocdc6) ...
Setting up xxxsam (3.06-4-ocdc6+dep1) ...
.
Processing triggers for systemd (237-3ubuntu10.25) ...
Processing triggers for ureadahead (0.100.0-21) ...
tb@castor:/tmp/dpkg$ sudo apt install -f ./osprules_1.00.1-2.precise-ocdc2+dep1_amd64.deb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'osprules' instead of './osprules_1.00.1-2.precise-ocdc2+dep1_amd64.deb'
The following packages will be upgraded:
  osprules
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/29,1 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 /tmp/dpkg/osprules_1.00.1-2.precise-ocdc2+dep1_amd64.deb osprules amd64 1.00.1-2.precise-ocdc2+dep1 [29,1 kB]
(Reading database ... 369572 files and directories currently installed.)
Preparing to unpack .../osprules_1.00.1-2.precise-ocdc2+dep1_amd64.deb ...
Unpacking osprules (1.00.1-2.precise-ocdc2+dep1) over (1.00.1-2.precise-ocdc2) ...
Setting up osprules (1.00.1-2.precise-ocdc2+dep1) ...
Creating symbolic links ...
tb@castor:/tmp/dpkg$ 

Thursday 22 August 2019

Ubuntu 18.04 on ThinkPad P50 (Part 3)

Repackaging Lotus Notes for 18.04

Some of our corporate Domino applications still do not work properly when accessed from a web browser, so there was a need to install the Notes client on Ubuntu 18.04. This involved updating deprecated dependencies, rebuilding the deb package and publishing it to the local package repository.


tb@castor:~$ cd /tmp
tb@castor:/tmp$ mkdir notes
tb@castor:/tmp$ apt-get download ibm-notes
Get:1 http://ocdc.hursley.xyz.com/ocdc bionic-safe/XYZ i386 ibm-notes i386 9.0.1-20131022.1138+ocdc7 [358 MB]
Fetched 358 MB in 20min 8s (296 kB/s)                                          
tb@castor:/tmp/notes$ fakeroot
root@castor:/tmp/notes# dpkg -x ../ibm-notes*.deb .
 ...
root@castor:/tmp/notes# dpkg -e ../ibm-notes*.deb ./DEBIAN
root@castor:/tmp/notes# sed -i 's/libpng12-0/libpng16-16/g' DEBIAN/control 
root@castor:/tmp/notes# sed -i 's/+ocdc7/+ocdc8/g' DEBIAN/control         
root@castor:/tmp/notes# gunzip usr/share/doc/ibm-notes/changelog.Debian.gz 
root@castor:/tmp/notes# nano usr/share/doc/ibm-notes/changelog.Debian # append to changelog

root@castor:/tmp/notes# cd ..
root@castor:/tmp# dpkg -b /tmp/notes ibm-notes_9.0.1-20131022.1138+ocdc8_i386.deb 
dpkg-deb: building package 'ibm-notes' in 'ibm-notes_9.0.1-20131022.1138+ocdc8_i386.deb'.

root@castor:/tmp# exit
exit
tb@castor:/tmp/notes$ cd /usr/local/lib/apt/amd64/
tb@castor:/usr/local/lib/apt/amd64$ sudo cp /tmp/ibm-notes_9.0.1-20131022.1138+ocdc8_i386.deb .
tb@castor:/usr/local/lib/apt/amd64$ apt-ftparchive packages . | sudo tee Packages
 ...
tb@castor:/usr/local/lib/apt/amd64$ apt-ftparchive release . | sudo tee Release
Date: Wed, 07 Aug 2019 16:16:51 +0000
MD5Sum:
 7339b2b2be699eb389665b64b062c1fe             6319 Packages
 62234bf67aa71907789bcb7df1f05e97              444 Release
SHA1:
 7df336123833077c551c0285782d10aaf9cca53f             6319 Packages
 6e0d07f80c9062661e481fa159265b9ccbce09ff              444 Release
SHA256:
 2556cbebb467e8ec5b48733ac21fcb4b124ec252ea70cdf22cf9994e1e5d9849             6319 Packages
 77264df13b76bfc355aa3a911e10a4983d8737914fb1904d9a255d9c5a58d8d2              444 Release
SHA512:
 a1808ee41b7131d1fdb93ba32c5d04a496fafb8223d7b9e3ad3e00e0bfbfd138d75743a206f9beea5f724f5c63e4304bfff277a74e1087fa3047294b9b8b6459             6319 Packages
 5498ce04b5d3562d2cd48e4105eea0135059d9ea8a6ad61f57cb1e78f49841df629a9ab7a2cd2403f247f1d29a36ad5c04c21f69c6c00a10a09b7ee69e781e7d              444 Release
tb@castor:/usr/local/lib/apt/amd64$ 

First run and the missing bit

Notes silently failed and terminated after splash screen. No error logged, no trace of any missing libraries, no indication of the root cause. I had to find out the hard way, that the EULA acceptance prompt that was triggered on the first run was implemented in a way that relied on running scripts from /tmp. Which, in my case, was mounted with nosuid,nodev,noexec. I would really have appreciated at least a line of error message.


mount | grep /tmp
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noexec,noatime)
sudo mount -o exec,remount /tmp
/opt/ibm/notes/framework/../notes0
sudo mount -o noexec,remount /tmp # can be remounted with noexec after first run and accepting license

The final step

Having fixed the EULA related issue above, I experienced that Notes would enter an infinite loop after successful login. I have just moved over the whole ~/lotus directory from my old thinkpad, and had to make changes to notes.ini to reflect my updated linux userid and home path. Once done, Notes started smoothly and did not experience any issue since