安装并尝试删除Google Chrome后出现相关性错误


38

因此,ubuntu在一段时间内对我来说非常完美。我尝试下载Google Chrome浏览器,但不小心下载了32位版本。回到并尝试下载64位(愚蠢的是没有删除32位),然后开始遇到与相关的错误消息的问题google-chrome-stable

我的下一步是清除Ubuntu上与Chrome有关的所有内容,但是仍然出现这些错误,并且由于我仍然是Linux的新手,所以我真的迷失了现在的工作。

现在,我无法通过命令行下载任何内容。例如,我刚刚尝试下载Ubuntu的f.lux版本并获得以下内容:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gcc-4.8-base:i386 libasn1-8-heimdal:i386 libasound2:i386
  libatk-bridge2.0-0:i386 libatk1.0-0:i386 libatspi2.0-0:i386
  libavahi-client3:i386 libavahi-common-data:i386 libavahi-common3:i386
  libcairo-gobject2:i386 libcairo2:i386 libcolord1:i386 libcups2:i386
  libcurl3:i386 libdatrie1:i386 libdbus-glib-1-2:i386 libdbusmenu-glib4:i386
  libdbusmenu-gtk3-4:i386 libdbusmenu-gtk4:i386 libexpat1:i386 libffi6:i386
  libfontconfig1:i386 libfreetype6:i386 libgconf-2-4:i386 libgcrypt11:i386
  libgdk-pixbuf2.0-0:i386 libglib2.0-0:i386 libgnutls26:i386
  libgpg-error0:i386 libgraphite2-3:i386 libgssapi-krb5-2:i386
  libgssapi3-heimdal:i386 libgtk-3-0:i386 libgtk2.0-0:i386 libharfbuzz0b:i386
  libhcrypto4-heimdal:i386 libheimbase1-heimdal:i386 libheimntlm0-heimdal:i386
  libhx509-5-heimdal:i386 libidn11:i386 libjasper1:i386 libjbig0:i386
  libjpeg-turbo8:i386 libjpeg8:i386 libk5crypto3:i386 libkeyutils1:i386
  libkrb5-26-heimdal:i386 libkrb5-3:i386 libkrb5support0:i386 liblcms2-2:i386
  libldap-2.4-2:i386 libmbim-glib0 libnspr4:i386 libnss3:i386 libp11-kit0:i386
  libpango-1.0-0:i386 libpango1.0-0:i386 libpangocairo-1.0-0:i386
  libpangoft2-1.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386
  libpixman-1-0:i386 libqmi-glib0 libroken18-heimdal:i386 librtmp0:i386
  libsasl2-2:i386 libsasl2-modules:i386 libsasl2-modules-db:i386
  libsqlite3-0:i386 libssl1.0.0:i386 libstdc++6:i386 libtasn1-6:i386
  libthai0:i386 libtiff5:i386 libwayland-client0:i386 libwayland-cursor0:i386
  libwind0-heimdal:i386 libx11-6:i386 libxau6:i386 libxcb-render0:i386
  libxcb-shm0:i386 libxcb1:i386 libxcomposite1:i386 libxcursor1:i386
  libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxft2:i386
  libxi6:i386 libxinerama1:i386 libxkbcommon0:i386 libxrandr2:i386
  libxrender1:i386 libxss1:i386 libxtst6:i386 usb-modeswitch
  usb-modeswitch-data
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libappindicator1 libglade2-0 libindicator7
Suggested packages:
  python-gtk2-doc
The following packages will be REMOVED:
  google-chrome-stable:i386 libappindicator1:i386 libindicator7:i386
The following NEW packages will be installed:
  libappindicator1 libglade2-0 libindicator7 python-appindicator python-glade2
