侧边栏壁纸
博主头像
枕头下放双臭袜子博主等级

今我何功德,曾不事农桑

  • 累计撰写 166 篇文章
  • 累计创建 32 个标签
  • 累计收到 0 条评论

apt-get update报错the public key is not available

枕头下放双臭袜子
2021-10-08 / 0 评论 / 0 点赞 / 386 阅读 / 1,673 字 / 正在检测是否收录...

ubuntu 更新升级命令

# 取得远端更新服务器的套件档案清单
sudo apt-get update 

# 更新套件
sudo apt-get -y dist-upgrade

# 清除更新时所下载到本地的更新(安装)档案
sudo apt-get clean

# 自动清除更新后用不到的旧版本档案
sudo apt-get autoremove

# 若不定时移除旧核心档案,容易造成/boot空间不足,严重时将无法开机

ubuntu apt 源列表文件位置

/etc/apt/sources.list

ubuntu主机添加或者修改源以后,使用apt-get update时,可能会报该错如下:

# apt-get update 
Hit:1 http://mirrors.cloud.aliyuncs.com/ubuntu xenial InRelease
Hit:2 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates InRelease                
Hit:3 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security InRelease               
Err:4 https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FEEA9169307EA071  NO_PUBKEY 8B57C5C2836F4BEB
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FEEA9169307EA071  NO_PUBKEY 8B57C5C2836F4BEB
W: Failed to fetch https://mirrors.aliyun.com/kubernetes/apt/dists/kubernetes-xenial/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FEEA9169307EA071  NO_PUBKEY 8B57C5C2836F4BEB
W: Some index files failed to download. They have been ignored, or old ones used instead

这是由于etc/apt/sources.list提供的源没有提供公钥,所以更新软件源失败

解决

# 导入报错中提示缺少的公钥
# apt-key adv --recv-keys --keyserver keyserver.ubuntu.com XXXXXXXXX
0

评论