任何软件包的安装都失败

任何软件包的安装都失败
root@campaigns:/var/lib/dpkg/info# apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_IN"
    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
Setting up etcd (2.2.5+dfsg-1ubuntu1) ...
Job for etcd.service failed because the control process exited with error code. See "systemctl status etcd.service" and "journalctl -xe" for details.
invoke-rc.d: initscript etcd, action "start" failed.
● etcd.service - etcd - highly-available key value store
   Loaded: loaded (/lib/systemd/system/etcd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2017-07-19 16:18:52 UTC; 9ms ago
     Docs: https://github.com/coreos/etcd
       man:etcd
  Process: 13475 ExecStart=/usr/bin/etcd $DAEMON_ARGS (code=exited, status=1/FAILURE)
 Main PID: 13475 (code=exited, status=1/FAILURE)

Jul 19 16:18:52 campaigns etcd[13475]: etcd Version: 2.2.5
Jul 19 16:18:52 campaigns etcd[13475]: Git SHA: Not provided (use ./build instead of go build)
Jul 19 16:18:52 campaigns etcd[13475]: Go Version: go1.6.2
Jul 19 16:18:52 campaigns etcd[13475]: Go OS/Arch: linux/amd64
Jul 19 16:18:52 campaigns etcd[13475]: setting maximum number of CPUs to 2, total number of available CPUs is 2
Jul 19 16:18:52 campaigns etcd[13475]: error listing data dir: /var/lib/etcd/default
Jul 19 16:18:52 campaigns systemd[1]: etcd.service: Main process exited, code=exited, status=1/FAILURE
Jul 19 16:18:52 campaigns systemd[1]: Failed to start etcd - highly-available key value store.
Jul 19 16:18:52 campaigns systemd[1]: etcd.service: Unit entered failed state.
Jul 19 16:18:52 campaigns systemd[1]: etcd.service: Failed with result 'exit-code'.
dpkg: error processing package etcd (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 etcd
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@campaigns:/var/lib/dpkg/info# 

当我尝试安装任何东西时,我都会收到上述错误。我的 Ubuntu 版本是 16.04。

答案1

您的设置有问题locales。您可以使用以下命令解决:

$ sudo dpkg-reconfigure locales

从下拉列表中选择您的语言。我的语言是美式英语,因此我选择en_US.UTF-8 UTF-8

这将生成选定的语言环境和字符集。

笔记

使用计算机时,使用普通用户登录而不是 root 可能会避免很多问题。当您需要执行系统范围内的某项操作时,请通过在特定命令前加上前缀 来提升该命令的权限sudo。某些意外情况破坏了您的locale设置。

答案2

不幸的是,配置区域设置对我来说不起作用。最终对我有用的是:

sudo apt-get remove --purge etcd
sudo reboot now

重启完成后:

sudo apt-get install etcd

相关内容