Wednesday, August 4, 2021

debian 10: nginx fails to install after system upgrade


 >PROBLEM


Scenario:

After performing an upgrade using:

apt update

apt upgrade


nginx returns installing issues and fails to start, returning an error message like this:


Aug 04 13:28:47 myserver.com systemd[1]: Failed to start A high performance web server and a reverse proxy server.

dpkg: error processing package nginx-full (--configure):

 installed nginx-full package post-installation script subprocess returned error exit status 1

dpkg: dependency problems prevent configuration of nginx:

 nginx depends on nginx-full (<< 1.14.2-2+deb10u4.1~) | nginx-light (<< 1.14.2-2+deb10u4.1~) | nginx-extras (<< 1.14.2-2+deb10u4.1~); however:

  Package nginx-full is not configured yet.

  Package nginx-light is not installed.

  Package nginx-extras is not installed.


>SOLUTION

1. Check the installed packages:

  dpkg -l nginx*

Returns:

||/ Name           Version          Architecture Description
+++-==============-================-============-=========================================================
iU  nginx          1.14.2-2+deb10u4 all          small, powerful, scalable web/proxy server
ii  nginx-common   1.14.2-2+deb10u4 all          small, powerful, scalable web/proxy server - common files
un  nginx-doc      <none>           <none>       (no description available)
un  nginx-extras   <none>           <none>       (no description available)
iF  nginx-full     1.14.2-2+deb10u4 amd64        nginx web/proxy server (standard version)
un  nginx-light    <none>           <none>       (no description available)
root@again4u:/opt# dpkg remove nginx-1.14.2


2. Purge the packages:

  apt purge nginx-common nginx-full


3. Testing the removal:

  dpkg -l nginx*
root@again4u:/opt# dpkg -l nginx*
dpkg-query: no packages found matching nginx*

Shall return "no packages found..."


4. Deactivate the firewall, temporarily.


5. Reinstall nginx.

  apt install -f nginx
  

6. If reinstallation fails returning the same previous issue, uninstall nginx again, repeating the steps above and reboot the server.

If using a remote server, use the provider's interface to reboot it.

Deactivate the firewall, temporarily, and install nginx again:

  apt install -f nginx



7. Test the installation.

  systemctl status nginx

If successful, return something like this:

● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2021-08-04 13:54:48 EDT; 22min ago
     Docs: man:nginx(8)
 Main PID: 723 (nginx)
    Tasks: 3 (limit: 4915)
   Memory: 16.3M
   CGroup: /system.slice/nginx.service
           ├─723 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           ├─726 nginx: worker process
           └─727 nginx: worker process


8. Start the firewall.


>ENV

debian 10

No comments:

Post a Comment

eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

  >PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...