软件包损坏,无法运行 -f install

软件包损坏,无法运行 -f install

安装 codeblocks 后,它开始给我错误,我收到大量错误。我是 Ubuntu 新手(来自 Windows)

sudo dpkg --configure -a 
dpkg: dependency problems prevent configuration of codeblocks-contrib:
 codeblocks-contrib depends on libwxsmithlib0 (= 10.05-1); however:
  Version of libwxsmithlib0 on system is 12.11-2.
 codeblocks-contrib depends on codeblocks (= 10.05-1); however:
  Version of codeblocks on system is 12.11-2.
dpkg: error processing codeblocks-contrib (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libwxsmithlib0-dev:
 libwxsmithlib0-dev depends on libwxsmithlib-dev (= 12.11-2); however:
  Package libwxsmithlib-dev is not installed.
dpkg: error processing libwxsmithlib0-dev (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 codeblocks-contrib
 libwxsmithlib0-dev

当我使用 Apt 时出现此错误

sudo apt-get install gimp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 codeblocks-contrib : Depends: libwxsmithlib0 (= 10.05-1) but 12.11-2 is to be installed
                      Depends: codeblocks (= 10.05-1) but 12.11-2 is to be installed
 codeblocks-dev : Depends: libcodeblocks0 (= 10.05-1) but 12.11-2 is to be installed
 gimp : Depends: libgimp2.0 (>= 2.8.4) but it is not going to be installed
        Depends: libgimp2.0 (<= 2.8.4-z) but it is not going to be installed
        Depends: gimp-data (>= 2.8.4) but it is not going to be installed
        Depends: gimp-data (<= 2.8.4-z) but it is not going to be installed
        Depends: libbabl-0.1-0 (>= 0.1.10) but it is not going to be installed
        Depends: libgegl-0.2-0 (>= 0.2.0) but it is not going to be installed
        Depends: libwebkitgtk-1.0-0 (>= 1.3.10) but it is not going to be installed
 libwxsmithlib0-dev : Depends: libwxsmithlib-dev (= 12.11-2) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

-f也不起作用

apt-get -f install
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
sahil@sahil-ch:~$ sudo -s
root@sahil-ch:~# sudo dpkg --configure -a 
dpkg: dependency problems prevent configuration of codeblocks-contrib:
 codeblocks-contrib depends on libwxsmithlib0 (= 10.05-1); however:
  Version of libwxsmithlib0 on system is 12.11-2.
 codeblocks-contrib depends on codeblocks (= 10.05-1); however:
  Version of codeblocks on system is 12.11-2.

dpkg: error processing codeblocks-contrib (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libwxsmithlib0-dev:
 libwxsmithlib0-dev depends on libwxsmithlib-dev (= 12.11-2); however:
  Package libwxsmithlib-dev is not installed.

dpkg: error processing libwxsmithlib0-dev (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 codeblocks-contrib
 libwxsmithlib0-dev

当我使用软件中心时显示此错误

New software can't be installed, because there is a problem with software currently installed. Do you want to repair this problem now?

并在提示时显示此错误

InstallArchives() failed: perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_IN.ISO8859-1"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_IN.ISO8859-1"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_IN.ISO8859-1"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_IN.ISO8859-1"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 162153 files and directories currently installed.)
Preparing to replace codeblocks-contrib 10.05-1 (using .../codeblocks-contrib_12.11-2_i386.deb) ...
Unpacking replacement codeblocks-contrib ...
dpkg: error processing /var/cache/apt/archives/codeblocks-contrib_12.11-2_i386.deb (--unpack):
 trying to overwrite '/usr/share/codeblocks/cb_koders.zip', which is also in package codeblocks-contrib-common 10.05-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Unpacking libwxsmithlib-dev (from .../libwxsmithlib-dev_12.11-2_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/libwxsmithlib-dev_12.11-2_i386.deb (--unpack):
 trying to overwrite '/usr/include/wxsmith/properties/wxsflagsproperty.h', which is also in package wxsmith-headers 10.05-1
Preparing to replace codeblocks-dev 10.05-1 (using .../codeblocks-dev_12.11-2_i386.deb) ...
Unpacking replacement codeblocks-dev ...
dpkg: error processing /var/cache/apt/archives/codeblocks-dev_12.11-2_i386.deb (--unpack):
 trying to overwrite '/usr/include/codeblocks/filefilters.h', which is also in package codeblocks-headers 10.05-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/codeblocks-contrib_12.11-2_i386.deb
 /var/cache/apt/archives/libwxsmithlib-dev_12.11-2_i386.deb
 /var/cache/apt/archives/codeblocks-dev_12.11-2_i386.deb
dpkg: dependency problems prevent configuration of codeblocks-contrib:
 codeblocks-contrib depends on libwxsmithlib0 (= 10.05-1); however:
  Version of libwxsmithlib0 on system is 12.11-2.
 codeblocks-contrib depends on codeblocks (= 10.05-1); however:
  Version of codeblocks on system is 12.11-2.

dpkg: error processing codeblocks-contrib (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libwxsmithlib0-dev:
 libwxsmithlib0-dev depends on libwxsmithlib-dev (= 12.11-2); however:
  Package libwxsmithlib-dev is not installed.

dpkg: error processing libwxsmithlib0-dev (--configure):
 dependency problems - leaving unconfigured

谢谢 :-)

答案1

首先,尝试执行时,apt-get -f install您需要是 root。Apt-get 假定您是 root,因为您使用了须藤apt-get 运行该程序;这就是为什么建议的代码不包含 sudo 并且随后不起作用的原因。这就是apt-get -f install命令后面的两个错误所表明的。我理解这种沮丧,以及为什么你会想回去再试一次 dpkg。

sudo apt-get update

sudo apt-get purge codeblocks codeblocks-contrib libwxsmithlib0-dev

sudo apt-get dist-upgrade

sudo apt-get -f install

sudo apt-get install gimp codeblocks-contrib

如果您无法通过这种方式解决损坏的软件包,请使用 synaptic 来修复损坏的软件包。

sudo apt-get install synaptic

sudo synaptic

......运行该程序。

现在,从“编辑”菜单中选择“修复损坏的软件包”,然后单击“应用”按钮。之后,您甚至可以使用 synaptic 搜索并安装 gimp 和 codeblocks。synaptic 软件包管理器使用 apt-get 存储库,比软件中心快得多,而且似乎更有能力处理损坏的软件包。作为新用户,很难改掉从 sourceforge 下载 .exe 文件、右键单击并选择“运行”的习惯,无论何时您想安装新程序。看来您正在尝试安装过时的下载版本的 codeblocks。Codeblocks 和 gimp 在官方更新的存储库中可用。如果您无法通过 apt-get 获得它,请使用 synaptic 启用第三方存储库,然后执行 sudo apt-get update 然后再试一次。但是,有时程序无法从存储库中获得,但可以从任何地方以 .deb 文件的形式获得。。。为了避免安装过程中的依赖问题,您可以右键单击 deb 文件并使用存档管理器、软件中心或 gdebi 等包管理器打开它,以自动安装并解决依赖问题。祝你好运。

答案2

运行此命令:

sudo apt-get -f install

相关内容