在 ubuntu 上安装 Dokku 抛出错误

在 ubuntu 上安装 Dokku 抛出错误

我在 Ubuntu 服务器上安装 Dokku 时遇到了很多麻烦。我觉得我几乎尝试了所有方法。我在 Ubuntu 18.04.2 上,我正在尝试安装最新的 Dokku 版本 (0.15.5)。这是尝试安装软件时的 TRACE 日志。Dpkg 一直抛出错误,我不知道如何检查它是什么错误。

以下是日志:

root@viggo-server:/# TRACE=1 apt-get install -f --reinstall dokku
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  dokku
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
23 not fully installed or removed.
Need to get 0 B/38.7 MB of archives.
After this operation, 0 B of additional disk space will be used.
Preconfiguring packages ...
+ [[ -e /usr/share/debconf/confmodule ]]
+ . /usr/share/debconf/confmodule
++ '[' '!' 1 ']'
++ '[' -z '' ']'
++ exec
++ '[' '' ']'
++ exec
++ DEBCONF_REDIR=1
++ export DEBCONF_REDIR
+ readonly ACTION=configure
+ ACTION=configure
+ readonly VERSION=dev
+ VERSION=dev
+ db_input high dokku/web_config
+ _db_cmd 'INPUT high' dokku/web_config
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'INPUT high dokku/web_config'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET='30 question skipped'
+ case ${_db_internal_line%%[   ]*} in
+ return 30
+ true
+ db_go
+ _db_cmd 'GO '
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'GO '
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET=ok
+ case ${_db_internal_line%%[   ]*} in
+ return 0
+ db_get dokku/web_config
+ _db_cmd 'GET dokku/web_config'
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'GET dokku/web_config'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET=false
+ case ${_db_internal_line%%[   ]*} in
+ return 0
+ '[' false = true ']'
+ db_input high dokku/nginx_enable
+ _db_cmd 'INPUT high' dokku/nginx_enable
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'INPUT high dokku/nginx_enable'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET='30 question skipped'
+ case ${_db_internal_line%%[   ]*} in
+ return 30
+ true
+ db_input high dokku/hostname
+ _db_cmd 'INPUT high' dokku/hostname
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'INPUT high dokku/hostname'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET='30 question skipped'
+ case ${_db_internal_line%%[   ]*} in
+ return 30
+ true
+ db_input high dokku/vhost_enable
+ _db_cmd 'INPUT high' dokku/vhost_enable
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'INPUT high dokku/vhost_enable'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET='30 question skipped'
+ case ${_db_internal_line%%[   ]*} in
+ return 30
+ true
+ '[' configure '!=' reconfigure ']'
+ db_input high dokku/key_file
+ _db_cmd 'INPUT high' dokku/key_file
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'INPUT high dokku/key_file'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET='question will be asked'
+ case ${_db_internal_line%%[   ]*} in
+ return 0
+ db_go
+ _db_cmd 'GO '
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'GO '
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET=ok
+ case ${_db_internal_line%%[   ]*} in
+ return 0
(Reading database ... 120732 files and directories currently installed.)
Preparing to unpack .../dokku_0.15.5_amd64.deb ...
+ [[ -e /usr/share/debconf/confmodule ]]
+ . /usr/share/debconf/confmodule
++ '[' '!' '' ']'
++ PERL_DL_NONLAZY=1
++ export PERL_DL_NONLAZY
++ '[' '' ']'
++ exec /usr/share/debconf/frontend /var/lib/dpkg/tmp.ci/preinst install
+ [[ -e /usr/share/debconf/confmodule ]]
+ . /usr/share/debconf/confmodule
++ '[' '!' 1 ']'
++ '[' -z '' ']'
++ exec
++ '[' '' ']'
++ exec
++ DEBCONF_REDIR=1
++ export DEBCONF_REDIR
+ readonly ACTION=configure
+ ACTION=configure
+ readonly VERSION=dev
+ VERSION=dev
+ db_input high dokku/web_config
+ _db_cmd 'INPUT high' dokku/web_config
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'INPUT high dokku/web_config'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET='30 question skipped'
+ case ${_db_internal_line%%[   ]*} in
+ return 30
+ true
+ db_go
+ _db_cmd 'GO '
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'GO '
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET=ok
+ case ${_db_internal_line%%[   ]*} in
+ return 0
+ db_get dokku/web_config
+ _db_cmd 'GET dokku/web_config'
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'GET dokku/web_config'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET=false
+ case ${_db_internal_line%%[   ]*} in
+ return 0
+ '[' false = true ']'
+ db_input high dokku/nginx_enable
+ _db_cmd 'INPUT high' dokku/nginx_enable
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'INPUT high dokku/nginx_enable'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET='30 question skipped'
+ case ${_db_internal_line%%[   ]*} in
+ return 30
+ true
+ db_input high dokku/hostname
+ _db_cmd 'INPUT high' dokku/hostname
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'INPUT high dokku/hostname'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET='30 question skipped'
+ case ${_db_internal_line%%[   ]*} in
+ return 30
+ true
+ db_input high dokku/vhost_enable
+ _db_cmd 'INPUT high' dokku/vhost_enable
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'INPUT high dokku/vhost_enable'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET='30 question skipped'
+ case ${_db_internal_line%%[   ]*} in
+ return 30
+ true
+ '[' configure '!=' reconfigure ']'
+ db_input high dokku/key_file
+ _db_cmd 'INPUT high' dokku/key_file
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'INPUT high dokku/key_file'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET='30 question skipped'
+ case ${_db_internal_line%%[   ]*} in
+ return 30
+ true
+ db_go
+ _db_cmd 'GO '
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'GO '
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET=ok
+ case ${_db_internal_line%%[   ]*} in
+ return 0
+ [[ -e /usr/share/debconf/confmodule ]]
+ . /usr/share/debconf/confmodule
++ '[' '!' 1 ']'
++ '[' -z '' ']'
++ exec
++ '[' '' ']'
++ exec
++ DEBCONF_REDIR=1
++ export DEBCONF_REDIR
+ case "$1" in
+ db_get dokku/web_config
+ _db_cmd 'GET dokku/web_config'
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'GET dokku/web_config'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET=false
+ case ${_db_internal_line%%[   ]*} in
+ return 0
+ '[' false = true ']'
+ db_get dokku/skip_key_file
+ _db_cmd 'GET dokku/skip_key_file'
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'GET dokku/skip_key_file'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET=false
+ case ${_db_internal_line%%[   ]*} in
+ return 0
+ '[' -z '' ']'
+ '[' false '!=' true ']'
+ db_get dokku/key_file
+ _db_cmd 'GET dokku/key_file'
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'GET dokku/key_file'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET=/root/.ssh/id_rsa.pub
+ case ${_db_internal_line%%[   ]*} in
+ return 0
+ '[' '!' -f /root/.ssh/id_rsa.pub ']'
+ echo 'Error: keyfile '\''/root/.ssh/id_rsa.pub'\'' not found.'
Error: keyfile '/root/.ssh/id_rsa.pub' not found.
+ echo '       you can enter a new keyfile path when you restart the installation.'
       you can enter a new keyfile path when you restart the installation.
