处理时遇到错误:python-xdg

处理时遇到错误:python-xdg

我正在尝试下载 lutris,但是我之前确实遇到过此错误,并且不确定如何处理该错误。我对 Linux 还很陌生,但我正在运行该命令,sudo apt install lutris但当我这样做时,它返回:

    Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libnvidia-common-450 linux-hwe-5.4-headers-5.4.0-42
  linux-hwe-5.4-headers-5.4.0-56 linux-hwe-5.4-headers-5.4.0-58
  linux-hwe-5.4-headers-5.4.0-59
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  cabextract curl fluid-soundfont-gm fluid-soundfont-gs libcurl4 libmspack0
  libwine-development mesa-utils p7zip python3-bs4 python3-distro
  python3-evdev python3-html5lib python3-lxml python3-magic
  python3-setproctitle python3-webencodings winetricks
Suggested packages:
  fluidsynth timidity ttf-mscorefonts-installer gamemode p7zip-full
  python-evdev-doc python3-genshi python3-lxml-dbg python-lxml-doc aria2 tor
The following packages will be REMOVED:
  libcurl3
The following NEW packages will be installed:
  cabextract curl fluid-soundfont-gm fluid-soundfont-gs libcurl4 libmspack0
  libwine-development lutris mesa-utils p7zip python3-bs4 python3-distro
  python3-evdev python3-html5lib python3-lxml python3-magic
  python3-setproctitle python3-webencodings winetricks
