今天开发部门给我反映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清空,写入下面的一坨:
- 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
写入后,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
成功!