0 upgraded, 5 newly installed, 3 to remove and 3 not upgraded.
1 not fully installed or removed.
Need to get 53.4 kB/101 kB of archives.
After this operation, 185 MB disk space will be freed.
Do you want to continue? [Y/n] Y
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty/main libglade2-0 amd64 1:2.6.4-2 [44.6 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty/main python-glade2 amd64 2.24.0-3ubuntu3 [8,744 B]
Fetched 53.4 kB in 0s (159 kB/s)         
(Reading database ... 170838 files and directories currently installed.)
Removing google-chrome-stable (46.0.2490.71-1) ...
xdg-icon-resource: size argument must be numeric
Try 'xdg-icon-resource --help' for more information.
dpkg: error processing package google-chrome-stable (--remove):
 subprocess installed pre-removal script returned error exit status 1
xdg-icon-resource: size argument must be numeric
Try 'xdg-icon-resource --help' for more information.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Removing libappindicator1 (12.10.1+13.10.20130920-0ubuntu4.1) ...
Removing libindicator7 (12.10.2+14.04.20141007.1-0ubuntu1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
E: Sub-process /usr/bin/dpkg returned an error code (1)

我需要能够毫无问题地下载软件包。谁能帮我吗?

编辑:另外,当我尝试更新软件时,我收到此消息:

**THE PACKAGE SYSTEM IS BROKEN.** 
Check if you are using third party repositories. If so disable them, since they are a common source of problems.
Furthermore run the following command in a Terminal: apt-get install -f

但是当我运行时apt-get install -f,我得到以下输出:

Errors were encountered while processing:
 google-chrome-stable
E: Sub-process /usr/bin/dpkg returned an error code (1)

来自的回复sudo apt-get install -f

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libatk-bridge2.0-0:i386 libatspi2.0-0:i386 libcairo-gobject2:i386
  libcolord1:i386 libdbusmenu-gtk3-4:i386 libgtk-3-0:i386 liblcms2-2:i386
  libmbim-glib0 libqmi-glib0 libwayland-client0:i386 libwayland-cursor0:i386
  libxkbcommon0:i386 usb-modeswitch usb-modeswitch-data
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up google-chrome-stable (46.0.2490.71-1) ...
xdg-icon-resource: size argument must be numeric
Try 'xdg-icon-resource --help' for more information.
dpkg: error processing package google-chrome-stable (--configure):
 subprocess installed post-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)

对的响应sudo apt-get update非常长,因此我将其缩短为错误消息:

W: Failed to fetch http://ppa.launchpad.net/fabricesp/ppa/ubuntu/dists/trusty/main/binary-amd64/Packages  404  Not Found
W: Failed to fetch http://ppa.launchpad.net/fabricesp/ppa/ubuntu/dists/trusty/main/binary-i386/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.

安装-f的错误:

After this operation, 0 B of additional disk space will be used.
Setting up google-chrome-stable (46.0.2490.71-1) ...
xdg-icon-resource: size argument must be numeric
Try 'xdg-icon-resource --help' for more information.
dpkg: error processing package google-chrome-stable (--configure):
 subprocess installed post-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)

对于dist-upgrade错误:

