Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invoke-rc.d: could not determine current runlevel #2702

Closed
spences10 opened this issue Nov 28, 2017 · 5 comments
Closed

invoke-rc.d: could not determine current runlevel #2702

spences10 opened this issue Nov 28, 2017 · 5 comments

Comments

@spences10
Copy link

spences10 commented Nov 28, 2017

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    Microsoft Windows [Version 10.0.16299.64]

  • What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)
    Trying to remove docker.io so I can install Docker CE

Current status:

/mnt/c/Users/spenc
⟩ sudo apt remove docker.io
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  containerd runc
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  docker.io
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 62.7 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 30768 files and directories currently installed.)
Removing docker.io (1.13.1-0ubuntu1~16.04.2) ...
invoke-rc.d: could not determine current runlevel
 * Stopping Docker: docker
No process in pidfile '/var/run/docker-ssd.pid' found running; none killed.
invoke-rc.d: initscript docker, action "stop" failed.
dpkg: error processing package docker.io (--remove):
 subprocess installed pre-removal script returned error exit status 1
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 docker.io
E: Sub-process /usr/bin/dpkg returned an error code (1)

Tried all manner of solutions on SO, sorry don't have the links

I tried following along to this: #1761

Still get the same output, I tried to ignore and go to the next step and install the .deb file with:

⟩ sudo dpkg -i /mnt/c/Users/spenc/Desktop/docker-ce_17.09.0~ce-0~ubuntu_amd64.deb
dpkg: considering removing docker.io in favour of docker-ce ...
dpkg: docker.io is not properly installed; ignoring any dependencies on it
dpkg: yes, will remove docker.io in favour of docker-ce
(Reading database ... 30768 files and directories currently installed.)
Preparing to unpack .../docker-ce_17.09.0~ce-0~ubuntu_amd64.deb ...
invoke-rc.d: could not determine current runlevel
 * Stopping Docker: docker
No process in pidfile '/var/run/docker-ssd.pid' found running; none killed.
invoke-rc.d: initscript docker, action "stop" failed.
dpkg: error processing archive /mnt/c/Users/spenc/Desktop/docker-ce_17.09.0~ce-0~ubuntu_amd64.deb (--install):
 subprocess installed pre-removal script returned error exit status 1
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 /mnt/c/Users/spenc/Desktop/docker-ce_17.09.0~ce-0~ubuntu_amd64.deb

But I'm not getting very far

  • What's wrong / what should be happening instead: remove the program?

  • Strace of the failing command, if applicable: (If some_command is failing, then run strace -o some_command.strace -f some_command some_args, and link the contents of some_command.strace in a gist here)

I can't work out what this means tried this strace -o apt.strace -f remove docker.io but nothing happenend

See our contributing instructions for assistance.

@spences10
Copy link
Author

Ok so I started again with WSL this time avoiding using Linuxbrew, docker.io isn't installed so I skip ahead to installing docker-ce and still get a similar error. Here's the output:

⟩ sudo dpkg -i /mnt/c/Users/spenc/Desktop/docker-ce_17.09.0~ce-0~ubuntu_amd64.deb
(Reading database ... 27427 files and directories currently installed.)
Preparing to unpack .../docker-ce_17.09.0~ce-0~ubuntu_amd64.deb ...
invoke-rc.d: could not determine current runlevel
 * Docker already stopped - file /var/run/docker-ssd.pid not found.
Unpacking docker-ce (17.09.0~ce-0~ubuntu) over (17.09.0~ce-0~ubuntu) ...
Setting up docker-ce (17.09.0~ce-0~ubuntu) ...
invoke-rc.d: could not determine current runlevel
Processing triggers for systemd (229-4ubuntu21) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for man-db (2.7.5-1) ...

Anyone able to offer any insight?

Thanks

@spences10
Copy link
Author

Ok, it doesn't seem to be supported by WSL:

https://forums.docker.com/t/cant-get-docker-to-start/32314

If one of the contributors could confirm then I'm happy to close this.

Many thanks.

@therealkenc
Copy link
Collaborator

#2288 #2291. Please track progress in those open tickets. #2288 in particular tracks the ask in your OP (though it takes a little remedial German to see).

@paulvandenburg
Copy link

I've found the solution in #2288, putting it here for wanders from Google.
Edit the file /var/lib/dpkg/info/docker.io.prerm and remove/comment the if check at the end with the invoke command.

if ([ -x "/etc/init.d/docker" ] || [ -e "/etc/init/docker.conf" ]) && \
   [ "$1" = remove ]; then
        invoke-rc.d docker stop || exit $?
fi

However do make sure the docker service is not running sudo service docker stop.
See also jstachowiak's comment in that issue: #2288 (comment)

@Hiten-shell-2020
Copy link

I've found the solution in #2288, putting it here for wanders from Google.
Edit the file /var/lib/dpkg/info/docker.io.prerm and remove/comment the if check at the end with the invoke command.

if ([ -x "/etc/init.d/docker" ] || [ -e "/etc/init/docker.conf" ]) && \
   [ "$1" = remove ]; then
        invoke-rc.d docker stop || exit $?
fi

However do make sure the docker service is not running sudo service docker stop.
See also jstachowiak's comment in that issue: #2288 (comment)

This fix works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants