5

I wanted to install the current version of ausweisapp, which requires packages or versions of them which are not in the repo of Mint 21.3, so I started to install those packages and their dependencies manually. The third one was libzstd1_1.5.4. There already was an older version of it installed, now both are broken. If I try to remove one of them, both Synaptic and apt-get install -f want to remove many other packages, like half of the system. Aptitude: Same.

How can I remove only the package I installed manually, without removing anything else?


sudo apt install libzstd1{,:i386}=1.4.8+dfsg-3build1 returns:

Reading package lists... Done Building dependency tree... Done Reading state information... Done libzstd1:i386 is already the newest version (1.4.8+dfsg-3build1). The following packages were automatically installed and are no longer required: libhttp-parser2.9 libqt5qmlmodels5 libqt5qmlworkerscript5 libqt5quick5 libqt5quickcontrols2-5 libqt5quicktemplates2-5 libqt5websockets5 qml-module-qt-labs-platform qml-module-qtgraphicaleffects qml-module-qtqml qml-module-qtqml-models2 qml-module-qtqml-statemachine qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qtquick-layouts qml-module-qtquick-templates2 qml-module-qtquick-window2 qml-module-qtquick2 Use 'sudo apt autoremove' to remove them. The following packages will be DOWNGRADED: libzstd1 0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 7 not upgraded. 2 not fully installed or removed. Need to get 0 B/324 kB of archives. After this operation, 62.5 kB of additional disk space will be used. Do you want to continue? [Y/n] Y dpkg: warning: downgrading libzstd1:amd64 from 1.5.4+dfsg2-5 to 1.4.8+dfsg-3build1 (Reading database ... 686126 files and directories currently installed.) Preparing to unpack .../libzstd1_1.4.8+dfsg-3build1_amd64.deb ... Unpacking libzstd1:amd64 (1.4.8+dfsg-3build1) over (1.5.4+dfsg2-5) ... dpkg: error processing archive /var/cache/apt/archives/libzstd1_1.4.8+dfsg-3build1_amd64.deb (--unpack): trying to overwrite shared '/usr/share/doc/libzstd1/changelog.Debian.gz', which is different from other instances of package libzstd1:amd64 Errors were encountered while processing: /var/cache/apt/archives/libzstd1_1.4.8+dfsg-3build1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1) 

Output of dpkg:

~ $: sudo dpkg --purge libzstd1_1.5.4 dpkg: warning: ignoring request to remove libzstd1_1.5.4 which isn't installed ~ $: sudo dpkg --purge libzstd1 dpkg: dependency problems prevent removal of libzstd1:amd64: systemd depends on libzstd1 (>= 1.4.0). squashfs-tools depends on libzstd1 (>= 1.4.0). rsync depends on libzstd1 (>= 1.4.0). plocate depends on libzstd1 (>= 1.4.0). mesa-vulkan-drivers:amd64 depends on libzstd1 (>= 1.4.0). mesa-vdpau-drivers:amd64 depends on libzstd1 (>= 1.4.0). mesa-va-drivers:amd64 depends on libzstd1 (>= 1.4.0). libxatracker2:amd64 depends on libzstd1 (>= 1.4.0). libtiff5:amd64 depends on libzstd1 (>= 1.4.0). libsystemd0:amd64 depends on libzstd1 (>= 1.4.0). libsereal-encoder-perl:amd64 depends on libzstd1 (>= 1.4.0). libsereal-decoder-perl depends on libzstd1 (>= 1.4.0). libqt5core5a:amd64 depends on libzstd1 (>= 1.4.0). libosmesa6:amd64 depends on libzstd1 (>= 1.4.0). libkmod2:amd64 depends on libzstd1 (>= 1.4.0). libgl1-mesa-dri:amd64 depends on libzstd1 (>= 1.4.0). libflatpak0:amd64 depends on libzstd1 (>= 1.4.0). libcurl4:amd64 depends on libzstd1 (>= 1.4.0). libcurl3-gnutls:amd64 depends on libzstd1 (>= 1.4.0). libboost-iostreams1.74.0:amd64 depends on libzstd1 (>= 1.4.0). libarchive13:amd64 depends on libzstd1 (>= 1.4.0). libapt-pkg6.0:amd64 depends on libzstd1 (>= 1.4.0). kmod depends on libzstd1 (>= 1.4.0). gfortran-11 depends on libzstd1 (>= 1.4.0). gcc-12 depends on libzstd1 (>= 1.4.0). gcc-11 depends on libzstd1 (>= 1.4.0). g++-11 depends on libzstd1 (>= 1.4.0). flatpak depends on libzstd1 (>= 1.4.0). dpkg depends on libzstd1 (>= 1.4.0). cpp-12 depends on libzstd1 (>= 1.4.0). cpp-11 depends on libzstd1 (>= 1.4.0). btrfs-progs depends on libzstd1 (>= 1.4.0). dpkg: error processing package libzstd1:amd64 (--purge): dependency problems - not removing Errors were encountered while processing: libzstd1:amd64 

