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