склонный - добираются, установка + удаляют + обновление + обновление через задание крона

То независимо от того, что я пробую, кажется, что ничто не работает для выполнения склонный - заставляют команду удалять пакет (nginx, в этом случае) затем устанавливают пакет (nginx-отдельно-оплачиваемые-предметы) с несколькими обновлениями и заканчиваются с обновлением.

Я знаю, что люди скажут, что "это опасно", но это мои серверы, я пытаюсь выполнить это через многие мои собственные серверы то же время. Почему не будет работать?

Не будет работать, ничто не обнаруживается в системном журнале (но задание крона стреляет правильно).

И уже попробованный добавляют --force-yes но не помогает...

Ниже команд находятся в файле как "мой-сценарий-оболочки", который это каждый час называло в корне crontab:

DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" remove nginx
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" update
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" add-apt-repository ppa:nginx/development
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" update
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install nginx-extras
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" update
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade

ОБНОВЛЕНИЕ: не уверенный, но я думаю, что нашел корректный журнал crontab после канала к системному журналу:

Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be REMOVED:
  nginx
0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded.
After this operation, 35.8 kB disk space will be freed.
dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
dpkg: error: 2 expected programs not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Hit:4 http://ppa.launchpad.net/nginx/development/ubuntu xenial InRelease
Get:5 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Fetched 306 kB in 1s (255 kB/s)
Reading package lists...
E: Command line option --yes is not understood in combination with the other options
Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:3 http://ppa.launchpad.net/nginx/development/ubuntu xenial InRelease
Get:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Fetched 306 kB in 1s (200 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libhiredis0.13 libluajit-5.1-2 libluajit-5.1-common
  libnginx-mod-http-cache-purge libnginx-mod-http-fancyindex
  libnginx-mod-http-headers-more-filter libnginx-mod-http-lua
  libnginx-mod-http-ndk libnginx-mod-http-perl
  libnginx-mod-http-uploadprogress libnginx-mod-nchan
Suggested packages:
  nginx-doc
The following packages will be REMOVED:
  nginx-full
The following NEW packages will be installed:
  libhiredis0.13 libluajit-5.1-2 libluajit-5.1-common
  libnginx-mod-http-cache-purge libnginx-mod-http-fancyindex
  libnginx-mod-http-headers-more-filter libnginx-mod-http-lua
  libnginx-mod-http-ndk libnginx-mod-http-perl
  libnginx-mod-http-uploadprogress libnginx-mod-nchan nginx-extras
0 upgraded, 12 newly installed, 1 to remove and 3 not upgraded.
Need to get 0 B/1,228 kB of archives.
After this operation, 2,141 kB of additional disk space will be used.
dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
dpkg: error: 2 expected programs not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
Hit:1 http://ppa.launchpad.net/nginx/development/ubuntu xenial InRelease
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Fetched 306 kB in 1s (267 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following packages have been kept back:
  linux-generic linux-headers-generic linux-image-generic
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
0
задан 21 July 2017 в 04:41

1 ответ

Благодаря @steeldriver для указания в правильном направлении. Мой сценарий, просто необходимый PATH определенный на каждой команде, не только upgrade команда (был только на последней строке первоначально).

Это теперь подтверждено, работая автоматически и yah почти каждая проблема, которую я имел с заданиями крона, из-за путей или относительных путей.Спасибо!

DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" remove nginx
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" update
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" add-apt-repository ppa:nginx/development
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" update
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install nginx-extras
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" update
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' /usr/bin/apt-get -q --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
0
ответ дан 2 November 2019 в 21:42

Другие вопросы по тегам:

Похожие вопросы: