Eu quero me livrar do nginx, pois ele me dá problemas com o apt-get, mas não consigo me livrar dele, continuo recebendo:
$ sudo apt remove nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'nginx' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up nginx-core (1.10.3-0ubuntu0.16.04.2) ...
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
invoke-rc.d: initscript nginx, action "start" failed.
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2018-05-22 06:49:55 PDT; 5ms ago
Process: 30212 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Process: 30208 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
May 22 06:49:54 regDesktopHome nginx[30212]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
May 22 06:49:54 regDesktopHome nginx[30212]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
May 22 06:49:54 regDesktopHome nginx[30212]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
May 22 06:49:55 regDesktopHome nginx[30212]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
May 22 06:49:55 regDesktopHome nginx[30212]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
May 22 06:49:55 regDesktopHome nginx[30212]: nginx: [emerg] still could not bind()
May 22 06:49:55 regDesktopHome systemd[1]: nginx.service: Control process exited, code=exited status=1
May 22 06:49:55 regDesktopHome systemd[1]: Failed to start A high performance web server and a reverse proxy server.
May 22 06:49:55 regDesktopHome systemd[1]: nginx.service: Unit entered failed state.
May 22 06:49:55 regDesktopHome systemd[1]: nginx.service: Failed with result 'exit-code'.
dpkg: error processing package nginx-core (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
nginx-core
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2018-05-22 06:49:55 PDT; 1min 45s ago
Process: 30212 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Process: 30208 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
$ journalctl -xe
Hint: You are currently not seeing messages from other users and the system.
Users in the 'systemd-journal' group can see all messages. Pass -q to
turn off this notice.
No journal files were opened due to insufficient permissions.
$
Como posso resolver isso? Estou dentro16.04
Nesta solução, suponho que você tenha instalado o nginx do pacote (não das fontes).
Obtenha a lista de pacotes instalados como 'nginx': sudo apt list --installed 2>/dev/null |grep -i 'nginx'
Revise esta lista e remova os pacotes. Existem vários para 'nginx': nginx, nginx-extras, nginx-full, nginx-light etc.
O primeiro comando mostrará quais pacotes nginx exatos você possui em seu sistema. Do que você pode continuar a removê-los.