I meet this issue too

So today I was attempting to change some things up on one of our servers and running a normal SaltStack highstate was timing out and causing the minion process to basically just hang. After some investigation looking over the logs in /var/log/salt/minion it was obvious the issue was with apt-get updating it’s package listings.

But that’s strange, this box is on Digital Ocean and they have their own local mirrors. Turns out it’s a fairly common scenario with Ubuntu + mirrors + badly configured proxies. If you’re seeing things like this in your logs:

W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/utopic/universe/source/Sources: Hash Sum mismatch
Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/utopic-updates/main/binary-amd64/Packages: Hash Sum mismatch
: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/utopic-updates/universe/binary-amd64/Packages: Hash Sum mismatch
E: Some index files failed to download. They have been ignored, or old ones used instead.
E: Couldn't rebuild package cache

There is a pretty easy fix. You just need to clear our your existing apt source caches and re-update like this:

rm /var/lib/apt/lists/*
rm /var/lib/apt/lists/partial/*
apt-get update

This totally solved the issue for me. Not only unlocking/unsticking apt, but also making subsequent apt calls a touch faster. Hope this helps someone else!

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值