apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
更换源教程:
先备份
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
打开sources.list
sudo gedit /etc/apt/sources.list
原来内容全部删除替换这个
#阿里云源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
更新源
apt-get update
apt-get upgrade
一般更新报错就运行开始那段安装公钥
我的错误信息是Ubuntu更换阿里源时报错 由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32
(公钥要与错误的签名一致 如:3B4FE6ACC0B21F32)