Solved

How to fix a broken package install

Posted on 2011-09-29
4
1,325 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now