web-dev-qa-db-ja.com

壊れたパッケージの修復-「dpkg:エラー:競合するアクション-f(--field)および-r(--remove)」

Ubuntu 12.04 LTS。さらに情報が必要な場合は、教えてください。

主な問題は次のとおりです。

tzach@tzach-pc:~$ Sudo apt-get install docky
[Sudo] password for tzach: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
docky is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 ca-certificates-Java : Depends: openjdk-6-jre-headless (>= 6b16-1.6.1-2) but it is not going to be installed or
                                 Java6-runtime-headless
 openjdk-7-jre-lib : Depends: openjdk-7-jre-headless (>= 7~b130~pre0) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
tzach@tzach-pc:~$

また:

tzach@tzach-pc:~$ Sudo apt-get upgrade
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:
ca-certificates-Java : Depends: openjdk-6-jre-headless (>= 6b16-1.6.1-2) but it is not installed or
Java6-runtime-headless
openjdk-7-jre-lib : Depends: openjdk-7-jre-headless (>= 7~b130~pre0) but it is not installed
E: Unmet dependencies. Try using *******

そこで、メッセージ#9でガイドを試してみました: http://ubuntuforums.org/showthread.php?t=947124

最初の4つのコマンドをすべて実行し、最後の1つである "Sudo apt-get autoremove"を実行すると次のようになります。

tzach@tzach-pc:~$ Sudo apt-get autoremove
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:
 **ca-certificates-Java** : Depends: openjdk-6-jre-headless (>= 6b16-1.6.1-2) but it is not installed or
                                 Java6-runtime-headless
 **openjdk-7-jre-lib** : Depends: openjdk-7-jre-headless (>= 7~b130~pre0) but it is not installed
E: Unmet dependencies. Try using -f.

したがって、最後のコマンドを2回実行します。Sudodpkg --remove -force --force-remove-reinstreqca-certificates-JavaおよびSudo dpkg- remove -force --force-remove-reinstreqopenjdk-7-jre-lib

しかし、それらの両方が提供します:

tzach@tzach-pc:~$ Sudo dpkg --remove -force --force-remove-reinstreq ca-certificates-Java
[Sudo] password for tzach: 
dpkg: error: conflicting actions -f (--field) and -r (--remove)

Type dpkg --help for help about installing and deinstalling packages [*];
Use `dselect' or `aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through `less' or `more' !

「sudo apt-get -f install」のgreen7-outputの編集:

tzach@tzach-pc:~$ Sudo apt-get -f install
[Sudo] password for tzach: 
Reading package lists... Done
Building dependency tree 
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
icedtea-7-jre-cacao icedtea-7-jre-jamvm Java-common openjdk-7-jre-headless
tzdata-Java
Suggested packages:
default-jre equivs Sun-Java6-fonts ttf-dejavu-extra fonts-ipafont-gothic
fonts-ipafont-mincho ttf-telugu-fonts ttf-oriya-fonts ttf-kannada-fonts
ttf-bengali-fonts
The following packages will be REMOVED:
ttf-mscorefonts-installer
The following NEW packages will be installed:
icedtea-7-jre-cacao icedtea-7-jre-jamvm Java-common openjdk-7-jre-headless
tzdata-Java
0 upgraded, 5 newly installed, 1 to remove and 355 not upgraded.
5 not fully installed or removed.
Need to get 0 B/29.6 MB of archives.
After this operation, 88.5 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: warning: there's no installed package matching ttf-mscorefonts-installer:AMD64
Setting up tzdata (2012e-0ubuntu0.12.04) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing tzdata (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
tzdata
E: Sub-process /usr/bin/dpkg returned an error code (1)

Green7のEDIT2:

tzach@tzach-pc:~$ Sudo apt-get remove --purge tzdata
[Sudo] password for tzach:
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:
ca-certificates-Java : Depends: openjdk-6-jre-headless (>= 6b16-1.6.1-2) but it is not going to be installed or
Java6-runtime-headless
libc6 : Depends: tzdata but it is not going to be installed
libc6:i386 : Depends: tzdata:i386
libical0 : Depends: tzdata but it is not going to be installed
openjdk-7-jre-lib : Depends: openjdk-7-jre-headless (>= 7~b130~pre0) but it is not going to be installed
python-dateutil : Depends: tzdata but it is not going to be installed
ubuntu-minimal : Depends: tzdata but it is not going to be installed
util-linux : Depends: tzdata (>= 2006c-2) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 

Green7のEDIT3:

tzach@tzach-pc:~$ Sudo apt-get install openjdk-7-jre-headless
[Sudo] password for tzach:
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:
openjdk-7-jre-headless : Depends: tzdata-Java but it is not going to be installed
Depends: Java-common (>= 0.28) but it is not going to be installed
Recommends: icedtea-7-jre-cacao (= 7~u3-2.1.1~pre1-1ubuntu3) but it is not going to be installed
Recommends: icedtea-7-jre-jamvm (= 7~u3-2.1.1~pre1-1ubuntu3) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

テキスト内のいくつかの要素も太字にすることになっています。批評家ではない(:編集してくれてありがとう!

ご協力いただきありがとうございます。

3
yinon

これを試して

Sudo mv /var/lib/dpkg/info/tzdata.prerm ~/tzdata.prerm

Sudo dpkg-reconfigure tzdata --force

Sudo dpkg --purge --force-all tzdata
2
k3rn3l

問題の原因となっている可能性のあるパッケージtzdataを削除してください。

Sudo apt-get remove --purge tzdata
2
green

誤って設定されたパッケージまたは不適切にインストールされたパッケージを削除するには、次を実行できます。

Sudo aptitude purge $(dpkg -l|grep ^rc|awk '{ print $2 }')
1
user84911

試して

rm /var/lib/apt/lists/* -vf  
apt-get update 
1
chujowygosc

パッケージに少し異なる問題がありましたが、これで解決しました:

Sudo dpkg --remove <conflicted-package-name>
Sudo apt-get install -f

そしてそれは修正されました。

私は同じ問題を抱えていたように見えますが、他のパッケージでした。これはJava7-Oracle-installerと呼ばれ(インストールしないでください)、dpkgでエラーコード1を受け取っていたため、パッケージを削除することさえできませんでした(?!)。何もインストールまたは削除できなかったため、システムを再インストールする必要がありました。システムを再インストールすることを好みます。

0
Xylo