Link to home
Start Free TrialLog in
Avatar of Cobraiti
Cobraiti

asked on

How to fix a broken package install

Hi

I installed heartbeat at first and then uninstalled it. Then deleted /etc/ha.d dir

When reinstalling heartbeat I get the following error Any idea how to fix this please ??

root@ismgmt02:~# apt-get install heartbeat
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  heartbeat
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 0B/414kB of archives.
After this operation, 1,565kB of additional disk space will be used.
(Reading database ... 44027 files and directories currently installed.)
Unpacking heartbeat (from .../heartbeat_1%3a3.0.3-1ubuntu1_amd64.deb) ...
.: 53: Can't open /etc/ha.d/shellfuncs
invoke-rc.d: initscript heartbeat, action "stop" failed.
dpkg: error processing /var/cache/apt/archives/heartbeat_1%3a3.0.3-1ubuntu1_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/heartbeat_1%3a3.0.3-1ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Thanks
Avatar of brutaldev
brutaldev
Flag of South Africa image

The uninstall did not complete properly and the installation expects the directory you deleted to still be there from the previous installation.

You can try forced re-install:
sudo apt-get --reinstall install heartbeat

Open in new window

Avatar of Cobraiti
Cobraiti

ASKER

That' didn't work :(

root@dev:~# apt-get --reinstall install heartbeat
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  heartbeat
0 upgraded, 1 newly installed, 0 to remove and 151 not upgraded.
Need to get 0B/414kB of archives.
After this operation, 1,565kB of additional disk space will be used.
(Reading database ... 119517 files and directories currently installed.)
Unpacking heartbeat (from .../heartbeat_1%3a3.0.3-1ubuntu1_amd64.deb) ...
.: 53: Can't open /etc/ha.d/shellfuncs
invoke-rc.d: initscript heartbeat, action "stop" failed.
dpkg: error processing /var/cache/apt/archives/heartbeat_1%3a3.0.3-1ubuntu1_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/heartbeat_1%3a3.0.3-1ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
ASKER CERTIFIED SOLUTION
Avatar of brutaldev
brutaldev
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you very much That worked after copying the shellfuncs across :)