The repository does not have a Release file |
|
Restarting networking failed because the control process exited with error code. |
|
Failed to start A high performance web server and a reverse proxy server |
|
(разные команды) command not found debian |
|
ifconfig command not found debian |
|
user is not in the sudoers file |
|
usermod: command not found |
|
Возможные ошибки при установке Java |
The repository does not have a Release file.
При попытке выполнить
sudo apt update
[sudo] password for andrei:
Ign:1 cdrom://[Debian GNU/Linux 10.4.0 _Buster_ — Official amd64 DVD Binary-1 20200509-10:26] buster InRelease
Err:2 cdrom://[Debian GNU/Linux 10.4.0 _Buster_ — Official amd64 DVD Binary-1 20200509-10:26] buster Release
Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs
Err:3 http://deb.debian.org/debian buster InRelease
Cannot initiate the connection to prod.debian.map.fastly.net:80 (2a04:4e42:14::204). — connect (101: Network is unreachable)
Could not connect to prod.debian.map.fastly.net:80 (151.101.84.204), connection timed out
Cannot initiate the connection to deb.debian.org:80 (2a04:4e42:14::645). — connect (101: Network is unreachable)
Could not connect to deb.debian.org:80 (151.101.86.133), connection timed out
Err:4 http://deb.debian.org/debian buster-updates InRelease
Cannot initiate the connection to deb.debian.org:80 (2a04:4e42:14::645). — connect (101: Network is unreachable)
Err:5 http://security.debian.org/debian-security buster/updates InRelease
Cannot initiate the connection to prod.debian.map.fastly.net:80 (2a04:4e42:14::204). — connect (101: Network is unreachable)
Could not connect to prod.debian.map.fastly.net:80 (151.101.84.204), connection timed out
Cannot initiate the connection to security.debian.org:80 (2a04:4e42:c00::204). — connect (101: Network is unreachable)
Cannot initiate the connection to security.debian.org:80 (2a04:4e42:200::204). — connect (101: Network is unreachable)
Cannot initiate the connection to security.debian.org:80 (2a04:4e42:400::204). — connect (101: Network is unreachable)
Cannot initiate the connection to security.debian.org:80 (2a04:4e42:a00::204). — connect (101: Network is unreachable)
Cannot initiate the connection to security.debian.org:80 (2a04:4e42::204). — connect (101: Network is unreachable)
Cannot initiate the connection to security.debian.org:80 (2a04:4e42:800::204). — connect (101: Network is unreachable)
Cannot initiate the connection to security.debian.org:80 (2a04:4e42:600::204). — connect (101: Network is unreachable)
Cannot initiate the connection to security.debian.org:80 (2a04:4e42:e00::204). — connect (101: Network is unreachable)
Could not connect to security.debian.org:80 (151.101.0.204), connection timed out
Could not connect to security.debian.org:80 (151.101.128.204), connection timed out
Could not connect to security.debian.org:80 (151.101.192.204), connection timed out
Could not connect to security.debian.org:80 (151.101.64.204), connection timed out
Reading package lists… Done
E: The repository ‘cdrom://[Debian GNU/Linux 10.4.0 _Buster_ — Official amd64 DVD Binary-1 20200509-10:26] buster Release’ does not have a Release file.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Проверяю
souces.list
sudo vi /etc/apt/sources.list
#
deb cdrom:[Debian GNU/Linux 10.4.0 _Buster_ — Official amd64 DVD Binary-1 20200509-10:26]/ buster contrib main
deb cdrom:[Debian GNU/Linux 10.4.0 _Buster_ — Official amd64 DVD Binary-1 20200509-10:26]/ buster contrib main
deb http://deb.debian.org/linux/debian/ buster main
deb-src http://deb.debian.org/linux/debian/ buster main
deb http://security.debian.org/debian-security buster/updates main contrib
deb-src http://security.debian.org/debian-security buster/updates main contrib
# buster-updates, previously known as ‘volatile’
deb http://deb.debian.org/linux/debian/ buster-updates main contrib
deb-src http://deb.debian.org/linux/debian/ buster-updates main contrib
Restarting networking failed because the control process exited with error code.
При попытке перезапустить сеть
andrei@debian:/etc/network$ sudo /etc/init.d/networking restart
[….] Restarting networking (via systemctl): networking.serviceJob for networking.service failed because the control process exited with error code.
See «systemctl status networking.service» and «journalctl -xe» for details.
Оказалось, что при редактировании /etc/network/interfaces
перепутал в названии интерфейса wlp1s0 l
и
1 и написал вместо wlp1s0 wlpls0
Failed to start A high performance web server and a reverse proxy server
При попытке установить Nginx в Debian 10
sudo apt install nginx
Setting up libnginx-mod-http-upstream-fair (1.14.2-2+deb10u1) …
Setting up nginx-full (1.14.2-2+deb10u1) …
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 Thu 2020-06-18 17:30:41 EEST; 12ms ago
Docs: man:nginx(8)
Process: 7196 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 7198 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Feb 09 18:02:38 debian nginx[7198]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 09 18:02:38 debian nginx[7198]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Feb 09 18:02:38 debian nginx[7198]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 09 18:02:38 debian nginx[7198]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Feb 09 18:02:38 debian nginx[7198]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 09 18:02:38 debian nginx[7198]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Feb 09 18:02:38 debian nginx[7198]: nginx: [emerg] still could not bind()
Feb 09 18:02:38 debian systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Feb 09 18:02:38 debian systemd[1]: nginx.service: Failed with result ‘exit-code’.
Feb 09 18:02:38 debian 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+deb10u1.1~) | nginx-light (<< 1.14.2-2+deb10u1.1~) | nginx-extras (<< 1.14.2-2+deb10u1.1~); however:
Package nginx-full is not configured yet.
Package nginx-light is not installed.
Package nginx-extras is not installed.
nginx depends on nginx-full (>= 1.14.2-2+deb10u1) | nginx-light (>= 1.14.2-2+deb10u1) | nginx-extras (>= 1.14.2-2+deb10u1); however:
Package nginx-full is not configured yet.
Package nginx-light is not installed.
Package nginx-extras is not installed.
dpkg: error processing package nginx (—configure):
dependency problems — leaving unconfigured
Processing triggers for man-db (2.8.5-2) …
Processing triggers for systemd (241-7~deb10u4) …
Errors were encountered while processing:
nginx-full
nginx
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 Thu 2020-06-18 21:42:54 EEST; 5min ago
Docs: man:nginx(8)
Process: 15224 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 15225 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
sudo journalctl -xe
— Subject: A start job for unit nginx.service has begun execution
— Defined-By: systemd
— Support: https://www.debian.org/support
—
— A start job for unit nginx.service has begun execution.
—
— The job identifier is 2744.
Feb 09 18:02:38 debian nginx[15225]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 09 18:02:38 debian nginx[15225]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Feb 09 18:02:38 debian nginx[15225]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 09 18:02:38 debian nginx[15225]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Feb 09 18:02:38 debian nginx[15225]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 09 18:02:38 debian nginx[15225]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Feb 09 18:02:38 debian nginx[15225]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 09 18:02:38 debian nginx[15225]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Feb 09 18:02:38 debian nginx[15225]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Feb 09 18:02:38 debian nginx[15225]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Feb 09 18:02:38 debian nginx[15225]: nginx: [emerg] still could not bind()
Feb 09 18:02:38 debian systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
— Subject: Unit process exited
— Defined-By: systemd
— Support: https://www.debian.org/support
—
— An ExecStart= process belonging to unit nginx.service has exited.
—
— The process’ exit code is ‘exited’ and its exit status is 1.
Feb 09 18:02:38 debian systemd[1]: nginx.service: Failed with result ‘exit-code’.
— Subject: Unit failed
— Defined-By: systemd
— Support: https://www.debian.org/support
—
— The unit nginx.service has entered the ‘failed’ state with result ‘exit-code’.
Feb 09 18:02:38 debian systemd[1]: Failed to start A high performance web server and a reverse proxy server.
— Subject: A start job for unit nginx.service has failed
— Defined-By: systemd
— Support: https://www.debian.org/support
—
— A start job for unit nginx.service has finished with a failure.
—
— The job identifier is 2744 and the job result is failed.
Feb 09 18:02:38 debian sudo[8241]: pam_unix(sudo:session): session closed for user root
Feb 09 18:02:38 debian PackageKit[8233]: daemon quit
Feb 09 18:02:38 debian systemd[1]: packagekit.service: Main process exited, code=killed, status=15/TERM
— Subject: Unit process exited
— Defined-By: systemd
— Support: https://www.debian.org/support
—
— An ExecStart= process belonging to unit packagekit.service has exited.
—
— The process’ exit code is ‘killed’ and its exit status is 15.
Feb 09 18:02:38 debian systemd[1]: packagekit.service: Succeeded.
— Subject: Unit succeeded
— Defined-By: systemd
— Support: https://www.debian.org/support
—
— The unit packagekit.service has successfully entered the ‘dead’ state.
Feb 09 18:02:38 debian sudo[19594]: andrei : TTY=pts/0 ; PWD=/home/andrei ; USER=root ; COMMAND=/usr/bin/journalctl -xe
Feb 09 18:02:38 debian sudo[19594]: pam_unix(sudo:session): session opened for user root by andrei(uid=0)
Из логов можно сделать вывод, что порт 80, который нужен
Nginx
уже занят. Я так подозреваю, что Apache. Поэтому нужно удалить или отключить Apache и поставить Nginx
ifconfig command not found debian |
|
man: command not found |
|
adduser: command not found |
ifconfig command not found debian
Если ifconfig выдаёт ошибку
ifconfig command not found debian
можно либо воспользоваться командой
ip addresses
Либо установить ifconfig
-bash: man: command not found
Чтобы установить справочник man
sudo apt update
sudo apt-get install man-db
bash: adduser: command not found
Обычно для создания и редактирования пользователей нужно иметь довольно много прав.
Часто это делается под root.
Начиная с Debian 10 нас ждёт сюрприз от разработчиков. Если Вы стали root
по-старинке, выполнив su без агрументов Ваша системная переменная
PATH
скорее всего не содержит многих нужных директорий.
Всё потому, что теперь команда su идёт из другого package — util-linux вместо shadow
и не обновляет PATH по умолчанию.
Что делать?
Попробуйте
su — root
Ради интереса можете выполнить для обоих вариантов (su и su -root)
pwd
echo $USER
Подробности
здесь
user is not in the sudoers file
Означает, что пользователя user нужно добавить в группу sudo
Выполните
su —
usermod -a -G sudo user
usermod: command not found
Скорее всего эта ошибка появилась у вас в Debian 10 после выполнения su (
Подробности
)
Выполните
su —
Возможные ошибки при установке Java
Could not get lock /var/lib/dpkg/lock
root@debian:/# apt-get install default-jre
E: Could not get lock /var/lib/dpkg/lock
— open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory
(/var/lib/dpkg/), is another process using it?
Означает, что у Вас запущен ещё один менеджер пакетов,
например, Synaptic. Найдите его и закройте.
Unable to locate package default-jr
root@debian:/# apt-get install default-jre
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package default-jre
Означает, что найти default-jre не удалось. Проверьте
sources.list
nano /etc/apt/sources.list
Unsupported distributions
- I’m not using Ubuntu Trusty (14.04)
Repository mirroring
- I’m not trying to mirror the repositories using wget, curl, mozilla. If I am mirroring the packages.sury.org repository, I am properly using rsync to minimize the traffic.
Describe the bug
Nginx & Nginx mainline installation failed on Ubuntu 14.04 Xenial
Setting up nginx-extras (1.16.1-1+ubuntu16.04.1+deb.sury.org+3) ...
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 Sun 2020-01-19 21:14:53 WIB; 6ms ago
Docs: man:nginx(8)
Process: 12584 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Main PID: 14531 (code=exited, status=0/SUCCESS)
Jan 19 21:14:53 sepakad systemd[1]: Starting A high performance web server and a reverse proxy server...
Jan 19 21:14:53 sepakad nginx[12584]: nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
Jan 19 21:14:53 sepakad nginx[12584]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jan 19 21:14:53 sepakad systemd[1]: nginx.service: Control process exited, code=exited status=1
Jan 19 21:14:53 sepakad systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Jan 19 21:14:53 sepakad systemd[1]: nginx.service: Unit entered failed state.
Jan 19 21:14:53 sepakad systemd[1]: nginx.service: Failed with result 'exit-code'.
dpkg: error processing package nginx-extras (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of nginx:
nginx depends on nginx-full (<< 1.16.1-1+ubuntu16.04.1+deb.sury.org+3.1~) | nginx-light (<< 1.16.1-1+ubuntu16.04.1+deb.sury.org+3.1~) | nginx-extras (<< 1.16.1-1+ubuntu16.04.1+deb.sury.org+3.1~); however:
Package nginx-full is not installed.
Package nginx-light is not installed.
Package nginx-extras is not configured yet.
nginx depends on nginx-full (>= 1.16.1-1+ubuntu16.04.1+deb.sury.org+3) | nginx-light (>= 1.16.1-1+ubuntu16.04.1+deb.sury.org+3) | nginx-extras (>= 1.16.1-1+ubuntu16.04.1+deb.sury.org+3); however:
Package nginx-full is not installed.
Package nginx-light is not installed.
Package nginx-extras is not configured yet.
The journalctl logs said
# journalctl -xe
Jan 19 21:36:17 sepakad systemd[1]: Starting A high performance web server and a reverse proxy server...
-- Subject: Unit nginx.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit nginx.service has begun starting up.
Jan 19 21:36:17 sepakad nginx[22453]: nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
Jan 19 21:36:17 sepakad nginx[22453]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jan 19 21:36:17 sepakad systemd[1]: nginx.service: Control process exited, code=exited status=1
Jan 19 21:36:17 sepakad systemd[1]: Failed to start A high performance web server and a reverse proxy server.
-- Subject: Unit nginx.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit nginx.service has failed.
--
-- The result is failed.
Jan 19 21:36:17 sepakad systemd[1]: nginx.service: Unit entered failed state.
Jan 19 21:36:17 sepakad systemd[1]: nginx.service: Failed with result 'exit-code'.
My system information
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"
# uname -a
Linux sepakad 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
To Reproduce
Steps to reproduce the behavior:
- add-apt-repository ppa:ondrej/nginx && add-apt-repository ppa:ondrej/nginx-mainline
- apt-get update -y
- install nginx nginx-extras
- got the error after installation (dpks configure process)
Expected behavior
Nginx installed and configured correctly
Distribution (please complete the following information):
- OS: Ubuntu
- Architecture: amd64
- Repository: Ubuntu PPA
Package(s) (please complete the following information):
Output of apt-cache policy <package>
works best.
# apt-cache policy nginx nginx-extras
nginx:
Installed: (none)
Candidate: 1.16.1-1+ubuntu16.04.1+deb.sury.org+3
Version table:
1.16.1-1+ubuntu16.04.1+deb.sury.org+3 500
500 http://ppa.launchpad.net/ondrej/nginx/ubuntu xenial/main amd64 Packages
500 http://ppa.launchpad.net/ondrej/nginx/ubuntu xenial/main i386 Packages
1.10.3-0ubuntu0.16.04.5 500
500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages
500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
500 http://security.ubuntu.com/ubuntu xenial-security/main i386 Packages
1.9.15-0ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu xenial/main i386 Packages
nginx-extras:
Installed: (none)
Candidate: 1.16.1-1+ubuntu16.04.1+deb.sury.org+3
Version table:
1.16.1-1+ubuntu16.04.1+deb.sury.org+3 500
500 http://ppa.launchpad.net/ondrej/nginx/ubuntu xenial/main amd64 Packages
1.10.3-0ubuntu0.16.04.5 500
500 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages
500 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages
1.9.15-0ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
Additional context
It seems that the Nginx config files are missing
# ls -al /etc/nginx/
total 32
drwxr-xr-x 8 root root 4096 Jan 19 21:35 .
drwxr-xr-x 104 root root 4096 Jan 19 21:35 ..
drwxr-xr-x 2 root root 4096 Oct 9 03:55 conf.d
drwxr-xr-x 2 root root 4096 Oct 9 03:55 modules-available
drwxr-xr-x 2 root root 4096 Oct 9 03:55 modules-enabled
drwxr-xr-x 2 root root 4096 Jan 19 21:35 sites-available
drwxr-xr-x 2 root root 4096 Oct 9 03:55 sites-enabled
drwxr-xr-x 2 root root 4096 Jan 19 21:35 snippets
# ls -al /etc/nginx/modules-available/
total 8
drwxr-xr-x 2 root root 4096 Oct 9 03:55 .
drwxr-xr-x 8 root root 4096 Jan 19 21:35 ..
Repository used Nginx stable & mainline
# cat /etc/apt/sources.list.d/ondrej-ubuntu-nginx-xenial.list
deb http://ppa.launchpad.net/ondrej/nginx/ubuntu xenial main
#deb-src http://ppa.launchpad.net/ondrej/nginx/ubuntu xenial main
# cat /etc/apt/sources.list.d/ondrej-ubuntu-nginx-mainline-xenial.list
deb http://ppa.launchpad.net/ondrej/nginx-mainline/ubuntu xenial main
#deb-src http://ppa.launchpad.net/ondrej/nginx-mainline/ubuntu xenial main
what’s wrong with my install?
The cause of
If you install nginx in Ubuntu for the first time, there will be a need to uninstall and reinstall the new version of nginx. This is just the beginning of learning nginx.
The installation
Use Ubuntu’s package management tool apt to install nginx
$ sudo apt-get install nginx
Copy the code
uninstall
Also use apt to uninstall nginx
$ sudo apt-get remove nginx
Copy the code
Sudo apt-get autoremove sudo apt-get autoremove sudo apt-get autoremove
$ sudo apt-get autoremove
Copy the code
Delete the nginx configuration folder
$ sudo rm -rf /etc/nginx
Copy the code
Reinstall nginx
# update source
$ sudo apt update
$ sudo apt-get install nginx
Copy the code
The console reported an error:
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.
dpkg: error processing package nginx-core (--configure):
subprocess installed post-installation script returned error exitstatus 1 dpkg: dependency problems prevent configuration of nginx: Nginx depends on nginx - core ( = 1.10.3-0 ubuntu0. 16.04.2) | nginx - full ( = 1.10.3-0 ubuntu0. 16.04.2) | nginx ultra-light ( = 1.10.3-0 ubuntu0. 16.04.2) | nginx - extras ( = 1.10.3-0 ubuntu0. 16.04.2); however: Package nginx-core is not configured yet. Package nginx-full is not installed. Package nginx-light is not installed. Package nginx - extras is not installed. Nginx depends on nginx - core ( 1.10.3-0 ubuntu0. 16.04.2.1 ~) | nginx - full ( 1.10.3-0 ubuntu0. 16.04.2.1 ~) | nginx ultra-light ( 1.10.3-0 ubuntu0. 16.04.2.1 ~) | nginx - extras ( 1.10.3 0 ubuntu0. 16.04.2.1 ~); however: Package nginx-core is not configured yet. No apport report written because the error message indicates its a followup error from a previous failure. Package nginx-full is not installed. Package nginx-light is not installed. Package nginx-extras is not installed. dpkg: error processing package nginx (--configure): dependency problems - leaving unconfigured Processing triggersforLibc - bin (2.23-0 ubuntu9)... Errors were encounteredwhile processing:
nginx-core
nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)
Copy the code
Check the status of nginx.service
$ systemctl status nginx.service
Copy the code
● 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 Sat 2018-03-17 23:16:40 CST; 1min 18s ago
Process: 26795 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Main PID: 18259 (code=exited, status=0/SUCCESS)
Mar 17 23:16:40 VM-0-5-ubuntu systemd[1]: Starting A high performance web server and a reverse proxy server...
Mar 17 23:16:40 VM-0-5-ubuntu nginx[26795]: nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or direMar 17 23:16:40 VM-0-5-ubuntu nginx[26795]: nginx: configuration file /etc/nginx/nginx.conf test failed
Mar 17 23:16:40 VM-0-5-ubuntu systemd[1]: nginx.service: Control process exited, code=exited status=1
Mar 17 23:16:40 VM-0-5-ubuntu systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Mar 17 23:16:40 VM-0-5-ubuntu systemd[1]: nginx.service: Unit entered failed state.
Mar 17 23:16:40 VM-0-5-ubuntu systemd[1]: nginx.service: Failed with result 'exit-code'.
Copy the code
Look carefully at the misinformation and get two information points:
- Package nginx-core is not configured yet.
- Package nginx-full/nginx-light/nginx-extras is not installed.
So the Internet search, online search said that apache may occupy port 80 lead to error
Check the port usage
$ sudo netstat -nlp
Copy the code
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1287/ SSHD udp 0 0 0.0.0.0:68 0.0.0.0:* 891/dhclient udp 0 0 172.21.0.5:123 0.0.0.0:* 1231/ NTPD udp 0 0 127.0.0.1:123 0.0.0.0:* 1231/ NTPD udp 0 0 0.0.0.0:123 0.0.0.0:* 1231/ NTPD udp6 0 0: :123 ::* 1231/ntpdCopy the code
If the systemctl status nginx.service command output does not mention that port 80 is occupied, perform the following operations:
Stopping Apache
$ sudo service apache2 stop
Copy the code
Reinstall nginx
$ sudo apt-get install nginx
Copy the code
See the questions on Askubuntu for more information
Nginx configuration file does not exist when you uninstall and reinstall nginx. The nginx configuration file is not regenerated after the nginx is uninstalled.
Uninstalling Nginx does not save configuration files
$ sudo apt-get --purge remove nginx Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libjbig0 libjpeg-turbo8 libjpeg8 libtiff5 libvpx3 libxpm4 Libxslt1.1 nginx - common nginx core - Use'sudo apt autoremove'to remove them. The following packages will be REMOVED: nginx* 0 upgraded, 0 newly installed, 1 to remove and 205 not upgraded. 2 not fully installed or removed. After this operation, 37 kB Disk space will be freed. Do you want tocontinue? [Y/n] y (Reading database ... 66386 files and directories currently installed.) Removing nginx (1.10.3-0ubuntu0.16.04.2)... Setting up nginx-core (1.10.3-0ubuntu0.16.04.2)... Jobfor 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.
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)
Copy the code
Uninstall dependencies that are automatically installed and no longer needed
$ sudo apt-get autoremove Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libjbig0 libjpeg-turbo8 libjpeg8 libtiff5 libvpx3 libxpm4 Nginx-common nginx-Core 0 Upgrade, 0 newly installed, 13 to remove and 205 not upgraded. 1 not fully installed or removed. After this operation, 9,745 kB Disk space will be freed. Do you want tocontinue? [Y/n] y (Reading database ... 66383 files and directories currently installed.) Removing Nginx-core (1.10.3-0ubuntu0.16.04.2)... O libgd3: amd64 (2.1.1-4 ubuntu0 16.04.8)... O libfontconfig1: amd64 (2.11.94 ubuntu1 0. 1)... O fontconfig - config (2.11.94 ubuntu1 0. 1)... O fonts - dejavu - core (2.35 1)... O libtiff5: amd64 (ubuntu0 4.0.6-1. 2)... O libjbig0: amd64 (2.1 3.1)... Removing libjpeg8:amd64 (8c-2ubuntu8) ... O libjpeg - turbo8: amd64 (1.4.2 ubuntu3 0)... O libvpx3: amd64 (1.5.0-2 ubuntu1)... O libxpm4: amd64 (1:3. 5.11 1 ubuntu0. 16.04.1)... O libxslt1.1: amd64 (1.1.28 2.1 ubuntu0.1)... O nginx - common (1.10.3-0 ubuntu0. 16.04.2)... Processing triggersforLibc - bin (2.23-0 ubuntu9)... Processing triggersforMan - db (2.7.5-1)...Copy the code
Filter nginx-related installed packages
$ dpkg --get-selections | grep nginx
nginx-common deinstall
Copy the code
Uninstalling nginx-common does not preserve configuration files
$ sudo apt-get --purge remove nginx-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
nginx-common*
0 upgraded, 0 newly installed, 1 to remove and 205 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y (Reading database ... 66243 files and directories currently installed.) Removing Nginx-common (1.10.3-0ubuntu0.16.04.2)... Purging configuration filesforNginx - common (1.10.3-0 ubuntu0. 16.04.2)... dpkg: warning:while removing nginx-common, directory '/var/www/html' not empty so not removed
Copy the code
Reinstall nginx
$ sudo apt-get install nginx
...
Copy the code
View the version number and perform nginx configuration file syntax checking
$nginx -v version: nginx/1.10.3 (Ubuntu) $sudo nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conftest is successful
Copy the code
Although nginx has been reinstalled, there are a few puzzles along the way:
- Apt-get autoremove uninstall software according to what rules?
- Why didn’t Nginx-common uninstall in the first place?
1. What rules does apt-get autoremove uninstall software according to?
Apt-get autoremove: a software package that is automatically installed and is no longer needed
Here’s an example: When nginx is installed via apt-get, the required dependencies are automatically installed through boot (nginx-core), and when nginx is uninstalled, those dependencies are no longer needed (nginx-core). Apt-get autoRemove cleans them up automatically
Since packages that are no longer needed are automatically removed, why isn’t Nginx-common removed?
2. Why isn’t Nginx-common inapt-get autoremove
When to uninstall?
Sudo rm -rf /etc/nginx /etc/nginx /etc/nginx So what do these configuration folders have to do with the Nginx-common package?
By looking for Ubuntu Packages, I found the nginx-common package file listing under Ubuntu16.0.4.
According to the list of directories manually screen and found this machine in addition to manually delete the/etc/nginx directory does not exist, in the file list there is no other files to be deleted, speculation may be nginx — integrity, common package was damaged, result in autoremove not deleted, of course this is only my guess.
Follow-up questions:
After the following command is executed, the configuration file of ngnix is not deleted
$ sudo apt-get remove --purge nginx
Copy the code
Nginx depends on nginx-core, nginx-core depends on nginx-common, and the nginx configuration file is part of the nginx-common package configuration file.
Run the following command to verify the configuration
# uninstall nginx-common, nginx configuration files will not be deleted
$ sudo apt-get remove nginx-common
...
# uninstall nginx-common, nginx configuration files have been removed (including but not limited to)$sudo apt-get remove --purge nginx-common $find /etc/nginx/ find: '/etc/nginx/' : No such file or directoryCopy the code
To overturn previous guesses:
When apt-get autoremove is executed, the nginx-common package has been selected for deinstall, but has not been unloaded.
$ dpkg --get-selections| grep nginx
nginx-common deinstall
Copy the code
To learn more about Deinstall, click here, and if you know why, please feel free to comment.
Command summary
# Uninstall nginx completely
$ sudo apt-get remove --purge nginx
$ sudo apt-get autoremove --purge
Update nginx, save configuration files
Nginx. conf will not be deleted or overwritten, but backup is recommended to be safe
$ sudo apt-get remove nginx
$ sudo apt-get autoremove
$ sudo apt update
$ sudo apt-get install nginx
Install software packages
# sudo apt-get install
# eg:
$ sudo apt-get install nginx
Uninstalling software packages
# sudo apt-get remove
# eg:
$ sudo apt-get remove nginx
Uninstall the software package without retaining the configuration file
# sudo apt-get remove --purge package name
# eg:
$ sudo apt-get remove --purge nginx
Uninstall the automatically installed software package without retaining the configuration file
# sudo apt-get autoremove --purge
# list local packages
# DPKG -- get - selections [| grep screening keywords]
# eg :(list all packages locally)
$ dpkg --get-selections
# eg :(list local packages associated with ngnix)
$ dpkg --get-selections | grep nginx
# Check the process information
# ps - ef [| grep screening keywords]
# eg :(list all process information)
$ ps -ef
# eg :(listing process information related to nginx)
$ ps -ef | grep nginx
Check the port usage
$ sudo netstat -nlp
Copy the code
Summary of Reference links
Package nginx-core not configured yet.Sub-process :/user/bin/dpkg returned an error code(1)
Nginx fail to install on Ubuntu 15.10 Server
There is no workaround for regenerating configuration files after uninstalling Nginx on Ubuntu 14.04
A listing of nginx-common package files under the All hardware architecture in the Xenial distribution
What is the difference between the options «autoclean», «autoremove» and «clean»?
DPKG — get-Selections show packages marked «deinstall»
- Forum
- The Ubuntu Forum Community
- Ubuntu Specialised Support
- Ubuntu Servers, Cloud and Juju
- Server Platforms
- [ubuntu] Unable to install nginx Ubuntu 16.04
-
Unable to install nginx Ubuntu 16.04
Hello, I tried to install nginx on Ubuntu 16.04 server 32 bit but failed . Please advise.
Code:
apt list --installed |grep nginx WARNING: apt does not have a stable CLI interface. Use with caution in scripts. nginx-common/xenial-updates,xenial-security,now 1.10.0-0ubuntu0.16.04.2 all [installed,auto-removable] uma@ubuntu-i386:~$ sudo apt-get purge nginx Reading package lists... Done Building dependency tree Reading state information... Done Package 'nginx' is not installed, so not removed The following package was automatically installed and is no longer required: nginx-common Use 'sudo apt autoremove' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded. uma@ubuntu-i386:~$ sudo apt autoremove Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: nginx-common 0 upgraded, 0 newly installed, 1 to remove and 4 not upgraded. After this operation, 167 kB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 141539 files and directories currently installed.) Removing nginx-common (1.10.0-0ubuntu0.16.04.2) ... uma@ubuntu-i386:~$ apt list --installed |grep nginx WARNING: apt does not have a stable CLI interface. Use with caution in scripts. (reverse-i-search)`': apt list --installed |grep nginx^C uma@ubuntu-i386:~$ sudo apt-get update Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB] Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease Hit:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease Hit:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease Fetched 94.5 kB in 1s (55.4 kB/s) Reading package lists... Done (failed reverse-i-search)`grAD': apt list --installed |^Cep nginx (failed reverse-i-search)`GRADE': Partition: ID-1: / size: 87G used: 56^C(68%) fs: ext4 dev: /dev/sda12 uma@ubuntu-i386:~$ sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages have been kept back: linux-generic linux-headers-generic linux-image-generic ubuntu-core-launcher 0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded. uma@ubuntu-i386:~$ sudo apt-get update Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB] Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease Hit:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease Hit:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease Fetched 94.5 kB in 1s (65.8 kB/s) Reading package lists... Done uma@ubuntu-i386:~$ sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages have been kept back: linux-generic linux-headers-generic linux-image-generic ubuntu-core-launcher 0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded. uma@ubuntu-i386:~$ sudo apt-get -f E: Command line option 'f' [from -f] is not understood in combination with the other options. uma@ubuntu-i386:~$ sudo apt-get install -f Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded. uma@ubuntu-i386:~$ apt list --installed |grep nginx WARNING: apt does not have a stable CLI interface. Use with caution in scripts. uma@ubuntu-i386:~$ sudo apt-get purge 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 4 not upgraded. uma@ubuntu-i386:~$ sudo apt-get install nginx Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: nginx-common nginx-core Suggested packages: fcgiwrap nginx-doc The following NEW packages will be installed: nginx nginx-common nginx-core 0 upgraded, 3 newly installed, 0 to remove and 4 not upgraded. Need to get 0 B/499 kB of archives. After this operation, 1,512 kB of additional disk space will be used. Do you want to continue? [Y/n] y Selecting previously unselected package nginx-common. (Reading database ... 141521 files and directories currently installed.) Preparing to unpack .../nginx-common_1.10.0-0ubuntu0.16.04.2_all.deb ... Unpacking nginx-common (1.10.0-0ubuntu0.16.04.2) ... Selecting previously unselected package nginx-core. Preparing to unpack .../nginx-core_1.10.0-0ubuntu0.16.04.2_i386.deb ... Unpacking nginx-core (1.10.0-0ubuntu0.16.04.2) ... Selecting previously unselected package nginx. Preparing to unpack .../nginx_1.10.0-0ubuntu0.16.04.2_all.deb ... Unpacking nginx (1.10.0-0ubuntu0.16.04.2) ... Processing triggers for ureadahead (0.100.0-19) ... Processing triggers for ufw (0.35-0ubuntu2) ... Processing triggers for systemd (229-4ubuntu7) ... Setting up nginx-common (1.10.0-0ubuntu0.16.04.2) ... insserv: warning: script 'K01noip2' missing LSB tags and overrides insserv: warning: script 'noip2' missing LSB tags and overrides Setting up nginx-core (1.10.0-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. dpkg: error processing package nginx-core (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of nginx: nginx depends on nginx-core (>= 1.10.0-0ubuntu0.16.04.2) | nginx-full (>= 1.10.0-0ubuntu0.16.04.2) | nginx-light (>= 1.10.0-0ubuntu0.16.04.2) | nginx-extras (>= 1.10.0-0ubuntu0.16.04.2); however: Package nginx-core is not configured yet. Package nginx-full is not installed. Package nginx-light is not installed. Package nginx-extras is not installed. nginx depends on nginx-core (<< 1.10.0-0ubuntu0.16.04.2.1~) | nginx-full (<< 1.10.0-0ubuntu0.16.04.2.1~) | nginx-light (<< 1.10.0-0ubuntu0.16.04.2.1~) | nginx-extras (<< 1.10.0-0ubuntu0.16.04.2.1~); however: Package nginx-core is not configured yet. Package nginx-full is not installed. Package nginx-light is not installed. Package nginx-extras is not installed. dpkg: error processing package nginx (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. Errors were encountered while processing: nginx-core nginx E: Sub-process /usr/bin/dpkg returned an error code (1) uma@ubuntu-i386:~$
-
Re: Unable to install nginx Ubuntu 16.04
The error message tells you what the problem is:
Code:
dpkg: dependency problems prevent configuration of nginx: nginx depends on nginx-core (>= 1.10.0-0ubuntu0.16.04.2) | nginx-full (>= 1.10.0-0ubuntu0.16.04.2) | nginx-light (>= 1.10.0-0ubuntu0.16.04.2) | nginx-extras (>= 1.10.0-0ubuntu0.16.04.2); however: Package nginx-core is not configured yet. Package nginx-full is not installed. Package nginx-light is not installed. Package nginx-extras is not installed. nginx depends on nginx-core (<< 1.10.0-0ubuntu0.16.04.2.1~) | nginx-full (<< 1.10.0-0ubuntu0.16.04.2.1~) | nginx-light (<< 1.10.0-0ubuntu0.16.04.2.1~) | nginx-extras (<< 1.10.0-0ubuntu0.16.04.2.1~); however: Package nginx-core is not configured yet. Package nginx-full is not installed. Package nginx-light is not installed. Package nginx-extras is not installed.
you need to also install the following packages:
- nginx-full
- nginx-light
- nginx-extras
-
Re: Unable to install nginx Ubuntu 16.04
Thank you .I had tried installing the packages listed by you but it gave error. Even purging the packages also gave error. I used
Code:
sudo apt-get install package name sudo apt-get purge package name and also apt-get install -f
The packages on which I ran the install and purge commands are
- nginx-full
- nginx-light
- nginx-extras
- nginx
-
Re: Unable to install nginx Ubuntu 16.04
I’d suggest using:to see if there are any left over files after running:
Code:
sudo apt purge <package name>
Note: you no longer need to use apt-get in version 16.04+, a simple apt works the same way, even giving you a progress bar at the bottom of the screen.
-
Re: Unable to install nginx Ubuntu 16.04
THank you nginx is successfully installed. Even after installation I cannnot locate nginx. That is ok
Code:
ps -e |grep ngi 8387 ? 00:00:00 nginx 8388 ? 00:00:00 nginx root@ubuntu-i386:/home/uma# locate nginx root@ubuntu-i386:/home/uma#
I am migrating from Apache to nginx hence was following this tutorial https://www.digitalocean.com/communi…-an-ubuntu-vps
I wasnt able to find any specific tutorial for Ubuntu 16 too migrate from apache to nginx.
Last edited by deepakdeshp; August 27th, 2016 at 02:34 PM.
-
Re: Unable to install nginx Ubuntu 16.04
I went back to earlier snapshot of the VM on which ubuntu server is running which didnt have nginx. I tried all the commands byt ran into the same error.
Code:
apt purge nginx*Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'nginx-full-dbg' for glob 'nginx*' Note, selecting 'nginx-core' for glob 'nginx*' Note, selecting 'nginx-core-dbg' for glob 'nginx*' Note, selecting 'nginx-common' for glob 'nginx*' Note, selecting 'nginx-doc' for glob 'nginx*' Note, selecting 'nginx-full' for glob 'nginx*' Note, selecting 'nginx-extras' for glob 'nginx*' Note, selecting 'nginx-light-dbg' for glob 'nginx*' Note, selecting 'nginx-extras-dbg' for glob 'nginx*' Note, selecting 'nginx-light' for glob 'nginx*' Note, selecting 'nginx' for glob 'nginx*' Package 'nginx' is not installed, so not removed Package 'nginx-common' is not installed, so not removed Package 'nginx-core' is not installed, so not removed Package 'nginx-core-dbg' is not installed, so not removed Package 'nginx-doc' is not installed, so not removed Package 'nginx-extras' is not installed, so not removed Package 'nginx-extras-dbg' is not installed, so not removed Package 'nginx-full' is not installed, so not removed Package 'nginx-full-dbg' is not installed, so not removed Package 'nginx-light' is not installed, so not removed Package 'nginx-light-dbg' is not installed, so not removed The following packages were automatically installed and are no longer required: apt-xapian-index aptitude-common g++-4.8 libboost-iostreams1.54.0 libclamav6 libclass-accessor-perl libcolord1 libcolorhug1 libcwidget3 libept1.4.12 libgcrypt11-dev libgnutlsxx27 libgphoto2-port10 libgtop2-7 libilmbase6 libio-string-perl libisl10 libjasper1 libjs-codemirror libjs-jquery-cookie libjs-jquery-event-drag libjs-jquery-metadata libjs-jquery-mousewheel libjs-jquery-tablesorter libjs-jquery-ui libmagickcore5 libmagickcore5-extra libmagickwand5 libmemcached10 libopenexr6 libparse-debianchangelog-perl libsigc++-2.0-0c2a libstdc++-4.8-dev libsub-name-perl libv4l-0 libv4lconvert0 libvpx1 libxcb-util0 linux-headers-3.13.0-24 linux-headers-3.13.0-24-generic linux-image-3.13.0-24-generic linux-image-extra-3.13.0-24-generic php5-mcrypt python-xapian rlwrap ruby-hike ruby-journey ruby-mail ruby-mime-types ruby-polyglot ruby-rack-cache ruby-rack-ssl ruby-rack-test ruby-rack1.4 ruby-sprockets ruby-tilt ruby-treetop ruby-yajl Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded
Code:
root@ubuntu-i386:/home/uma# apt install nginxReading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: apt-xapian-index aptitude-common g++-4.8 libboost-iostreams1.54.0 libclamav6 libclass-accessor-perl libcolord1 libcolorhug1 libcwidget3 libept1.4.12 libgcrypt11-dev libgnutlsxx27 libgphoto2-port10 libgtop2-7 libilmbase6 libio-string-perl libisl10 libjasper1 libjs-codemirror libjs-jquery-cookie libjs-jquery-event-drag libjs-jquery-metadata libjs-jquery-mousewheel libjs-jquery-tablesorter libjs-jquery-ui libmagickcore5 libmagickcore5-extra libmagickwand5 libmemcached10 libopenexr6 libparse-debianchangelog-perl libsigc++-2.0-0c2a libstdc++-4.8-dev libsub-name-perl libv4l-0 libv4lconvert0 libvpx1 libxcb-util0 linux-headers-3.13.0-24 linux-headers-3.13.0-24-generic linux-image-3.13.0-24-generic linux-image-extra-3.13.0-24-generic php5-mcrypt python-xapian rlwrap ruby-hike ruby-journey ruby-mail ruby-mime-types ruby-polyglot ruby-rack-cache ruby-rack-ssl ruby-rack-test ruby-rack1.4 ruby-sprockets ruby-tilt ruby-treetop ruby-yajl Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: nginx-common nginx-core Suggested packages: fcgiwrap nginx-doc The following NEW packages will be installed: nginx nginx-common nginx-core 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/499 kB of archives. After this operation, 1,512 kB of additional disk space will be used. Do you want to continue? [Y/n] y Selecting previously unselected package nginx-common. (Reading database ... 176729 files and directories currently installed.) Preparing to unpack .../nginx-common_1.10.0-0ubuntu0.16.04.2_all.deb ... Unpacking nginx-common (1.10.0-0ubuntu0.16.04.2) ... Selecting previously unselected package nginx-core. Preparing to unpack .../nginx-core_1.10.0-0ubuntu0.16.04.2_i386.deb ... Unpacking nginx-core (1.10.0-0ubuntu0.16.04.2) ... Selecting previously unselected package nginx. Preparing to unpack .../nginx_1.10.0-0ubuntu0.16.04.2_all.deb ... Unpacking nginx (1.10.0-0ubuntu0.16.04.2) ... Processing triggers for ureadahead (0.100.0-19) ... Processing triggers for ufw (0.35-0ubuntu2) ... Processing triggers for systemd (229-4ubuntu7) ... Setting up nginx-common (1.10.0-0ubuntu0.16.04.2) ... insserv: warning: script 'K01noip2' missing LSB tags and overrides insserv: warning: script 'noip2' missing LSB tags and overrides Setting up nginx-core (1.10.0-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. dpkg: error processing package nginx-core (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of nginx: nginx depends on nginx-core (>= 1.10.0-0ubuntu0.16.04.2) | nginx-full (>= 1.10.0-0ubuntu0.16.04.2) | nginx-light (>= 1.10.0-0ubuntu0.16.04.2) | nginx-extras (>= 1.10.0-0ubuntu0.16.04.2); however: Package nginx-core is not configured yet. Package nginx-full is not installed. Package nginx-light is not installed. Package nginx-extras is not installed. nginx depends on nginx-core (<< 1.10.0-0ubuntu0.16.04.2.1~) | nginx-full (<< 1.10.0-0ubuntu0.16.04.2.1~) | nginx-light (<< 1.10.0-0ubuntu0.16.04.2.1~) | nginx-extras (<< 1.10.0-0ubuntu0.16.04.2.1~); however: Package nginx-core is not configured yet. Package nginx-full is not installed. Package nginx-light is not installed. Package nginx-extras is not installed. dpkg: error processing packagNo apport report written because the error message indicates its a followup error from a previous failure. e nginx (--configure): dependency problems - leaving unconfigured Processing triggers for systemd (229-4ubuntu7) ... Processing triggers for ureadahead (0.100.0-19) ... Processing triggers for ufw (0.35-0ubuntu2) ... Errors were encountered while processing: nginx-core nginx E: Sub-process /usr/bin/dpkg returned an error code (1) root@ubuntu-i386:/home/uma
-
Re: Unable to install nginx Ubuntu 16.04
I tried installing nginx on a server with the lamp stack already installed, and ran into the same problem as you.
I created a new server install in a vm, without installing anything extra, I installed nginx, with zero problems and it works as it should
-
Re: Unable to install nginx Ubuntu 16.04
Thank you for your reply. There must be a way to install nginx along with Apache. I have seen articles using apache and nginx together. I wanted to try this too.
https://www.howtoforge.com/tutorial/…-ubuntu-16-04/
Last edited by deepakdeshp; August 28th, 2016 at 08:38 PM.
-
Re: Unable to install nginx Ubuntu 16.04
Originally Posted by deepakdeshp
To install nginx make sure apache2 isn’t running, but it won’t do a lot of good as they won’t run at the same time if they are listening on the same port. If you plan on trying the tutorial you linked to, follow it from the start, and don’t skip any steps. I followed it on a vm, and after a bit of troubleshooting I got it to work. The big problem was extra directives in /etc/nginx/sites-available/default, this is a corrected version:
Code:
## # You should look at the following URL's in order to grasp a solid understanding # of Nginx configuration files in order to fully unleash the power of Nginx. # http://wiki.nginx.org/Pitfalls # http://wiki.nginx.org/QuickStart # http://wiki.nginx.org/Configuration # # Generally, you will want to move this file somewhere, and start with a clean # file but keep this around for reference. Or just disable in sites-enabled. # # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. ## # Default server configuration # server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; #add index.php to the list if you are using php index indes.html indes.htm index.nginx-debian.html index.php; location / { proxy_pass http://localhost:8000; include /etc/nginx/proxy_params; } } # SSL configuration # # listen 443 ssl default_server; # listen [::]:443 ssl default_server; # # Note: You should disable gzip for SSL traffic. # See: https://bugs.debian.org/773332 # # Read up on ssl_ciphers to ensure a secure configuration. # See: https://bugs.debian.org/765782 # # Self signed certs generated by the ssl-cert package # Don't use them in a production server! # # include snippets/snakeoil.conf; #server_name _; #location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. #try_files $uri $uri/ =404; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ .php$ { # include snippets/fastcgi-php.conf; # # # With php7.0-cgi alone: # fastcgi_pass 127.0.0.1:9000; # # With php7.0-fpm: # fastcgi_pass unix:/run/php/php7.0-fpm.sock; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /.ht { # deny all; #} #} # Virtual Host configuration for example.com # # You can move that to a different file under sites-available/ and symlink that # to sites-enabled/ to enable it. # #server { # listen 80; # listen [::]:80; # # server_name example.com; # # root /var/www/example.com; # index index.html; # # location / { # try_files $uri $uri/ =404; # } #}
Last edited by cariboo; August 29th, 2016 at 12:15 AM.