Apparently I removed nginx but it keep starting at boot, I'm using lighttpd but nginx starts first causing lighttpd to fail to start, so at every boot I have to stop nginx and start lighttpd manually.

Things that I have done: ( command: output )

  • apt-get remove nginx: Package 'nginx' is not installed, so not removed
  • service nginx status: [...] Active: active (running) [...]
  • update-rc.d nginx remove
  • chkconfig nginx: (nginx off)
  • mv /etc/init.d/nginx /tmp/
  • sysv-rc-conf: (It is disabled at every runlevel)
  • rcconf: (nginx is not listed)

  • ... and many reboot

System: RPi 3B running Raspbian 8 (Jessie)


dpkg -l | awk ' { print $2 } ' | grep ^nginx output:

  • dpkg-query: package 'nginx' is not installed Use dpkg --info (= dpkg-deb --info) to examine archive files, and dpkg --contents (= dpkg-deb --contents) to list their contents. – Mc Kernel Apr 20 '17 at 8:42
  • 1
    About the close vote: there are a lot of old documentation around, and still more users bound to think something is wrong with their systems with the changes of nginx from one to multiple packages, and with the migration to systemd; this post might be useful to future readers - the automatic moderation system is also not showing this has got an accepted answer. – Rui F Ribeiro Apr 20 '17 at 14:42

Raspbian uses systemd to manage services by default, not SysV. Hence sysv-rc-conf and chkconfig having an inconsistent behaviour.

To disable nginx upon boot do:

sudo systemctl disable nginx.service

As for having nginx files hanging around after a successful purge, something must have gone terribly wrong, or there are still packages lying around. The latter is bound to be the case, as nowadays nginx is not a single package anymore, and you need to remove several packages:

$apt-cache search nginx | grep ^nginx | awk ' { print $1 } '

What happened is that nginx went from having a single package to multiple ones. You may list the nginx packages you have still installed:

dpkg -l  | awk ' { print $2 } '  | grep ^nginx

As you updated the post with the nginx packages that you still have, I do recommend doing:

dpkg --purge nginx-common nginx-full

For a future reference, you can check the available packages at:

  • It worked! Thanks :) However, why it keept running after an apt-get remove? doesn't update-rc.d neither work in raspbian? – Mc Kernel Apr 20 '17 at 8:40
  • dpkg -l | grep ^nginx gives me no output, but removing the exponent character it returns two results (post updated). Is it how should it be? – Mc Kernel Apr 20 '17 at 8:53
  • oh right, I still having nginx-common and nginx-full atm, uninstalling... and done, it's actually removed now, thanks again! :) – Mc Kernel Apr 20 '17 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.