0

I have two packages:

  • libsai-A
  • libsai-B

Both of these package 'Provides' a virtual package called 'libsai', but libsai-B can 'Replace' (copy over) libsai-A. For some reason, not all the symlinks in libsai-A is getting overwritten when libsai-B is installed.

Symlinks in libsai-A .deb package: ./usr/lib/x86_64-linux-gnu/libsai-0.9.6.so -> libsai-0.9.6.so.1.0.0 ./usr/lib/x86_64-linux-gnu/libsai-0.9.6.so.1 -> libsai-0.9.6.so.1.0.0

Symlinks in libsai-B .deb package: ./usr/lib/x86_64-linux-gnu/libsai-0.9.6.so -> ../test/dist/libsai-B-test.so ./usr/lib/x86_64-linux-gnu/libsai-0.9.6.so.1 -> ../test/dist/libsai-B-test.so

The first symlink (libsai-0.9.6.so) gets overwritten correctly. But the second one doesn't (libsai-0.9.6.so.1): root@TB:~# ls -alt /usr/lib/x86_64-linux-gnu/libsai* /usr/lib/x86_64-linux-gnu/libsai-0.9.6.so.1 -> libsai-0.9.6.so.1.0.0 <<<== WRONG LOCATION /usr/lib/x86_64-linux-gnu/libsai-0.9.6.so.1.0.0 /usr/lib/x86_64-linux-gnu/libsai-0.9.6.la /usr/lib/x86_64-linux-gnu/libsai-0.9.6.so -> ../test/dist/libsai-B-test.so
root@TB:~# dpkg -S /usr/lib/x86_64-linux-gnu/libsai-0.9.6.so.1 libsai-B: /usr/lib/x86_64-linux-gnu/libsai-0.9.6.so.1 root@TB:~# dpkg -S /usr/lib/x86_64-linux-gnu/libsai-0.9.6.so.1.0.0 libsai-A: /usr/lib/x86_64-linux-gnu/libsai-0.9.6.so.1.0.0

It looks like the symlink (libsai-0.9.6.so.1) was updated to be owned by libsai-B, but the destination of that symlink is still pointing to the old location (a file owned by libsai-A).

Here is what my libsai-B.link file looks like: usr/lib/test/dist/libsai-B-test.so usr/lib/x86_64-linux-gnu/libsai-0.9.6.so.1 usr/lib/test/dist/libsai-B-test.so usr/lib/x86_64-linux-gnu/libsai-0.9.6.so

I'm using Autotools to trigger all the dh_helper stuff to create my package. Any idea what I'm doing wrong?

Thanks!

John Bollinger
  • 160,171
  • 8
  • 81
  • 157
GHe
  • 499
  • 1
  • 4
  • 10
  • If your package has a `Replaces:` line it should trigger removal of the package it replaces. Does A correctly remove its symlinks when you uninstall the package? (Sorry, I somehow overlooked this detail when you originally posted your question.) – tripleee Jul 27 '18 at 06:54

1 Answers1

1

Overwriting another package's symlink is a violation of Debian policy. If you want to replace something, you have to explicitly override it, or use a facility like alternatives.

tripleee
  • 175,061
  • 34
  • 275
  • 318
  • Sorry for the late reply. Thank you for the info. Is there anywhere I can learn about these policies? I used this one: https://www.debian.org/doc/manuals/maint-guide/ thanks,g – GHe Jul 27 '18 at 06:37
  • That's the one, as well as the actual [policy](https://www.debian.org/doc/debian-policy/) itself. There's probably something in the [Debian wiki](https://wiki.debian.org/DebianDevelopment) as well. Maybe check the https://debian-administration.org/ archives too; the site is no longer being updated, but they used to have some easy tutorials on various topics. – tripleee Jul 27 '18 at 06:49