Monday, September 26, 2016

apt - Installed wrong teamvierer package now I have unmet dependency problems, how to revert back?



Package management is broken after a mistaken attempt to install TeamViewer (I selected the wrong TeamViewer package from the TeamViewer web site).



I have tried:




sudo apt-get clean
sudo apt-get update


Then if I do:



sudo apt-get install -f



I get:



Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
language-pack-kde-en kde-l10n-engb language-pack-kde-en-base
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:

libsane:i386
Suggested packages:
hpoj:i386 hplip:i386 libsane-extras:i386 sane-utils:i386
The following NEW packages will be installed
libsane:i386
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 0 B/3,554 kB of archives.
After this operation, 8,503 kB of additional disk space will be used.
Do you want to continue [Y/n]?

(Reading database ... 479536 files and directories currently installed.)
Unpacking libsane:i386 (from .../libsane_1.0.22-7ubuntu1_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/libsane_1.0.22-7ubuntu1_i386.deb (--unpack):
'./lib/udev/rules.d/40-libsane.rules' is different from the same file on the system
Errors were encountered while processing:
/var/cache/apt/archives/libsane_1.0.22-7ubuntu1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)


Removing the problem package doesn't seem to work:




sudo apt-get remove libsane:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libsane:i386 is not installed, so not removed
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
ia32-libs-multiarch:i386 : Depends: libsane:i386 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).



And removing ia32-libs-multiarch:i386 doesn't work either:



sudo apt-get remove ia32-libs-multiarch:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.

ia32-libs : Depends: ia32-libs-multiarch
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).


Ubuntu software center now can't be used as it continually gives me an error dialog saying "Items cannot be installed or removed until the package catalog is repaired. Do you want to repair it now?" - however the repair fails as follows:



(Reading database ... 479536 files and directories currently installed.)
Unpacking libsane:i386 (from .../libsane_1.0.22-7ubuntu1_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/libsane_1.0.22-7ubuntu1_i386.deb (--unpack):
'./lib/udev/rules.d/40-libsane.rules' is different from the same file on the system

Errors were encountered while processing:
/var/cache/apt/archives/libsane_1.0.22-7ubuntu1_i386.deb
Error in function:
dpkg: dependency problems prevent configuration of ia32-libs-multiarch:i386:
ia32-libs-multiarch:i386 depends on libsane; however:
Package libsane:i386 is not installed.
dpkg: error processing ia32-libs-multiarch:i386 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ia32-libs:
ia32-libs depends on ia32-libs-multiarch; however:

Package ia32-libs-multiarch is not installed.
Package ia32-libs-multiarch:i386 is not configured yet.
dpkg: error processing ia32-libs (--configure):
dependency problems - leaving unconfigured


I also get a notification saying "An error occurred, Please run Package Manager from the right-click menu or apt-get in a terminal to see what is wrong. The error message was: 'Error: BrokenCount > 0'. This usually means that your installed packages have unmet dependencies".



Any advice on how to get out of this mess? Thanks very much.




I finally resolved this. There was a circular dependency: ia32-libs-multiarch:i386 depends on libsane:i386 and vice versa. apt-get refuses to remove either one because it depends on the other. Also it refuses to remove them both, if you specify both on the same command line. For example:



sudo apt-get remove libsane:i386 ia32-libs-multiarch:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libsane:i386 is not installed, so not removed
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
ia32-libs : Depends: ia32-libs-multiarch

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).


However it will allow you to install both if you specify them on the same command line:



sudo apt-get install libsane:i386 ia32-libs-multiarch:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
ia32-libs-multiarch:i386 is already the newest version.

The following packages were automatically installed and are no longer required:
language-pack-kde-en kde-l10n-engb language-pack-kde-en-base
Use 'apt-get autoremove' to remove them.
Suggested packages:
hpoj:i386 hplip:i386 libsane-extras:i386 sane-utils:i386
The following NEW packages will be installed
libsane:i386
0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded.
2 not fully installed or removed.
Need to get 0 B/3,554 kB of archives.

After this operation, 8,503 kB of additional disk space will be used.
Do you want to continue [Y/n]?
(Reading database ... 479536 files and directories currently installed.)
Unpacking libsane:i386 (from .../libsane_1.0.22-7ubuntu1_i386.deb) ...
Setting up libsane:i386 (1.0.22-7ubuntu1) ...
Setting up ia32-libs-multiarch:i386 (20090808ubuntu36) ...
Setting up ia32-libs (20090808ubuntu36) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place



After that things are back working and I can remove ia32-libs-multiarch:i386 again.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...