Fatal error with usrmerge while upgrading to 22.04: duplicated locations of libs

Started by mahesh, Oct 11, 2023, 03:26 AM

Previous topic - Next topic

mahesh

I am finding what it seems a common issue when upgrading Ubuntu versions - a `usrmerge` fatal error which also prevents the correct symlink assignments.


An indication that there was something wrong with the `usrmerge` appeared during the Ubuntu version upgrade from 20.04 to 22.04. The Ubuntu upgrade did happen:


Code:
ec@ec:~$ lsb_release -a
    No LSB modules are available.
    Distributor ID:    Ubuntu
    Description:    Ubuntu 22.04.3 LTS
    Release:    22.04
    Codename:    jammy
but a warning message said that the upgrade was actually incomplete and error-prone, asking me to solve the issue so the upgrade could be fully completed.


I found that the `usrmerge` was giving problems to everyone.


The most common solution online was to try to updgrade `usrmerge`. This is an example on what people normally do:


https://bugs.launchpad.net/ubuntu/+s...943/comments/5


However, when I try `sudo apt install usrmerge` or similar actions on`usrmerge`, it always throws a fatal error when finding a first discrepancy:


Code:
FATAL ERROR:
**Both /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 and /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 exist**.
   
    You can try correcting the errors reported and running again
    /usr/lib/usrmerge/convert-usrmerge until it will complete without errors.
    Do not install or update other Debian packages until the program
    has been run successfully.
   
    dpkg: error processing package usrmerge (--configure):
     installed usrmerge package post-installation script subprocess returned error exit status 1
    Errors were encountered while processing:
     usrmerge
    E: Sub-process /usr/bin/dpkg returned an error code (1)
The error above suggests that the duplicated files are in these two directories:
* /usr/lib/x86_64-linux-gnu/
* /lib/x86_64-linux-gnu/


Then I found out that the same failing directory pattern is associated to two files:
`libcrypto.so.1.0.0` and `libssl.so.1.0.0` files.


The ones in `/usr/lib/x86_64-linux-gnu/` are originals, while the `lib*.so.1.0.0`'s in `/lib/x86_64-linux-gnu/` are symlinks of other symlinks:


lrwxrwxrwx 1 root root 11 apr 26 2019 libssl.so.1.0.0 -> libssl.so.6
lrwxrwxrwx 1 root root 42 apr 24 2019 libssl.so.6 -> /usr/local/ampps/extra/lib/libssl.so.1.0.0


The `lib*.so.6` are then pointing to duplicated `lib*.so.1.0.0` in a different directory which seems to be related to ampps (MySQL dependencies?).


I have found many examples of `usrmerge` failure with incorrect links and locations but none similar to my problem. What seems to be relevant to all of them is this explanation: https://askubuntu.com/a/1441239/1728935


So, it appears that I should use only one original of the `lib*.so.1.0.0` to be used as source of the symlink in the `lib` sub-directory, but there are other symlinks, the `lib*.so.6`, sitting right in between that I don“t know how to solve :L. If someone can explain me the safest way to correct this apparent discrepancy so I don't end breaking something else (*Disclaimer*: I am not linux-expert)?