重新安装ros出现的问题invalid packet (ctb=0a)解决方案

安装ros的教程在这里:
http://wiki.ros.org/kinetic/Installation/Ubuntu
在step 1.3中, 步骤如下:

sudo apt-key adv --keyserver ‘hkp://keyserver.ubuntu.com:80’ --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

出现了如下bug

(base) ubuntu@ubuntu:~$ sudo apt-key adv --keyserver ‘hkp://keyserver.ubuntu.com:80’ --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
Executing: /tmp/tmp.KICL3WniO8/gpg.1.sh --keyserver
hkp://keyserver.ubuntu.com:80
–recv-key
C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
gpg: requesting key AB17C654 from hkp server keyserver.ubuntu.com
gpg: [don’t know]: invalid packet (ctb=0a)
gpg: keydb_get_keyblock failed: eof
gpg: [don’t know]: invalid packet (ctb=0a)
gpg: /tmp/tmp.KICL3WniO8/pubring.gpg: copy to /tmp/tmp.KICL3WniO8/pubring.gpg.tmp' failed: invalid packet gpg: error writing keyring/tmp/tmp.KICL3WniO8/pubring.gpg’: invalid packet
gpg: [don’t know]: invalid packet (ctb=0a)
gpg: keydb_search failed: invalid packet
gpg: key AB17C654: public key “[User ID not found]” imported
gpg: error reading `[stream]’: invalid packet
gpg: Total number processed: 0
gpg: imported: 1 (RSA: 1)

这个问题出现的原因为:
你的系统中gpg keyring出现了损坏, 在我的电脑中,储存keyring的地方有:
file: /etc/apt/trusted.gpg
folder: /etc/apt/trusted.gpg.d/.
我将这个file和folder下所有的.gpg文件都删除掉了。然后使用了

sudo launchpad-getkeys

更新完所有的keyrings.
然后
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full
就不会出现因为缺少keyring而不能安装ros的现象了。

你可能感兴趣的:(算法)