Не хочет обновляться Nginx

12
D
На сайте с 28.06.2008
Offline
1101
3190

Дебиан 9

apt-get update && apt-get install nginx -y

выдает..


..........................
Removing nginx-common (1.10.3-1+deb9u1) ...
(Reading database ... 50116 files and directories currently installed.)
Preparing to unpack .../nginx_1.14.0-1~stretch_amd64.deb ...
Unpacking nginx (1.14.0-1~stretch) over (1.10.3-1+deb9u1) ...
dpkg: error processing archive /var/cache/apt/archives/nginx_1.14.0-1~stretch_amd64.deb (--unpack):
trying to overwrite '/usr/sbin/nginx', which is also in package nginx-full 1.10.3-1+deb9u1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/nginx_1.14.0-1~stretch_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Чего ему не хватает?

Оптимизайка
На сайте с 11.03.2012
Offline
396
#1

Так говорит, что nginx-full уже установлен.

Вы удалите сначала, что установлено, apt-get remove nginx* --purge

а потом ставьте.

⭐ BotGuard (https://botguard.net) ⭐ — защита вашего сайта от вредоносных ботов, воровства контента, клонирования, спама и хакерских атак!
D
На сайте с 28.06.2008
Offline
1101
#2

А обновить нельзя без удаления? Чтоб даун тайм поменьше был...

Оптимизайка
На сайте с 11.03.2012
Offline
396
#3

Dram, обновить apt-get update && apt-get -y dist-upgrade && apt-get -y autoremove --purge && service nginx restart

D
На сайте с 28.06.2008
Offline
1101
#4

правильно я понимаю что папку /etc/nginx нужно забекапить, после обновления быстро ее перезаписать, опять рестарнтнуть и на этом все?

И еще вопрос - эта команда apt-get -y dist-upgrade не полезет обновлять пхп с 7,2 на 7,3 ?

Оптимизайка
На сайте с 11.03.2012
Offline
396
#5

Dram, эта команда обновит все пакеты в системе до текущей версии. Бэкапить не обязательно, оно спросит если что-то заменять захочет, нажать enter (по имолчанию N). php 7.3 в репах стабильных, debian нет, так что не должно обновить. Можете сначала сделать симуляцию обновления, при этом ничего не будет обновлено, но напечатает что обновилось бы: apt-get update && apt-get -s dist-upgrade

D
На сайте с 28.06.2008
Offline
1101
#6

Что-то не получается... :(

root@m ~ # apt-get update && apt-get -y dist-upgrade && apt-get -y autoremove --purge && service nginx restart
Ign:1 http://mirror.hetzner.de/debian/packages stretch InRelease
Hit:2 http://mirror.hetzner.de/debian/packages stretch-updates InRelease
Hit:3 http://mirror.hetzner.de/debian/packages stretch-backports InRelease
Hit:4 http://mirror.hetzner.de/debian/security stretch/updates InRelease
Hit:5 http://security.debian.org stretch/updates InRelease
Ign:6 http://deb.debian.org/debian stretch InRelease
Hit:7 http://mirror.hetzner.de/debian/packages stretch Release
Hit:8 http://deb.debian.org/debian stretch-updates InRelease
Hit:9 http://deb.debian.org/debian stretch Release
Hit:10 https://packages.sury.org/php stretch InRelease
Hit:11 http://nginx.org/packages/debian stretch InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libnginx-mod-http-dav-ext : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
libnginx-mod-http-echo : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
libnginx-mod-http-geoip : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
libnginx-mod-http-image-filter : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
libnginx-mod-http-subs-filter : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
libnginx-mod-http-upstream-fair : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
libnginx-mod-http-xslt-filter : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
libnginx-mod-mail : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
libnginx-mod-stream : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
nginx-full : Depends: libnginx-mod-http-auth-pam (= 1.10.3-1+deb9u1) but it is not installed
Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).


root@m ~ # apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
libnginx-mod-http-auth-pam nginx-common
Suggested packages:
fcgiwrap nginx-doc ssl-cert
The following NEW packages will be installed:
libnginx-mod-http-auth-pam nginx-common
0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
Need to get 190 kB of archives.
After this operation, 342 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://deb.debian.org/debian stretch/main amd64 nginx-common all 1.10.3-1+deb9u1 [104 kB]
Get:2 http://deb.debian.org/debian stretch/main amd64 libnginx-mod-http-auth-pam amd64 1.10.3-1+deb9u1 [85.8 kB]
Fetched 190 kB in 0s (4,913 kB/s)
Preconfiguring packages ...
Selecting previously unselected package nginx-common.
(Reading database ... 50116 files and directories currently installed.)
Preparing to unpack .../nginx-common_1.10.3-1+deb9u1_all.deb ...
Unpacking nginx-common (1.10.3-1+deb9u1) ...
Selecting previously unselected package libnginx-mod-http-auth-pam.
Preparing to unpack .../libnginx-mod-http-auth-pam_1.10.3-1+deb9u1_amd64.deb ...
Unpacking libnginx-mod-http-auth-pam (1.10.3-1+deb9u1) ...
Setting up nginx-common (1.10.3-1+deb9u1) ...
Processing triggers for systemd (232-25+deb9u4) ...
Setting up libnginx-mod-http-auth-pam (1.10.3-1+deb9u1) ...
Processing triggers for nginx-full (1.10.3-1+deb9u1) ...
Triggering nginx reload ...


root@m ~ # apt-get update && apt-get -y dist-upgrade && apt-get -y autoremove --purge && service nginx restart
Ign:1 http://mirror.hetzner.de/debian/packages stretch InRelease
Hit:2 http://mirror.hetzner.de/debian/packages stretch-updates InRelease
Hit:3 http://mirror.hetzner.de/debian/packages stretch-backports InRelease
Hit:4 http://mirror.hetzner.de/debian/security stretch/updates InRelease
Hit:5 http://mirror.hetzner.de/debian/packages stretch Release
Ign:6 http://deb.debian.org/debian stretch InRelease
Hit:7 http://security.debian.org stretch/updates InRelease
Hit:8 http://deb.debian.org/debian stretch-updates InRelease
Hit:9 http://deb.debian.org/debian stretch Release
Hit:10 https://packages.sury.org/php stretch InRelease
Hit:11 http://nginx.org/packages/debian stretch InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
nginx
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.


root@m ~ # nginx -v
nginx version: nginx/1.10.3
Оптимизайка
На сайте с 11.03.2012
Offline
396
#7

Попробуйте сначала сделать service nginx stop а потом apt --fix-broken install

и её выхлоп полный покажите

D
На сайте с 28.06.2008
Offline
1101
#8

Спасибо, решил последовать правилу - работает не лезь.... :))

