无法使用 Ubuntu 软件中心安装 Firefox

无法使用 Ubuntu 软件中心安装 Firefox

当我尝试通过 Ubuntu 软件中心安装 Firefox 时,它开始应用更改而不先下载软件包,然后我收到此消息:

Package Operation Failed

The installation or removal of the package failed

细节:

 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
Selecting previously unselected package firefox.
(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 ... 225197 files and directories currently installed.)
Unpacking firefox (from .../firefox_20.0+build1-0ubuntu0.12.10.3_i386.deb) ...
Selecting previously unselected package firefox-globalmenu.
Unpacking firefox-globalmenu (from .../firefox-globalmenu_20.0+build1-0ubuntu0.12.10.3_i386.deb) ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf.index...
Processing triggers for desktop-file-utils ...
Processing triggers for gnome-menus ...
Processing triggers for man-db ...
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
Setting up firefox (20.0+build1-0ubuntu0.12.10.3) ...
update-alternatives: error: alternative path /usr/bin/firefox doesn't exist
dpkg: error processing firefox (--configure):
 subprocess installed post-installation script returned error exit status 2
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of firefox-globalmenu:
 firefox-globalmenu depends on firefox (= 20.0+build1-0ubuntu0.12.10.3); however:
  Package firefox is not configured yet.

dpkg: error processing firefox-globalmenu (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Errors were encountered while processing:
 firefox
 firefox-globalmenu
Error in function: 
Setting up firefox (20.0+build1-0ubuntu0.12.10.3) ...
update-alternatives: error: alternative path /usr/bin/firefox doesn't exist
dpkg: error processing firefox (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of firefox-globalmenu:
 firefox-globalmenu depends on firefox (= 20.0+build1-0ubuntu0.12.10.3); however:
  Package firefox is not configured yet.

dpkg: error processing firefox-globalmenu (--configure):
 dependency problems - leaving unconfigured

注意:我之前曾尝试安装 Firefox,但下载时出现错误,因此我从其官方网站下载了 Firefox,并按照我在https://help.ubuntu.com/community/FirefoxNewVersion/MozillaBuilds 这样我就可以使用 Firefox,但后来我想使用 USC 的版本会更好,因为它会自行更新。所以我删除了 Mozilla 版本并尝试再次从 USC 安装,之后我得到了上述错误。我怀疑我尝试使用 Mozilla 版本可能是导致错误的原因。

好的,当我在终端输入“sudo apt-get install firefox”时,我得到了这个:

sudo apt-get install firefox
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  freegish-data gir1.2-gconf-2.0 gir1.2-unique-3.0 libunique-3.0-0
  ndiswrapper-common ndiswrapper-utils-1.9 python-compizconfig
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  firefox-globalmenu
Suggested packages:
  latex-xft-fonts firefox-gnome-support
The following NEW packages will be installed:
  firefox firefox-globalmenu
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/24.6 MB of archives.
After this operation, 51.7 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Selecting previously unselected package firefox.
(Reading database ... 225197 files and directories currently installed.)
Unpacking firefox (from .../firefox_20.0+build1-0ubuntu0.12.10.3_i386.deb) ...
Selecting previously unselected package firefox-globalmenu.
Unpacking firefox-globalmenu (from .../firefox-globalmenu_20.0+build1-0ubuntu0.12.10.3_i386.deb) ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf.index...
Processing triggers for desktop-file-utils ...
Processing triggers for gnome-menus ...
Processing triggers for man-db ...
Setting up firefox (20.0+build1-0ubuntu0.12.10.3) ...
update-alternatives: error: alternative path /usr/bin/firefox doesn't exist
dpkg: error processing firefox (--configure):
 subprocess installed post-installation script returned error exit status 2
E: Sub-process /usr/bin/dpkg returned an error code(1)'

之后我收到了一份崩溃报告。

答案1

Ctrl+ Alt+T打开终端并运行以下命令:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install firefox

如果问题没有解决,请尝试以下解决方案:

  • 重新安装/安装语言包:

    sudo apt-get install --reinstall language-pack-en
    
  • (重新)生成并重新配置区域设置:

    sudo locale-gen
    sudo dpkg-reconfigure locales
    
  • 最终的解决方案是LANG通过修改来手动设置变量/etc/default/locale。在您最喜欢的编辑器中
    打开/etc/default/locale

    gksudo gedit /etc/default/locale
    

    并将 设置LANG=en_US.UTF-8或您正在使用的任何语言,例如:

    LANG=en_US.UTF-8
    

    更改将在重启后生效。

在 OP 提供了更多信息之后,问题通过运行得到解决:

sudo apt-get clean
sudo apt-get install firefox

资料来源: Ubuntu 文档Ubuntu 论坛超级用户

相关内容