After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up google-chrome-stable (46.0.2490.71-1) ...
xdg-icon-resource: size argument must be numeric
Try 'xdg-icon-resource --help' for more information.
dpkg: error processing package google-chrome-stable (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 google-chrome-stable
E: Sub-process /usr/bin/dpkg returned an error code (1)

错误 sudo dpkg --purge --force-all google-chrome-stable

Removing google-chrome-stable (46.0.2490.71-1) ...
xdg-icon-resource: size argument must be numeric
Try 'xdg-icon-resource --help' for more information.
dpkg: error processing package google-chrome-stable (--purge):
 subprocess installed pre-removal script returned error exit status 1
xdg-icon-resource: size argument must be numeric
Try 'xdg-icon-resource --help' for more information.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 google-chrome-stable

为了响应AB的建议,在运行之后 sudo rm /var/lib/dpkg/info/google-chrome-stable*.prerm,我随后奔跑sudo apt-get install -f并得到了与我相同的答案:

正在阅读包装清单...完成
建立依赖树       
正在读取状态信息...完成
以下软件包是自动安装的,不再需要:
  libatk-bridge2.0-0:i386 libatspi2.0-0:i386 libcairo-gobject2:i386
  libcolord1:i386 libdbusmenu-gtk3-4:i386 libgtk-3-0:i386 liblcms2-2:i386
  libmbim-glib0 libqmi-glib0 libwayland-client0:i386 libwayland-cursor0:i386
  libxkbcommon0:i386 USB模式切换USB模式切换数据
使用“ apt-get autoremove”将其删除。
0已升级,0新安装,0已删除和0未升级。
1未完全安装或卸下。
此操作后,将使用0 B的额外磁盘空间。
设置google-chrome-stable(46.0.2490.71-1)...
xdg-icon-resource:size参数必须为数字
请尝试使用“ xdg-icon-resource --help”以获取更多信息。
dpkg:错误处理软件包google-chrome-stable(--configure):
 子进程已安装的安装后脚本返回错误退出状态1
E:子进程/ usr / bin / dpkg返回错误代码(1)

参考此处
Ravan

键入终端sudo apt-get autoclean,然后键入sudo apt-get remove --purge google-chrome-stable,然后安装Chrome
Neil

当我尝试在自动清理后进行清除时,我仍然收到相同的该死的错误“处理时遇到错误:google-chrome-stable E:子进程/ usr / bin / dpkg返回了错误代码(1)”
segue_segway

我已经稍微更改了答案中的步骤。从我的答案的开头重新开始。
AB

多么愚蠢的错误消息,对不对?为什么不告诉我们出了什么问题。
索伦

Answers:


23

看起来您的源文件已损坏,并且程序包已损坏。通过按Ctrl+ Alt+ T打开终端,删除损坏的源文件,然后键入:

sudo rm /etc/apt/sources.list

然后输入

sudo software-properties-gtk

这将打开software-properties-gtk并sources.list自动创建一个新文件。

然后将服务器更改为美国或您选择的任何其他服务器。您必须从新对话框启用存储库才能创建新的sources.list。

勾选所有复选框,然后单击还原,然后单击关闭。

在此处输入图片说明

如何还原默认存储库?

步骤2打开终端并输入

sudo apt-get remove --purge google-chrome-stable

然后跑

sudo apt-get update && sudo apt-get dist-upgrade -y

然后安装Chrome。

编辑

我参加了Sunny聊天,以帮助他解决问题并/var/lib/dpkg/alternatives/google-chrome通过运行删除它

 sudo rm /var/lib/dpkg/alternatives/google-chrome

并运行

 sudo apt-get update && sudo apt-get dist-upgrade -y

解决了该问题,Sunny表示该错误不再发生。


我将结果添加到上述问题的那些命令中。
segue_segway

刚刚编辑了我的帖子。希望对您有所帮助
Neil

嗯,我正在使用sudo:rm / etc / apt / sources.list:找不到命令
segue_segway 2015年

“ sudo rm /etc/apt/sources.list”您需要添加一个空间sudo rm(空格)/etc/apt/sources.list
Neil

我得到了这些消息:警告:根:无法打开文件“的/etc/apt/sources.list”警告:根:无法打开文件“的/etc/apt/sources.list”
segue_segway

9

好吧,在扩展搜索并找到我已经尝试过的东西之后,我去了phpmyadmin.prerm,phpmyadmin.postrm等脚本的位置,并手动将其删除。

cd /var/lib/dpkg/info/

ls -l phpmyadmin.*
-rw-r--r-- 1 root root 165 2008-03-05 21:42 phpmyadmin.conffiles
-rwxr-xr-x 1 root root 287 2008-03-05 21:42 phpmyadmin.config
-rw-r--r-- 1 root root 33524 2008-08-06 11:31 phpmyadmin.list
-rw-r--r-- 1 root root 51996 2008-03-05 21:42 phpmyadmin.md5sums
-rwxr-xr-x 1 root root 3286 2008-03-05 21:42 phpmyadmin.postinst
-rwxr-xr-x 1 root root 1762 2008-03-05 21:42 phpmyadmin.postrm
-rwxr-xr-x 1 root root 1762 2008-08-06 09:12 phpmyadmin.postrm.orig
-rwxr-xr-x 1 root root 339 2008-03-05 21:42 phpmyadmin.preinst
-rw-r--r-- 1 root root 22441 2008-03-05 21:42 phpmyadmin.templates

然后我删除了这些文件

sudo rm -r phpmyadmin.*

然后我跑了

sudo apt-get clean
sudo apt-get update

我想看看包裹是否还在,所以我跑了

sudo apt-get删除phpmyadmin

我得到的响应是该软件包未安装,因此无法将其删除。

最后!

所以从那里我跑了

sudo apt-get install phpmyadmin

我希望这对某人有帮助,因为我希望在Ubuntu论坛上寻求很多答案。


7

请遵循以下命令从E中删除:子进程/ usr / bin / dpkg返回了错误代码(1)

步骤1:

sudo apt --purge remove unattended-upgrades

这里的无人值守升级是“错误处理程序包名称”。您可以将其替换为错误处理程序包名称。

第2步:

sudo apt-get autoremove

步骤3:

sudo apt-get update

1

删除Chrome失败,因为删除前脚本存在问题。通过删除脚本

sudo rm /var/lib/dpkg/info/google-chrome-stable*.prerm
sudo rm /var/lib/dpkg/info/google-chrome-stable*.postinst

然后通过重新开始删除

sudo apt-get purge google-chrome-stable
sudo apt-get install -f

为了更好的理解,请在此处阅读我的答案。


第二个问题是PPA ppa:fabricesp / ppa没有Trusty的软件包。因此使用

sudo add-apt-repository --r ppa:fabricesp/ppa

删除PPA。ppa-purge在这种情况下不起作用。


我编辑了问题以解决这些建议。仍然没有运气。
segue_segway 2015年

0

尝试在终端上运行以下命令:

sudo apt-get --purge remove google-chrome-stable
sudo apt-get -f install
sudo apt-get update

希望这能解决您的问题。


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.