0

I get the following whenever I try to install a package: (g++-12 in this case)

Reading package lists... Done Building dependency tree... Done Reading state information... Done Correcting dependencies... Done The following packages were automatically installed and are no longer required: binutils-common:i386 binutils-i686-linux-gnu:i386 lib32asan8 lib32atomic1 lib32gcc-12-dev lib32gcc-s1 lib32gomp1 lib32itm1 lib32quadmath0 lib32stdc++6 lib32ubsan1 libasan8:i386 libbinutils:i386 libc6-dev:i386 libc6-dev-i386 libc6-dev-x32 libc6-i386 libc6-x32 libcc1-0:i386 libcom-err2:i386 libcrypt-dev:i386 libctf-nobfd0:i386 libctf0:i386 libgcc-12-dev:i386 libgmp10:i386 libgomp1:i386 libgprofng0:i386 libgssapi-krb5-2:i386 libisl23:i386 libitm1:i386 libjansson4:i386 libk5crypto3:i386 libkeyutils1:i386 libkrb5-3:i386 libkrb5support0:i386 libmpc3:i386 libmpfr6:i386 libnsl-dev:i386 libnsl2:i386 libqt5webkit5 libquadmath0:i386 libssl3:i386 libtirpc-dev:i386 libtirpc3:i386 libubsan1:i386 libx32asan8 libx32atomic1 libx32gcc-12-dev libx32gcc-s1 libx32gomp1 libx32itm1 libx32quadmath0 libx32stdc++6 libx32ubsan1 linux-headers-6.1.0-11-common linux-kbuild-6.1 linux-libc-dev:i386 lshw qml-module-qtwebkit x11-apps x11-session-utils xinit Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: g++-12 Suggested packages: g++-12-multilib gcc-12-doc The following packages will be REMOVED: teamviewer-monitoring The following NEW packages will be installed: g++-12 0 upgraded, 1 newly installed, 1 to remove and 17 not upgraded. 3 not fully installed or removed. Need to get 0 B/10.7 MB of archives. After this operation, 32.2 MB of additional disk space will be used. Do you want to continue? [Y/n] y (Reading database ... 233626 files and directories currently installed.) Removing teamviewer-monitoring (23.6.9001) ... rm: cannot remove '/var/opt/teamviewer-rm/*.json': No such file or directory dpkg: error processing package teamviewer-monitoring (--remove): installed teamviewer-monitoring package post-removal script subprocess returned error exit status 1 dpkg: too many errors, stopping Errors were encountered while processing: teamviewer-monitoring Processing was halted because there were too many errors. E: Sub-process /usr/bin/dpkg returned an error code (1) 

Not sure what to do..

TIA.

2
  • Please edit your question and tell us your operating system. Yes, you've tagged with Debian, but which Debian? Or which Debian based distribution? Please makes sure to always include the actual OS in the question itself. Also make sure to show us the command you ran. Is that apt install g++? apt-get install g++? Something else? Commented Feb 2, 2024 at 16:47
  • What is the situation with teamviewer? Have you removed it manually? Commented Feb 2, 2024 at 16:48

1 Answer 1

2

The maintainer scripts provided with the teamviewer-monitoring package that is currently installed seem to be broken; the simplest solution to unblock things is to remove them:

sudo rm /var/lib/dpkg/info/teamviewer-monitoring.*rm 

If you want to try removing it cleanly, you could try fixing those scripts instead.

Once the scripts are removed or fixed, you’ll be able to finish removing teamviewer-monitoring and install other packages.

2
  • 1
    I would probably try "creating" one of the files the script is trying to remove (with a command like touch var/opt/teamviewer-rm/a.json) first, just in the hope that anything good that script does still gets done. But that might just lead to them failing on doing something else, removing them has a higher chance of getting rid of the blockage. Fixing the scripts is the better (but harder) solution. Commented Feb 2, 2024 at 17:01
  • Awesome. Thank you. Commented Feb 2, 2024 at 17:08

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.