Score:0

How to install libapt-pkg.so.5.0 on Ubuntu 20.04

in flag

I have a dynamic library that I want to use. However, one of its dependencies is not available on my system:

$ ldd redacted_name.so | grep 'not found'
        libapt-pkg.so.5.0 => not found

I tried installing libapt-pkg, and it seemed to work. Here is the output for installing:

$ sudo apt install -y libapt-pkg5.0
Reading package lists... Done
Building dependency tree
  apt apt-utils libapt-pkg6.0
3 upgraded, 0 newly installed, 0 to remove and 307 not upgraded.
Need to get 2346 kB of archives.
After this operation, 42.0 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libapt-pkg6.0 amd64 2.0.9 [839 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 apt amd64 2.0.9 [1294 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 apt-utils amd64 2.0.9 [213 kB]
Fetched 2346 kB in 2s (1474 kB/s)
(Reading database ... 54241 files and directories currently installed.)
Preparing to unpack .../libapt-pkg6.0_2.0.9_amd64.deb ...
Unpacking libapt-pkg6.0:amd64 (2.0.9) over (2.0.2) ...
Setting up libapt-pkg6.0:amd64 (2.0.9) ...
(Reading database ... 54241 files and directories currently installed.)
Preparing to unpack .../archives/apt_2.0.9_amd64.deb ...
Unpacking apt (2.0.9) over (2.0.2) ...
Setting up apt (2.0.9) ...
Removing obsolete conffile /etc/kernel/postinst.d/apt-auto-removal ...
(Reading database ... 54240 files and directories currently installed.)
Preparing to unpack .../apt-utils_2.0.9_amd64.deb ...
Unpacking apt-utils (2.0.9) over (2.0.2) ...
Setting up apt-utils (2.0.9) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...

Note that it says no packages were newly installed, and also note that it lists libapt-pkg6.0 in the output.

However, then I still see that the dependency is not found:

$ ldd redacted_name.so | grep 'not found'
        libapt-pkg.so.5.0 => not found

Also, when I grep for my installed packages, libapt-pkg5.0 does not appear, but for some reason libapt-pkg6.0 does appear:

$ apt list --installed | grep libapt

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libapt-pkg6.0/focal-updates,now 2.0.9 amd64 [installed]

If I try to install libapt-pkg5.0 again, it fails, mentioning that it is referred to by another package:

$ sudo apt install -y libapt-pkg5.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libapt-pkg5.0 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libapt-pkg5.0' has no installation candidate

How can I correctly install libapt-pkg5.0 on my Ubuntu 20.04 system?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.