在 ubuntu 12.04 中安装任何软件或更新时出现错误

在 ubuntu 12.04 中安装任何软件或更新时出现错误

在安装或更新任何内容时,我收到此错误“软件包的安装或删除失败。” 详细信息如下:

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 ... 445343 files and directories currently installed.)
Preparing to replace qbittorrent 3.1.x-0~4612-20131231~ubuntu12.04.1 (using .../qbittorrent_3.1.x-0~4619-20140103~ubuntu12.04.1_i386.deb) ...
Unpacking replacement qbittorrent ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf.index...
Processing triggers for desktop-file-utils ...
Processing triggers for gnome-menus ...
Processing triggers for menu ...
Processing triggers for hicolor-icon-theme ...
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 isc-dhcp-server (4.1.ESV-R4-0ubuntu5.9) ...
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
/var/lib/dpkg/info/isc-dhcp-server.config: 10: /etc/default/isc-dhcp-server: Separate: not found
dpkg: error processing isc-dhcp-server (--configure):
 subprocess installed post-installation script returned error exit status 127
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of dhcp3-server:
 dhcp3-server depends on isc-dhcp-server; however:
  Package isc-dhcp-server is not configured yet.
dpkg: error processing dhcp3-server (--configure):
 dependency problems - leaving unconfigured
Setting up qbittorrent (3.1.x-0~4619-20140103~ubuntu12.04.1) ...No apport report written because MaxReports is reached already

Processing triggers for menu ...
Errors were encountered while processing:
 isc-dhcp-server
 dhcp3-server
Error in function: 
Setting up isc-dhcp-server (4.1.ESV-R4-0ubuntu5.9) ...
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
/var/lib/dpkg/info/isc-dhcp-server.config: 10: /etc/default/isc-dhcp-server: Separate: not found
dpkg: error processing isc-dhcp-server (--configure):
 subprocess installed post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of dhcp3-server:
 dhcp3-server depends on isc-dhcp-server; however:
  Package isc-dhcp-server is not configured yet.
dpkg: error processing dhcp3-server (--configure):
 dependency problems - leaving unconfigured

虽然实际软件安装成功但出现上述错误。我正在使用带有 gnome shell 的 ubuntu 12.04。

答案1

从您问题中的错误日志中,我可以假设您的语言环境发生了一些破坏。(不仅仅是)。

检查此文件

cat /etc/default/locale 

该文件的内容应为

LANG="en_US.UTF-8" 

以上适用于英语。但此文件中不应有其他行。

如果存在其他行,请编辑文件并删除除字符串之外的所有行LANG

如果该文件不存在,则创建它并LANG仅添加字符串。

无论如何,请使用具有 root 权限的编辑器。

gksudo gedit /etc/default/locale 

编辑并保存后,重新配置一些内容。

sudo dpkg-reconfigure locales 
sudo update-locale 

注销/登录或重新启动。

关于 dhcp 服务器,阅读此答案。某些配置文件必须存在。这些文件在答案中以默认内容列出。

然后重试

sudo apt-get install -f
sudo dpkg --configure -a

相关内容