1

as a dependency for a software I wanted to update ZLIB from 1.2.8 to 1.2.9, following this comment, but I realised too late, that there is no 1.2.9 for Ubuntu 16.04, so I broke things and the first thing I noticed is that I couldn't connect to the internet (actually even my router) anymore. Finally I followed this guide and extracted zlib_xxx.deb to root, which restored the internet connection. Most of the stuff seems to work now, but I get a system error that doesn't want to go away. If I run update or upgrade, I get the following message:

The following packages have unmet dependencies:
 zlib1g : Breaks: zlib1g:i386 (!= 1:1.2.8.dfsg-2ubuntu4) but 1:1.2.8.dfsg-2ubuntu4.1 is installed
 zlib1g:i386 : Breaks: zlib1g (!= 1:1.2.8.dfsg-2ubuntu4.1) but 1:1.2.8.dfsg-2ubuntu4 is installed
 zlib1g-dev : Depends: zlib1g (= 1:1.2.8.dfsg-2ubuntu4.1) but 1:1.2.8.dfsg-2ubuntu4 is installed

I tried

sudo apt install zlib1g=1:1.2.8.dfsg-2ubuntu4

which gives me the same error and

sudo apt install zlib1g=1:1.2.8.dfsg-2ubuntu4.1

which tells me

Unpacking zlib1g:amd64 (1:1.2.8.dfsg-2ubuntu4.1) over (1:1.2.8.dfsg-2ubuntu4) ...
dpkg: error processing archive /var/cache/apt/archives/zlib1g_1%3a1.2.8.dfsg-2ubuntu4.1_amd64.deb (--unpack):
 trying to overwrite shared '/usr/share/doc/zlib1g/changelog.Debian.gz', which is different from other instances of package zlib1g:amd64
Processing triggers for libc-bin (2.23-0ubuntu10) ...
/sbin/ldconfig.real: /usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn.so.7 is not a symbolic link

/sbin/ldconfig.real: /usr/local/cuda-9.2/targets/x86_64-linux/lib/libcudnn.so.7 is not a symbolic link

Errors were encountered while processing:
 /var/cache/apt/archives/zlib1g_1%3a1.2.8.dfsg-2ubuntu4.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

The last error also happens when I try

sudo apt-get -f install

I would be really thankful for any advice!

SOLVED

Finally figured it out, you can force-overwrite using the following option

apt-get install -f -o Dpkg::Options::="--force-overwrite" zlib1g

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.