ubuntu18安装salt(salt-master,salt-minion)报错的解决办法

公司机器有一批是全新安装的ubuntu18 server版本,有一部分是从原来的ubuntu16.04升级过来的,在使用apt安装程序的时候不相同,升级的那批有时候apt update 失败或者apt install时
失败。这个时候需要替换源,源包括 /etc/apt/sources.list 里的配置和/etc/apt/sources.list.d/下面的文件里的配置。
问题1: 在apt install salt-minion时,报i386不支持
解决方法是,在源文件里加入 [arch=amd64],加完后,如下配置:

root@sz-dev-vm-ubuntu69-64:/opt# cat  /etc/apt/sources.list.d/saltstack.list 
deb [arch=amd64]  http://repo.saltstack.com/apt/ubuntu/18.04/amd64/latest bionic main

问题2:报:

The following packages have unmet dependencies:
 salt-minion : Depends: python-zmq (>= 14.4.0) but it is not installable
               Depends: salt-common (= 2018.3.3+ds-2) but it is not going to be installed
               Recommends: debconf-utils but it is not installable
E: Unable to correct problems, you have held broken packages.

当前配置是:

oot@ubuntu18-ip54:~# cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu bionic main
deb http://archive.ubuntu.com/ubuntu bionic-security main
deb http://archive.ubuntu.com/ubuntu bionic-updates main
root@ubuntu18-ip54:~# cat /etc/apt/sources.list.d/saltstack.list 
deb [arch=amd64]  http://repo.saltstack.com/apt/ubuntu/18.04/amd64/latest bionic main

解决方法:修改 /etc/apt/sources.list,为:

root@ubuntu18:/etc/apt# cat sources.list
#deb http://archive.ubuntu.com/ubuntu bionic main
#deb http://archive.ubuntu.com/ubuntu bionic-security main
#deb http://archive.ubuntu.com/ubuntu bionic-updates main

deb http://archive.ubuntu.com/ubuntu/ bionic main restricted
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted
deb http://archive.ubuntu.com/ubuntu/ bionic universe
deb http://archive.ubuntu.com/ubuntu/ bionic-updates universe
deb http://archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-updates multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted
deb http://security.ubuntu.com/ubuntu/ bionic-security universe
deb http://security.ubuntu.com/ubuntu/ bionic-security multiverse
root@ubuntu18:/etc/apt# cat sources.list.d/saltstack.list 

root@ubuntu18-ip54:~# cat /etc/apt/sources.list.d/saltstack.list 
deb [arch=amd64]  http://repo.saltstack.com/apt/ubuntu/18.04/amd64/latest bionic main

之后,可成功安装。

在网上搜不到解决答案,所以记录下来,给遇到相同问题的小伙伴一点帮助。

转载于:https://blog.51cto.com/3881188/2337763

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值