Some index files failed to download, they have been ignored, or old ones used instead.的问题

今天开发部门给我反映apt-get update的时候报404错误,并且apt-get install xxx 不能安装软件,鼓捣了俩小时,最后临时解决了,先说临时解决办法:

sudo vim /etc/apt/sources.list  (要注意,有的系统里面是source.list,ubuntu 17.04是souces.list,多了个s)

(遇到这个问题脑海里第一时间想到的是源的问题,换ubuntu源后问题依旧,最后死马当活马医,换debian的源)

将sources.list清空,写入下面的一坨:

  1. deb http://mirrors.aliyun.com/debian wheezy main contrib non-free  
  2. deb-src http://mirrors.aliyun.com/debian wheezy main contrib non-free  
  3. deb http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free  
  4. deb-src http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free  
  5. deb http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free  
  6. deb-src http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free 

写入后,sudo apt-get update 

成功!

但是报了一坨这个:

W: GPG error: http://mirrors.aliyun.com/debian wheezy-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8B48AD6246925553 NO_PUBKEY 7638D0442B90D010

W: The repository 'http://mirrors.aliyun.com/debian wheezy-updates InRelease' is not signed.

N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.

N: See apt-secure(8) manpage for repository creation and user configuration details.

W: GPG error: http://mirrors.aliyun.com/debian-security wheezy/updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9D6D8F6BC857C906 NO_PUBKEY 8B48AD6246925553

W: The repository 'http://mirrors.aliyun.com/debian-security wheezy/updates InRelease' is not signed.

N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.

N: See apt-secure(8) manpage for repository creation and user configuration details.

W: GPG error: http://mirrors.aliyun.com/debian wheezy Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8B48AD6246925553 NO_PUBKEY 7638D0442B90D010 NO_PUBKEY 6FB2A1C265FFB764

W: The repository 'http://mirrors.aliyun.com/debian wheezy Release' is not signed.

N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.

N: See apt-secure(8) manpage for repository creation and user configuration details.

这能忍么,对于我这么追求完美的人,不能忍,最后找到永久解决的办法:

首先先把/var/lib/apt/lists 的文件备份一下 (养成备份的好习惯)

mkdir /var/lib/apt/list

cp -r /var/lib/apt/lists/* /var/lib/apt/list

然后删除/var/lib/apt/lists/文件夹下所有的文件

rm -rf  /var/lib/apt/lists/*

然后 打开/etc/apt/sources.list

vim /etc/apt/sources.list

写入阿里源

deb http://mirrors.aliyun.com/debian wheezy main contrib non-free

deb-src http://mirrors.aliyun.com/debian wheezy main contrib non-free

deb http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free

deb-src http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free

deb http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free

deb-src http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free

保存退出

:wq

最后 sudo apt-get update 

 成功!

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值