0 upgraded, 19 newly installed, 1 to remove and 88 not upgraded.
1 not fully installed or removed.
Need to get 146 MB/146 MB of archives.
After this operation, 358 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libcurl4 amd64 7.58.0-2ubuntu3.12 [214 kB]
Get:2 http://ppa.launchpad.net/lutris-team/lutris/ubuntu bionic/main amd64 lutris all 0.5.8.3~ubuntu18.04.1 [588 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libmspack0 amd64 0.6-3ubuntu0.3 [37.5 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 cabextract amd64 1.6-1.1 [21.8 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 curl amd64 7.58.0-2ubuntu3.12 [159 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 fluid-soundfont-gm all 3.1-5.1 [119 MB]
Get:7 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 fluid-soundfont-gs all 3.1-5.1 [2,474 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 libwine-development amd64 3.6-1 [20.9 MB]
Get:9 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3-lxml amd64 4.2.1-1ubuntu0.3 [1,097 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python3-setproctitle amd64 1.1.10-1build2 [14.8 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python3-magic all 2:0.4.15-1 [9,280 B]
Get:12 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 python3-distro all 1.0.1-2 [11.2 kB]
Get:13 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 p7zip amd64 16.02+dfsg-6 [358 kB]
Get:14 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mesa-utils amd64 8.4.0-1 [34.3 kB]
Get:15 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python3-bs4 all 4.6.0-1 [67.8 kB]
Get:16 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 python3-evdev amd64 0.7.0+dfsg-2 [29.5 kB]
Get:17 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python3-webencodings all 0.5-2 [10.4 kB]
Get:18 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python3-html5lib all 0.999999999-1 [81.9 kB]
Get:19 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 winetricks all 0.0+20180217-1 [145 kB]
Fetched 146 MB in 21s (6,886 kB/s)                                             
dpkg: libcurl3:amd64: dependency problems, but removing anyway as you requested:
 minecraft-launcher depends on libcurl3 | libcurl4; however:
  Package libcurl3:amd64 is to be removed.
  Package libcurl4 is not installed.

(Reading database ... 273665 files and directories currently installed.)
Removing libcurl3:amd64 (7.58.0-2ubuntu2) ...
Selecting previously unselected package libcurl4:amd64.
(Reading database ... 273659 files and directories currently installed.)
Preparing to unpack .../00-libcurl4_7.58.0-2ubuntu3.12_amd64.deb ...
Unpacking libcurl4:amd64 (7.58.0-2ubuntu3.12) ...
Selecting previously unselected package libmspack0:amd64.
Preparing to unpack .../01-libmspack0_0.6-3ubuntu0.3_amd64.deb ...
Unpacking libmspack0:amd64 (0.6-3ubuntu0.3) ...
Selecting previously unselected package cabextract.
Preparing to unpack .../02-cabextract_1.6-1.1_amd64.deb ...
Unpacking cabextract (1.6-1.1) ...
Selecting previously unselected package curl.
Preparing to unpack .../03-curl_7.58.0-2ubuntu3.12_amd64.deb ...
Unpacking curl (7.58.0-2ubuntu3.12) ...
Selecting previously unselected package fluid-soundfont-gm.
Preparing to unpack .../04-fluid-soundfont-gm_3.1-5.1_all.deb ...
Unpacking fluid-soundfont-gm (3.1-5.1) ...
Selecting previously unselected package fluid-soundfont-gs.
Preparing to unpack .../05-fluid-soundfont-gs_3.1-5.1_all.deb ...
Unpacking fluid-soundfont-gs (3.1-5.1) ...
Selecting previously unselected package libwine-development:amd64.
Preparing to unpack .../06-libwine-development_3.6-1_amd64.deb ...
Unpacking libwine-development:amd64 (3.6-1) ...
Selecting previously unselected package python3-lxml:amd64.
Preparing to unpack .../07-python3-lxml_4.2.1-1ubuntu0.3_amd64.deb ...
Unpacking python3-lxml:amd64 (4.2.1-1ubuntu0.3) ...
Selecting previously unselected package python3-setproctitle:amd64.
Preparing to unpack .../08-python3-setproctitle_1.1.10-1build2_amd64.deb ...
Unpacking python3-setproctitle:amd64 (1.1.10-1build2) ...
Selecting previously unselected package python3-magic.
Preparing to unpack .../09-python3-magic_2%3a0.4.15-1_all.deb ...
Unpacking python3-magic (2:0.4.15-1) ...
Selecting previously unselected package python3-distro.
Preparing to unpack .../10-python3-distro_1.0.1-2_all.deb ...
Unpacking python3-distro (1.0.1-2) ...
Selecting previously unselected package p7zip.
Preparing to unpack .../11-p7zip_16.02+dfsg-6_amd64.deb ...
Unpacking p7zip (16.02+dfsg-6) ...
Selecting previously unselected package mesa-utils.
Preparing to unpack .../12-mesa-utils_8.4.0-1_amd64.deb ...
Unpacking mesa-utils (8.4.0-1) ...
Selecting previously unselected package lutris.
Preparing to unpack .../13-lutris_0.5.8.3~ubuntu18.04.1_all.deb ...
Unpacking lutris (0.5.8.3~ubuntu18.04.1) ...
Selecting previously unselected package python3-bs4.
Preparing to unpack .../14-python3-bs4_4.6.0-1_all.deb ...
Unpacking python3-bs4 (4.6.0-1) ...
Selecting previously unselected package python3-evdev.
Preparing to unpack .../15-python3-evdev_0.7.0+dfsg-2_amd64.deb ...
Unpacking python3-evdev (0.7.0+dfsg-2) ...
Selecting previously unselected package python3-webencodings.
Preparing to unpack .../16-python3-webencodings_0.5-2_all.deb ...
Unpacking python3-webencodings (0.5-2) ...
Selecting previously unselected package python3-html5lib.
Preparing to unpack .../17-python3-html5lib_0.999999999-1_all.deb ...
Unpacking python3-html5lib (0.999999999-1) ...
Selecting previously unselected package winetricks.
Preparing to unpack .../18-winetricks_0.0+20180217-1_all.deb ...
Unpacking winetricks (0.0+20180217-1) ...
Setting up python3-setproctitle:amd64 (1.1.10-1build2) ...
Setting up python3-webencodings (0.5-2) ...
Setting up libmspack0:amd64 (0.6-3ubuntu0.3) ...
Setting up python3-lxml:amd64 (4.2.1-1ubuntu0.3) ...
Setting up python3-magic (2:0.4.15-1) ...
Setting up fluid-soundfont-gs (3.1-5.1) ...
Setting up libcurl4:amd64 (7.58.0-2ubuntu3.12) ...
Setting up fluid-soundfont-gm (3.1-5.1) ...
Setting up python3-bs4 (4.6.0-1) ...
Setting up libwine-development:amd64 (3.6-1) ...
Setting up cabextract (1.6-1.1) ...
Setting up p7zip (16.02+dfsg-6) ...
Setting up python3-html5lib (0.999999999-1) ...
Setting up python3-distro (1.0.1-2) ...
Setting up python3-evdev (0.7.0+dfsg-2) ...
dpkg: error processing package python-xdg (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
Setting up mesa-utils (8.4.0-1) ...
Setting up curl (7.58.0-2ubuntu3.12) ...
Setting up lutris (0.5.8.3~ubuntu18.04.1) ...
Setting up winetricks (0.0+20180217-1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
Errors were encountered while processing:
 python-xdg
E: Sub-process /usr/bin/dpkg returned an error code (1)

有什么建议或方法可以找出导致此问题的原因吗?

答案1

dpkg:错误处理软件包 python-xdg(--configure):软件包处于非常糟糕的不一致状态;您应该在尝试配置之前重新安装它

sudo apt reinstall python-xdg
sudo dpkg --configure -a

如果无法重新安装该包,请创建一个/var/lib/dpkg/info/python-xdg.postrm包含以下内容的包:

#!/bin/bash
/bin/true

然后运行:

sudo apt remove python-xdg
sudo apt install python-xdg
sudo dpkg --configure -a

答案2

这是你的问题。

dpkg: error processing package python-xdg (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration

解决方案。

apt reinstall python-xdg

可能与 a 有关。

dpkg --configure -a

如果在发生错误时它抱怨任何包未配置。同样,这里需要解决这个问题,否则它将永远不会启动。

dpkg: libcurl3:amd64: dependency problems, but removing anyway as you requested:
 minecraft-launcher depends on libcurl3 | libcurl4; however:
  Package libcurl3:amd64 is to be removed.
  Package libcurl4 is not installed.

解决方案是按照它的提示安装 libcurl4。

答案3

正如本文所提到的关联,您可能需要重新安装。就我而言,我必须手动下载软件包并安装它

cd /tmp
apt-get download python-minimal
sudo dpkg -i python-minimal_*.deb
sudo apt-get install -f

相关内容