D
На сайте с 28.06.2008
Offline
1101
#9

Решил все же попробовать обновить Nginx (пересобрать с модулем бротли) на тестовом впс.

Скачал стаб. версию nginx, openssl, brotli, сконфигурировал.

Все прошло нормально.

Выполнил

make

долго все собирало, закончилось так

-Wl,-z,relro -Wl,-z,now \
-shared
sed -e "s|%%PREFIX%%|/usr/share/nginx|" \
-e "s|%%PID_PATH%%|/run/nginx.pid|" \
-e "s|%%CONF_PATH%%|/etc/nginx/nginx.conf|" \
-e "s|%%ERROR_LOG_PATH%%|/var/log/nginx/error.log|" \
< man/nginx.8 > objs/nginx.8
make[1]: Leaving directory '/opt/nginx-1.14.0'

сделал

make install

закончилось все так

test -d '/usr/lib/nginx/modules' \
|| mkdir -p '/usr/lib/nginx/modules'
test ! -f '/usr/lib/nginx/modules/ngx_http_xslt_filter_module.so' \
|| mv '/usr/lib/nginx/modules/ngx_http_xslt_filter_module.so' \
'/usr/lib/nginx/modules/ngx_http_xslt_filter_module.so.old'
cp objs/ngx_http_xslt_filter_module.so '/usr/lib/nginx/modules/ngx_http_xslt_filter_module.so'
test ! -f '/usr/lib/nginx/modules/ngx_http_image_filter_module.so' \
|| mv '/usr/lib/nginx/modules/ngx_http_image_filter_module.so' \
'/usr/lib/nginx/modules/ngx_http_image_filter_module.so.old'
cp objs/ngx_http_image_filter_module.so '/usr/lib/nginx/modules/ngx_http_image_filter_module.so'
test ! -f '/usr/lib/nginx/modules/ngx_http_geoip_module.so' \
|| mv '/usr/lib/nginx/modules/ngx_http_geoip_module.so' \
'/usr/lib/nginx/modules/ngx_http_geoip_module.so.old'
cp objs/ngx_http_geoip_module.so '/usr/lib/nginx/modules/ngx_http_geoip_module.so'
test ! -f '/usr/lib/nginx/modules/ngx_mail_module.so' \
|| mv '/usr/lib/nginx/modules/ngx_mail_module.so' \
'/usr/lib/nginx/modules/ngx_mail_module.so.old'
cp objs/ngx_mail_module.so '/usr/lib/nginx/modules/ngx_mail_module.so'
test ! -f '/usr/lib/nginx/modules/ngx_stream_module.so' \
|| mv '/usr/lib/nginx/modules/ngx_stream_module.so' \
'/usr/lib/nginx/modules/ngx_stream_module.so.old'
cp objs/ngx_stream_module.so '/usr/lib/nginx/modules/ngx_stream_module.so'
make[1]: Leaving directory '/opt/nginx-1.14.0'

далее service nginx restart и проверяю

nginx -V
nginx version: nginx/1.10.3

И вот не могу понять почему не обновилось?

---------- Добавлено 02.09.2018 в 11:49 ----------

Оптимизайка:
Попробуйте сначала сделать service nginx stop а потом apt --fix-broken install
и её выхлоп полный покажите

service nginx stop

root@Debian-93-stretch-64-minimal /opt/nginx-1.14.0 # apt --fix-broken install

Reading package lists... Done

Building dependency tree

Reading state information... Done

0 upgraded, 0 newly installed, 0 to remove and 122 not upgraded.

Оптимизайка
На сайте с 11.03.2012
Offline
396
#10

Так у вас два nginx разных версий в системе получилось в итоге. Что which nginx говорит?

12

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий