- 已关闭。**此问题为not about programming or software development。当前不接受答案。
此问题似乎与a specific programming problem, a software algorithm, or software tools primarily used by programmers无关。如果您认为此问题与another Stack Exchange site的主题有关,您可以留下评论,说明在何处可以回答此问题。
7天前关闭。
Improve this question
一定有什么东西紊乱了,而且和dpkg有关。不知道是什么引起的。以下是症状:
命令sudo apt upgrade
、sudo apt install <any package>
、sudo apt remove <any package>
和sudo apt install -f
均失败,并显示以下错误:
Setting up dpkg (1.21.1ubuntu2.1) ...
head: error reading 'info.bak': Is a directory
dpkg: error processing package dpkg (--configure):
installed dpkg package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
dpkg
sudo apt update
运行正常。
下面是sudo dpkg --configure -a
的输出,尽管我不知道如何从技术上理解它的含义:
Setting up dpkg (1.21.1ubuntu2.1) ...
head: error reading 'info.bak': Is a directory
dpkg: error processing package dpkg (--configure):
installed dpkg package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of libdpkg-perl:
libdpkg-perl depends on dpkg (>= 1.18.11); however:
Package dpkg is not configured yet.
dpkg: error processing package libdpkg-perl (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of dpkg-dev:
dpkg-dev depends on libdpkg-perl (= 1.21.1ubuntu2); however:
Package libdpkg-perl is not configured yet.
dpkg: error processing package dpkg-dev (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of pkg-config:
pkg-config depends on libdpkg-perl; however:
Package libdpkg-perl is not configured yet.
dpkg: error processing package pkg-config (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libglib2.0-dev:amd64:
libglib2.0-dev:amd64 depends on pkg-config; however:
Package pkg-config is not configured yet.
dpkg: error processing package libglib2.0-dev:amd64 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libdbus-1-dev:amd64:
libdbus-1-dev:amd64 depends on pkg-config; however:
Package pkg-config is not configured yet.
dpkg: error processing package libdbus-1-dev:amd64 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent processing triggers for install-info:
install-info depends on dpkg (>= 1.16.1); however:
Package dpkg is not configured yet.
dpkg: error processing package install-info (--configure):
dependency problems - leaving triggers unprocessed
dpkg: dependency problems prevent processing triggers for sgml-base:
sgml-base depends on dpkg (>= 1.16.4); however:
Package dpkg is not configured yet.
dpkg: error processing package sgml-base (--configure):
dependency problems - leaving triggers unprocessed
Errors were encountered while processing:
dpkg
libdpkg-perl
dpkg-dev
pkg-config
libglib2.0-dev:amd64
libdbus-1-dev:amd64
install-info
sgml-base
我看到另一个关于类似主题的帖子,其中提到stat / /dev /var
的输出可能有用(尽管我不确定它有什么用)。
File: /
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 801h/2049d Inode: 2 Links: 20
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2022-06-11 12:23:55.966935477 +1000
Modify: 2022-03-28 17:02:40.336120240 +1100
Change: 2022-06-11 12:15:41.459498623 +1000
Birth: 2020-12-31 15:04:54.000000000 +1100
File: /dev
Size: 4720 Blocks: 0 IO Block: 4096 directory
Device: 5h/5d Inode: 1 Links: 21
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2022-06-11 11:59:38.006513248 +1000
Modify: 2022-06-11 11:59:17.901323228 +1000
Change: 2022-06-11 11:59:17.901323228 +1000
Birth: -
File: /var
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 801h/2049d Inode: 5767169 Links: 15
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2022-04-28 09:42:56.569785898 +1000
Modify: 2021-08-18 10:28:44.011762167 +1000
Change: 2021-08-18 10:28:44.011762167 +1000
Birth: 2020-12-31 15:04:58.512613837 +1100
运行sudo chown root /
没有任何区别。
- 我的系统:**
./+o+- mblizzard@HP248G1
yyyyy- -yyyyyy+ OS: Ubuntu 22.04 jammy
://+//////-yyyyyyo Kernel: x86_64 Linux 5.15.0-23-generic
.++ .:/++++++/-.+sss/` Uptime: 1h 5m
.:++o: /++++++++/:--:/- Packages: 4191
o:+o+:++.`..```.-/oo+++++/ Shell: bash 5.1.16
.:+o:+o/. `+sssoo+/ Resolution: 2646x1024
.++/+:+oo+o:` /sssooo. DE: Xfce
/+++//+:`oo+o /::--:. WM: Xfwm4
\+/+o+++`o++o ++////. WM Theme: Sweet-Ambar
.++.o+++oo+:` /dddhhh. GTK Theme: Sweet-Dark [GTK2]
.+.o+oo:. `oddhhhh+ Icon Theme: TheOne
\+.++o+o``-````.:ohdhhhhh+ Font: Noto Sans 10
`:o+++ `ohhhhhhhhyo++os: Disk: 791G / 916G (91%)
.o:`.syhhhhhhh/.oo++o` CPU: Intel Core i5-4200U @ 4x 2.6GHz [40.0°C]
/osyyyyyyo++ooo+++/ GPU: Mesa Intel(R) HD Graphics 4400 (HSW GT2)
````` +oo+++o\: RAM: 4823MiB / 7871MiB
`oo++.
先谢了!
3条答案
按热度按时间mcdcgff01#
通过运行
sudo mv /var/lib/dpkg/info/dpkg* /tmp
解决了我自己的问题,然后运行sudo apt install -f
和sudo dpkg --configure -a
。读一读https://itsfoss.com/dpkg-returned-an-error-code-1/,看看它为什么起作用。
ecfdbz9o2#
所以,* 这个 * 答案不会是最有帮助的,但我今天遇到了一个类似的问题,在那里“突然”我得到了一些软件包尚未配置的消息。
不过,
sudo apt install -f
命令最初并不起作用,只是在我运行了sudo dpkg --configure -a
和前一个命令之后,一切似乎又恢复了正常。这对我来说仍然是一个谜,这一切是怎么来的,但我很高兴Mblizzard找到了解决方案,这也适用于我的情况。谢谢!
注:我使用的是Pop!_OS 22.04,当Pop!_Shop应用程序不再更新已安装的应用程序时,我注意到了问题的第一个迹象。相反,它在没有任何通知的情况下关闭了。
quhf5bfb3#
/var/lib/dpkg中可能有一个名为dpkg的符号链接指向此文件夹。