ubuntu初始环境配置ROS1
1.换源并更新数据库
ubuntu2004换源
# 备份原来的源并且另存
sudo cp -v /etc/apt/sources.list /etc/apt/sources.list.backup
# 执行chmod命令更改文件权限使软件源文件可编辑
sudo chmod 777 /etc/apt/sources.list
# 通过gedit命令编辑软件源:
sudo gedit /etc/apt/sources.list
# 执行上面命令后如果报sudo: gedit: command not found的错误,执行下面命令
sudo apt install vim vim /etc/apt/sources.list
打开源文件后,按 i 进入编辑模式将所有的代码删干净,然后复制粘贴你需要的镜像源,先按ECS键退出编辑,然后使用 :wq 命令退出编辑模式
换完源之后执行以下命令
sudo apt update
sudo apt upgrade
可复制如下的内容粘贴到sources.list中(复制其中一个源即可)
Ubuntu2004下装ROS1用下面这个
#添加阿里源
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
#添加清华源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse multiverse
----------------------------------------------------------------------------------------------------------------------------------------
阿里云国内源Ubuntu
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
阿里云国内源Ubuntu(包括预发布的源)
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
#源码镜像
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
2.清华大学源Ubuntu
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
说明:
main 官方支持,自由软件。
restricted官方支持,非完全自由软件。
universe非官方支持,社区维护的自由软件。
multiverse非官方支持,非自由软件。
focal-proposed 为预发布软件源(如果为了稳定性不建议添加到更新源中)
2.配置ROS1
版本对应
Ubuntu | ROS 1.0 | ROS 2.0 |
---|---|---|
16.04 LTS | Kinetic LTS | Ardent |
18.04 LTS | Melodic LTS | Dashing LTS |
20.04 LTS | Noetic LTS | Foxy LTS |
安装
- 配置公钥
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
- 系统更新
sudo apt-get update
- 安装ROS
# Ubuntu 20.04
sudo apt install ros-noetic-desktop-full
# Ubuntu 18.04
sudo apt install ros-melodic-desktop-full
- 配置(基于rosdepc)
sudo pip install rosdepc
如果显示没有pip可以试试pip3
sudo pip3 install rosdepc
如果pip3还没有
sudo apt-get install python3-pip
sudo pip install rosdepc -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
使用
sudo rosdepc init
rosdepc update
环境配置(注意自己的版本号)
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
安装 rosinstall
sudo apt install python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
3.安装终端多窗口分屏工具Terminator
下载:
sudo apt-get install terminator
运行:
terminator
常用快捷键:
Ctrl+Shift+E 垂直分割窗口
Ctrl+Shift+O 水平分割窗口
F11 全屏
Ctrl+Shift+C 复制
Ctrl+Shift+V 粘贴
Ctrl+Shift+N 或者 Ctrl+Tab 在分割的各窗口之间切换
Ctrl+Shift+X 将分割的某一个窗口放大至全屏使用
Ctrl+Shift+Z 从放大至全屏的某一窗口回到多窗格界面
4.安装vim
安装:
sudo apt install vim
确认vim版本(确认是否安装成功):
vim --version
标签:ubuntu2004,安装,universe,focal,ubuntu,main,multiverse,ROS1,restricted
From: https://www.cnblogs.com/hnu-hua/p/17531979.html