Solved

How to fix a broken package install

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.:

758 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

26 Experts available now in Live!

Get 1:1 Help Now