问题:
在ubuntu18.04系统中下载ros,添加中科大ros源:
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
之后sudo apt-get update遇到的问题:
E: The repository 'http://mirrors.ustc.edu.cn/ros/ubuntu bionic Release' does not have a Release file.
solution:
工程使用的是中科大源。
(换源流程:使用 lsb_release -a 确定系统型号,在 https://mirrors.ustc.edu.cn/repogen/ 找到ubuntu18.04合适的源。将下面内容复制到/etc/apt/sources.list)
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse ## Not recommended # deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
ros 的源 在/etc/apt/sources.list.d/ros-latest.list中:
将以下内容复制到ros-latest.list里:
deb https://mirrors.ustc.edu.cn/ros/ubuntu/ bionic main
(注意:有些企业内网有限制,所以是https:不是http:)
然后sudo apt-get update,标题问题解决。
补充:
1.换源后 update 常见问题:
W: GPG error: https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64 InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC
sudo gpg --keyserver keyserver.ubuntu.com --recv A4B469963BF863CC
sudo gpg --export --armor A4B469963BF863CC | sudo apt-key add -
2.在安装ros过程中,不要升级 apt-get upgrade,否则会出错。
3.切换python版本:
update-alternatives --config python
4.ros melodic 与 python3 的问题:
roscore报缺少包:
ModuleNotFoundError: No module named 'rospkg'
ModuleNotFoundError: No module named 'netifaces'
依次安装:
pip3 install rospkg
pip3 install netifaces