2 Answers 2

9

The key is in your comment about an i386 version of libzstd1 installed alongside the amd64 version. Packages for different architectures need to be kept in sync; if you want to upgrade libzstd1, you need to install newer versions for amd64 and i386.

To undo what you’ve done, re-install the Mint 21.3 versions of the packages:

sudo apt install libzstd1{,:i386}=1.4.8+dfsg-3build1 

As a general rule, you shouldn’t try to install newer packages taken elsewhere. In your case a safer approach would be to upgrade to the latest release of Linux Mint.

8
  • Thanks, unfortunately, sudo apt reinstall libzstd1{,:i386}=1.4.8+dfsg-3build1 returns an error and aborts. It says, I can specify a package version only with install and forbid-version. I tried it with install instead of reinstall, and it offered to downgrade the package. I chose yes and it began doing its thing, but after several lines of output returned an error when trying to overwrite /usr/share/doc/libzstd1/changelog.Debian.gz: Sub-process /usr/bin/dpkg returned an error code (1) Commented Apr 24 at 12:36
  • What would happen, if I deleted the files of the newer version of the library? They are listed in Synaptic: /usr/lib/x86_64-linux-gnu/libzstd.so.1 /usr/lib/x86_64-linux-gnu/libzstd.so.1.5.4 And maybe /usr/share/doc/libzstd1/changelog.Debian.gz /usr/share/doc/libzstd1/changelog.gz /usr/share/doc/libzstd1/copyright Commented Apr 24 at 12:40
  • What was the dpkg error? Commented Apr 24 at 18:48
  • Are you referring to thecarpy’s question below? sudo dpkg --purge libzstd1_1.5.4 says that this lib is not installed. sudo dpkg --purge libzstd1 returns an error, saying it cannot be removed because of dependencies. Commented Apr 24 at 21:51
  • 1
    Installing the amd64 package is fine, your system needs both (presumably the i386 version is needed for Wine or Steam or some such). Try deleting /usr/share/doc/libzstd1/changelog.Debian.gz Commented Apr 25 at 18:24
6

This is not how you should proceed. First of all, you get the dependencies and put them in a separate location, such as /home/jdoe/lib, for example, then you launch the program as follows:

LD_LIBRARY_PATH=/home/jdoe/lib:/opt/something/lib:/opt/other/lib <program> 

NB: Libraries in your home folder might depend on other libraries that might need to get added to this lib folder if the system ones are not a supported version.

To fix your current problem, you need to remove the library you just installed, libzstd1_1.5.4, then fix borken packages:

apt --fix-broken install 

One other way to run programs that require another distribution or version is to use a docker container - this is much easier than the first. Note that some older linux distros like Ubuntu 1804 cannot run current distributions because of some kernel changes.

12
  • How to correctly run such programs sounds fairly easy. But how do I remove the lib? Just delete the files listed by Synaptic? Commented Apr 23 at 13:22
  • Does sudo apt remove --force --purge not work ? Commented Apr 23 at 13:25
  • If the previous does not work or wants to remove a bunch of other packages, you could try with sudo dpkg --purge libzstd1_1.5.4 Commented Apr 23 at 14:11
  • sudo apt remove --force --purge does not work. It says, those options cannot be combined. sudo dpkg --purge libzstd1_1.5.4 says that this lib is not installed. sudo dpkg --purge libzstd1 returns an error, saying it cannot be removed because of dependencies. Commented Apr 23 at 14:17
  • yeah, sorry, remove --force and it shpuld work but I expect it to want to uninstall a bunch of packages, dpkg should not. Commented Apr 23 at 14:19

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.