How to install ldapsearch on 16.04?

After digging around for a while under System Settings > Software & Updates I remembered once upon a time that I disabled the install updates from the following sources because I got a little annoyed with the frequent interrupting pop-ups to upgrade. I prefer to manage my upgrades manually from apt on the terminal and I didn't want it to automatically upgrade me from 16.04 to 16.10 or some other release. What I didn't realize is that these checkboxes stripped the deb package sources from /etc/apt/sources.list so it would never fetch the package updates and always report my system was up-to-date. After checking those boxes and then running apt update and upgrade I was able to successfully install ldap-utils

screenshot software and updates install updates from all


sudo apt install aptitude
sudo aptitude install ldap-utils 

    Keep the following packages at their current version:
1)     ldap-utils [Not Installed]                         



Accept this solution? [Y/n/q/?] **n**
The following actions will resolve these dependencies:

     Downgrade the following packages:                                          
1)     libldap-2.4-2 [2.4.49+dfsg-2ubuntu1.3 (now) -> 2.4.49+dfsg-2ubuntu1.2 (fo



Accept this solution? [Y/n/q/?] **Y**

I was also facing same issue.

OS: Ubuntu 16.04.4 LTS 64 bit

Logs:

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:  
ldap-utils : Depends: libldap-2.4-2 (= 2.4.42+dfsg-2ubuntu3) but 2.4.42+dfsg-2ubuntu3.1 is to be installed  
E: Unable to correct problems, you have held broken packages.

Steps that solved problem:

  1. Run command: sudo apt install -f
  2. Run command: sudo apt install ldap-utils

Yes now I can see ldapsearch is installed on my system