Solved

How to fix a broken package install

Posted on 2011-09-29
4
1,344 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:Cobraiti
  • 2
  • 2
4 Comments
 
LVL 11

Expert Comment

by:brutaldev
ID: 36890099
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

0
 

Author Comment

by:Cobraiti
ID: 36907002
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)
0
 
LVL 11

Accepted Solution

by:
brutaldev earned 500 total points
ID: 36911385
Hmmm, try to just create the directory that it is looking for first:
mkdir -p /etc/ha.d/shellfuncs

Open in new window

If the installer doesn't fix it them you can try copy the required shellfunc files manually from another machine that has Heartbeat installed correctly, if you need them just reply and I will attach a zip of the files that you can test with.
0
 

Author Closing Comment

by:Cobraiti
ID: 36921970
Thank you very much That worked after copying the shellfuncs across :)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question