Error during installation

Asked by JR

Hello,

During installation of mosquitto I keep getting the following error:

Setting up mosquitto (1.1.1-0mosquitto1) ...
 System start/stop links for /etc/init.d/mosquitto already exist.
invoke-rc.d: initscript mosquitto, action "restart" failed.
dpkg: error processing mosquitto (--configure):
 subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 mosquitto
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:

What is wrong and how can I fix it?

Thanks in advance and with best regards,

JR.

Question information

Language:
English Edit question
Status:
Solved
For:
mosquitto Edit question
Assignee:
No assignee Edit question
Solved by:
JR
Solved:
Last query:
Last reply:
Revision history for this message
Roger Light (roger.light) said :
#1

Hi JR,

Thanks for reporting this, the packaging changed a bit for the 1.1 version so I was half expecting some problems.

Could you you let me know if you've already installed mosquitto and if so, where was it from (self compiled or from the debian repository for example)?

If you have already got a copy of mosquitto installed you could try uninstalling it first. I think that should fix things for you and hopefully the other information should help me figure out where something is going wrong.

Thanks,

Roger

Revision history for this message
JR (zaalberg-jeroen) said :
#2

Hello Roger,

I 've installed the package using the repository:

sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
sudo apt-get update

I've did not manage to successfully uninstall Mosquitto. I've tried the following:

sudo apt-get remove --purge mpsquitto. The following error occurs:

The following packages will be REMOVED:
  mosquitto*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 305 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 461251 files and directories currently installed.)
Removing mosquitto ...
invoke-rc.d: initscript mosquitto, action "stop" failed.
dpkg: error processing mosquitto (--purge):
 subprocess installed pre-removal script returned error exit status 1
invoke-rc.d: initscript mosquitto, action "start" failed.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 mosquitto
E: Sub-process /usr/bin/dpkg returned an error code (1)

Using:

sudo dpkg --configure -a
sudo apt-get --purge remove mosquitto:

The following packages will be REMOVED:
  mosquitto*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 305 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 461251 files and directories currently installed.)
Removing mosquitto ...
invoke-rc.d: initscript mosquitto, action "stop" failed.
dpkg: error processing mosquitto (--purge):
 subprocess installed pre-removal script returned error exit status 1
invoke-rc.d: initscript mosquitto, action "start" failed.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 mosquitto
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Roger Light (roger.light) said :
#3

Hi JR,

I'm not trying to be awkward, but you originally said:

> Setting up mosquitto (1.1.1-0mosquitto1) ...

And now:

> sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
> sudo apt-get update

The package versions in the ppa all have "0ppa" in the version number (which is for Ubuntu only), not "0mosquitto" (which is for debian only). They shouldn't be mixed because debian and ubuntu have some different features, in particular different init scripts - which is where you are having problems.

Are you on debian or ubuntu?

Revision history for this message
JR (zaalberg-jeroen) said :
#4

Hey Roger,

Thanks for the clarification :)

Perhaps I accidentally installed the Debian package first....... (I am on Ubuntu).

Is it possible to fix it?

I've tried to add the ppa to the repository. However, I get the following error:

installArchives() failed: Setting up mosquitto (1.1.1-0mosquitto1) ...
 System start/stop links for /etc/init.d/mosquitto already exist.
invoke-rc.d: initscript mosquitto, action "restart" failed.
dpkg: error processing mosquitto (--configure):
 subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
 mosquitto

So somehow the debian package is bugging me (my fault........).

Thanks in advance.

Revision history for this message
Roger Light (roger.light) said :
#5

> System start/stop links for /etc/init.d/mosquitto already exist.
> invoke-rc.d: initscript mosquitto, action "restart" failed.

Fixing the above error might be fixed by using:

sudo update-rc.d mosquitto remove

This will remove the links in /etc/rc*.d/ that refer to
/etc/init.d/mosquitto and will hopefully let the install proceed.

Cheers,

Roger

Revision history for this message
JR (zaalberg-jeroen) said :
#6

Hey Roger,

Thanks for the help. It's fixed!