+ db_reset dokku/key_file
+ _db_cmd 'RESET dokku/key_file'
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'RESET dokku/key_file'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET=0
+ case ${_db_internal_line%%[   ]*} in
+ return 0
+ exit 1
dpkg: error processing archive /var/cache/apt/archives/dokku_0.15.5_amd64.deb (--unpack):
 new dokku package pre-installation script subprocess returned error exit status 1
+ [[ -e /usr/share/debconf/confmodule ]]
+ . /usr/share/debconf/confmodule
++ '[' '!' '' ']'
++ PERL_DL_NONLAZY=1
++ export PERL_DL_NONLAZY
++ '[' '' ']'
++ exec /usr/share/debconf/frontend /var/lib/dpkg/tmp.ci/postrm abort-install
+ [[ -e /usr/share/debconf/confmodule ]]
+ . /usr/share/debconf/confmodule
++ '[' '!' 1 ']'
++ '[' -z '' ']'
++ exec
++ '[' '' ']'
++ exec
++ DEBCONF_REDIR=1
++ export DEBCONF_REDIR
+ readonly DOKKU_ROOT=/home/dokku
+ DOKKU_ROOT=/home/dokku
+ readonly DOKKU_LIB_ROOT=/var/lib/dokku
+ DOKKU_LIB_ROOT=/var/lib/dokku
+ readonly DOKKU_LOGS_DIR=/var/log/dokku
+ DOKKU_LOGS_DIR=/var/log/dokku
+ main abort-install
+ [[ -f /etc/systemd/system/dokku-installer.service ]]
+ [[ -f /etc/init/dokku-installer.conf ]]
+ rm -f /etc/init/dokku-installer.conf
+ rm -f /etc/init/dokku-redeploy.conf
+ rm -f /etc/systemd/system/dokku-installer.service
+ rm -f /etc/systemd/system/dokku-redeploy.service
+ rm -f /etc/update-motd.d/99-dokku
+ db_get dokku/nginx_enable
+ _db_cmd 'GET dokku/nginx_enable'
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'GET dokku/nginx_enable'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET=true
+ case ${_db_internal_line%%[   ]*} in
+ return 0
+ '[' true = true ']'
+ nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
+ service nginx reload
nginx.service is not active, cannot reload.
+ true
+ [[ abort-install == \p\u\r\g\e ]]
Errors were encountered while processing:
 /var/cache/apt/archives/dokku_0.15.5_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我希望你能帮助我,我陷入困境。谢谢!

答案1

不幸的是,这些解决方案都不起作用。不过,我最终还是解决了这个问题,通过清除我的 apt 偏好设置,如下所建议:https://github.com/dokku/dokku/issues/1710

所以从某种意义上来说你帮助了我,谢谢你,何塞。

答案2

似乎您以某种方式禁用了 Nginx。您需要启用它才能继续正确安装。我认为正确的命令是:

service nginx enable

答案3

如果您在粘贴的输出中搜索单词“Error”,您将看到以下几行:

+ echo 'Error: keyfile '\''/root/.ssh/id_rsa.pub'\'' not found.'
Error: keyfile '/root/.ssh/id_rsa.pub' not found.
+ echo '       you can enter a new keyfile path when you restart the installation.'
       you can enter a new keyfile path when you restart the installation.

如果你看看 DokkuDebian/Ubuntu 安装说明,您将看到它需要用户拥有 SSH 密钥root。您没有。

以 root 用户身份运行ssh-keygen以生成 SSH 密钥对,然后尝试再次安装。或者,如果您有想要使用的现有 SSH 密钥,请按照上面链接的说明进行操作。

相关内容