3

So I am trying to install isc-dhcp-server, but when I tried installing it, the following errors show.

$ sudo apt-get install isc-dhcp-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
isc-dhcp-server is already the newest version (4.3.3-5ubuntu12.7).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up isc-dhcp-server (4.3.3-5ubuntu12.7) ...
/sbin/restorecon: lstat(/var/lib/dhcpd/dhcpd.leases) failed: No such file or directory
dpkg: error processing package isc-dhcp-server (--configure):
  subprocess installed post-installation script returned error exit status 255
Errors were encountered while processing:
  isc-dhcp-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've tried purging it first (I am trying to reinstall it since I have an error of not connecting to upstart in DRBL). It was successfully removed but when I tried re-installing it, then that's when the errors showed up.

Tried also these commands:

sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade

Then

sudo apt-get install isc-dhcp-server

============================================

Okay, nevermind. I found my solution. I deleted all isc-dhcp-server files under /var/lib/dpkg/info/. Then re-install it again.

sudo rm /var/lib/dpkg/info/isc-dhcp-server*
sudo apt-get install isc-dhcp-server
3
  • Actually, you were right in writing your own answer. There is nothing wrong with it here, plus it helps others see what you did to solve it. You can also accept your own answer.
    – Terrance
    Oct 25, 2017 at 6:00
  • Yes please do as @Terrance says so people know this question is already solved. Anyway you have to wait 2 days before you can accept your own answer as solution.
    – derHugo
    Oct 25, 2017 at 6:47
  • Oh. I'm sorry. I am new here. Will keep that in mind thanks! @derHugo
    – Rise Lady
    Oct 27, 2017 at 3:08

1 Answer 1

1

Wow... worked for me. Thanks! I hosted my server trying to edit permissions and stuff. I was trying to clean up old leases and everything was write protected. Uninstalled and reinstalled it and nothing was working properly. This allowed me to reinstall it and tell it to overwrite or recreate the configuration files that were missing.

sudo rm /var/lib/dpkg/info/isc-dhcp-server

sudo apt install isc-dhcp-server
2
  • I want to add that after trying your solution, I had to reboot the machine to get it working properly again. I couldn't ping devices and the leases file was empty before the reboot. I obviously had to reconfigure the dhcpd.conf file with my previous settings, but all is good now! I was about to the point of reinstalling my VM. Taking a snapshot now :D May 14, 2018 at 22:34
  • Why did you edit my post? "hosed" means that something broke. I did not mean "I hosted my server". Please change it back. Thanks May 17, 2018 at 4:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .