1. 设置编码为utf-8
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8
2. 设置ubuntu清华源
参考:https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/
3. 设置ros2清华源
这一步和清华源上的操作不同,要注意。
新建 /etc/apt/sources.list.d/ros2-latest.list
,内容为:
deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu/ focal main
参考:
https://mirrors.tuna.tsinghua.edu.cn/help/ros2/
https://zhuanlan.zhihu.com/p/149187701
4. 更新索引
sudo apt install curl gnupg2
curl http://repo.ros2.org/repos.key | sudo apt-key add -