AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 497363
Accepted
Ricardo Cavalheiro
Ricardo Cavalheiro
Asked: 2019-01-29 22:55:10 +0800 CST2019-01-29 22:55:10 +0800 CST 2019-01-29 22:55:10 +0800 CST

dpkg-preconfigure 在安装任何软件包时抛出语法和未找到错误

  • 772

我有一个 Debian Stretch 9.3 映像,其中包含经过修改的 rootfs(不是我自己),其软件包比平时少,以防止占用空间增加,即图形环境。

我试图弄清楚是什么阻止了新软件包的安装。

这是一个示例输出:

root@var-som-mx7:~# apt-get install curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  ca-certificates libcurl3 libidn2-0 libnghttp2-14 libpsl5 librtmp1
  libunistring0 openssl publicsuffix
The following NEW packages will be installed:
  ca-certificates curl libcurl3 libidn2-0 libnghttp2-14 libpsl5 librtmp1
  libunistring0 openssl publicsuffix
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,956 kB of archives.
After this operation, 4,052 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://ftp.ch.debian.org/debian stretch/main armhf openssl armhf 1.1.0f-3+deb9u2 [703 kB]
Get:2 http://ftp.ch.debian.org/debian stretch/main armhf ca-certificates all 20161130+nmu1+deb9u1 [182 kB]
Get:3 http://ftp.ch.debian.org/debian stretch/main armhf libunistring0 armhf 0.9.6+really0.9.3-0.1 [255 kB]
Get:4 http://ftp.ch.debian.org/debian stretch/main armhf libidn2-0 armhf 0.16-1+deb9u1 [58.8 kB]
Get:5 http://ftp.ch.debian.org/debian stretch/main armhf libnghttp2-14 armhf 1.18.1-1 [69.1 kB]
Get:6 http://ftp.ch.debian.org/debian stretch/main armhf libpsl5 armhf 0.17.0-3 [40.7 kB]
Get:7 http://ftp.ch.debian.org/debian stretch/main armhf librtmp1 armhf 2.4+20151223.gitfa8646d.1-1+b1 [55.1 kB]
Get:8 http://ftp.ch.debian.org/debian stretch/main armhf libcurl3 armhf 7.52.1-5+deb9u8 [264 kB]
Get:9 http://ftp.ch.debian.org/debian stretch/main armhf curl armhf 7.52.1-5+deb9u8 [223 kB]
Get:10 http://ftp.ch.debian.org/debian stretch/main armhf publicsuffix all 20181003.1334-0+deb9u1 [104 kB]
Fetched 1,956 kB in 1min 2s (31.2 kB/s)
/usr/sbin/dpkg-preconfigure: 6: /usr/sbin/dpkg-preconfigure: BEGIN: not found
/usr/sbin/dpkg-preconfigure: 1: eval: qq{: not found
/usr/sbin/dpkg-preconfigure: 8: /usr/sbin/dpkg-preconfigure: use: not found
/usr/sbin/dpkg-preconfigure: 9: /usr/sbin/dpkg-preconfigure: use: not found
/usr/sbin/dpkg-preconfigure: 10: /usr/sbin/dpkg-preconfigure: Syntax error: "(" unexpected
Selecting previously unselected package openssl.
(Reading database ... 18795 files and directories currently installed.)
Preparing to unpack .../0-openssl_1.1.0f-3+deb9u2_armhf.deb ...
Unpacking openssl (1.1.0f-3+deb9u2) ...
Selecting previously unselected package ca-certificates.
Preparing to unpack .../1-ca-certificates_20161130+nmu1+deb9u1_all.deb ...
Unpacking ca-certificates (20161130+nmu1+deb9u1) ...
Selecting previously unselected package libunistring0:armhf.
Preparing to unpack .../2-libunistring0_0.9.6+really0.9.3-0.1_armhf.deb ...
Unpacking libunistring0:armhf (0.9.6+really0.9.3-0.1) ...
Selecting previously unselected package libidn2-0:armhf.
Preparing to unpack .../3-libidn2-0_0.16-1+deb9u1_armhf.deb ...
Unpacking libidn2-0:armhf (0.16-1+deb9u1) ...
Selecting previously unselected package libnghttp2-14:armhf.
Preparing to unpack .../4-libnghttp2-14_1.18.1-1_armhf.deb ...
Unpacking libnghttp2-14:armhf (1.18.1-1) ...
Selecting previously unselected package libpsl5:armhf.
Preparing to unpack .../5-libpsl5_0.17.0-3_armhf.deb ...
Unpacking libpsl5:armhf (0.17.0-3) ...
Selecting previously unselected package librtmp1:armhf.
Preparing to unpack .../6-librtmp1_2.4+20151223.gitfa8646d.1-1+b1_armhf.deb ...
Unpacking librtmp1:armhf (2.4+20151223.gitfa8646d.1-1+b1) ...
Selecting previously unselected package libcurl3:armhf.
Preparing to unpack .../7-libcurl3_7.52.1-5+deb9u8_armhf.deb ...
Unpacking libcurl3:armhf (7.52.1-5+deb9u8) ...
Selecting previously unselected package curl.
Preparing to unpack .../8-curl_7.52.1-5+deb9u8_armhf.deb ...
Unpacking curl (7.52.1-5+deb9u8) ...
Selecting previously unselected package publicsuffix.
Preparing to unpack .../9-publicsuffix_20181003.1334-0+deb9u1_all.deb ...
Unpacking publicsuffix (20181003.1334-0+deb9u1) ...
Setting up libnghttp2-14:armhf (1.18.1-1) ...
Setting up librtmp1:armhf (2.4+20151223.gitfa8646d.1-1+b1) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Setting up publicsuffix (20181003.1334-0+deb9u1) ...
Setting up libunistring0:armhf (0.9.6+really0.9.3-0.1) ...
Setting up openssl (1.1.0f-3+deb9u2) ...
Setting up ca-certificates (20161130+nmu1+deb9u1) ...
/usr/share/debconf/frontend: 5: /usr/share/debconf/frontend: use: not found
/usr/share/debconf/frontend: 6: /usr/share/debconf/frontend: use: not found
/usr/share/debconf/frontend: 7: /usr/share/debconf/frontend: use: not found
/usr/share/debconf/frontend: 8: /usr/share/debconf/frontend: Syntax error: "(" unexpected
dpkg: error processing package ca-certificates (--configure):
 subprocess installed post-installation script returned error exit status 2
Setting up libidn2-0:armhf (0.16-1+deb9u1) ...
Setting up libpsl5:armhf (0.17.0-3) ...
Setting up libcurl3:armhf (7.52.1-5+deb9u8) ...
Setting up curl (7.52.1-5+deb9u8) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Errors were encountered while processing:
 ca-certificates
E: Sub-process /usr/bin/dpkg returned an error code (1)

无论我尝试安装什么软件包BEGIN: not found, 都会出现错误。Syntax error: "(" unexpected

我尝试将输出systemd-analyze blame与systemd-analyze critical-chain工作图像进行比较,但到目前为止我没有发现任何奇怪的东西。

debian linux-kernel
  • 3 3 个回答
  • 922 Views

3 个回答

  • Voted
  1. JdeBP
    2019-01-29T23:08:57+08:002019-01-29T23:08:57+08:00

    你已经/usr/bin/perl以某种方式破坏了你的系统。它来自标记为“必需”的 perl-base 包。这些工具故意使删除“基本”包变得更加困难。如果有人仍然像你所说的那样,因为它是“图形”而竭尽全力删除那个“基本”包,你可以向 xem 解释这就是为什么这样做是错误的。

    • 3
  2. Giacomo Catenazzi
    2019-01-30T00:56:01+08:002019-01-30T00:56:01+08:00

    您的设置有问题。所以很难解决这个问题。

    您可能希望使用实时发行版(与发行版相同的版本和架构 [和位])并从那里启动。您可能需要将一些文件复制到您的文件系统(因此您必须找到相同的发行版)。

    或者,您可以放入第三行/usr/sbin/dpkg-preconfigure

    exit 0;
    

    这将停止预配置(这是允许的,例如,如果 perl 有问题,请参阅下一个块)。

    对于这种情况,我建议直接使用dpkg而不是apt(以及其他更高级别的接口)。转到/var/cache/apt/archives/(您将看到最近下载的软件包。

    第一件事:尝试dpkg --configure --pending。

    尝试重新安装必要的软件包(您可以通过 获取列表aptitude search ~E,请参阅使用 apt 查找所有“必要”软件包)。重试第 1 步。如果一切正常,请删除exit 0;.

    尝试安装正确的(你可以尝试使用 perl,如果最近有一个或其他一些基本和必要的包(你可以查看 packages.debian.org 站点)。这并不容易,没有硬性规定。或者你可以试试dpkg dpkg -BOGiE *那个目录(但是你的包很少,而且我没有看到确凿的证据,所以我认为最重要的部分是最重要的一点)

    注意:服务器通常没有图形界面。我总是为我的服务器安装没有 X 的 Debian(并且通常以简化的方式)。因此,您应该能够做到这一点,而无需删除文件或删除基本软件包。如果你想找到最小值,你必须有两个系统,并尝试在一个中删除包。EV。您再次添加它们。

    • 1
  3. Best Answer
    Ricardo Cavalheiro
    2019-01-30T04:55:43+08:002019-01-30T04:55:43+08:00

    感谢您的回答,它帮助我更深入地了解它。

    通过尝试执行 perl 和 bash 脚本,我得到了一个错误:

    cannot execute binary file: Exec format error
    

    尽管如此,文件检查确认了正确的架构。

    我进入内核配置文件,注意到用户空间二进制格式下的一些行被注释掉了。我最好的猜测是取消注释它,很高兴它起作用了。这是当前的工作配置文件:

    Userspace binary formats
    CONFIG_BINFMT_ELF=y
    CONFIG_ELFCORE=y
    CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
    CONFIG_BINFMT_SCRIPT=y
    # CONFIG_BINFMT_FLAT is not set
    # CONFIG_HAVE_AOUT is not set
    CONFIG_BINFMT_MISC=y
    CONFIG_COREDUMP=y
    
    • 0

相关问题

  • GRUB 配置以识别同一 Linux 发行版的不同桌面环境(安装)

  • astyle 不会更改源文件格式

  • 接收有关全新 Debian 的电子邮件

  • Debian Stretch:libgs_plugin_systemd-updates.so 中的 gnome-software 段错误

  • 如何在拼音输入法中输入ü?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve