Solved

How to fix a broken package install

Posted on 2011-09-29
4
1,372 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.
Suggested Courses

636 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