2

I have been having issues with installing zlib1g-dev (I need it for rbenv to work). Apt will not install it, saying that I don't have the required dependencies (it doesn't say exactly which zlib1g i need, but I have the "2ubuntu4" version. I manually downloaded the package from the Ubuntu repos, however when I open it with Ubuntu Software it still does not install.

Error logs:

foo@foo:/$ sudo apt-get install zlib1g-dev
[sudo] password for foo: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 zlib1g-dev : Depends: zlib1g (= 1:1.2.8.dfsg-2ubuntu4) but 1:1.2.8.dfsg-2ubuntu4.1 is to be installed
E: Unable to correct problems, you have held broken packages.

1 Answers1

4

The same issue happened to me on Focal, a pretty bare install from the default:

# apt install zlib1g-dev                                                                    
Reading package lists... Done                                                                                                          
Building dependency tree                                                                                                               
Reading state information... Done                                                                                                      
Some packages could not be installed. This may mean that you have                                                                      
requested an impossible situation or if you are using the unstable                                                                     
distribution that some required packages have not yet been created                                                                     
or been moved out of Incoming.                                                                                                         
The following information may help to resolve the situation:

The following packages have unmet dependencies.
zlib1g-dev : Depends: zlib1g (= 1:1.2.11.dfsg-2ubuntu1) but 1:1.2.11.dfsg-2ubuntu1.2 is to be installed

To get zlib1g-dev to install it was necessary to downgrade zlib1g, which tbh is ridiculous for something in the main repo:

# apt install zlib1g=1:1.2.11.dfsg-2ubuntu1

A similar issue happened when trying to install openssh-server after first post-install boot.

cEz
  • 266