解决Ubuntu ROS 设置环境变量source ~/.bashrc失败,source未找到命令 source: command not found

在安装ROS-kinetic版本时,设置环境变量

echo “source opt/ros/kinetic/setup.bash”>> ~/.bashrc

source ~/.bashrc

后,出现source: command not found

解决办法:

Home文件下的隐藏文件bashrc,双机打开,找到文件末尾,

在这里插入图片描述

将"source opt/ros/kinetic/setup.bash"命令前后的“”去掉,即可解决问题。

即将echo命令行的中的“”去除,再运行。

echo source opt/ros/kinetic/setup.bash >> ~/.bashrc

source ~/.bashrc

运行不出错

bash: /home/ros/catkin_ws/devel/setup.bash: 没有那个文件或目录 bash: /home/ros/catkin_ws/devel/setup.bash: 没有那个文件或目录 ros@ros-virtual-machine:~$ mkdir -p catkin_ws/src ros@ros-virtual-machine:~$ cd catkin_ws/src ros@ros-virtual-machine:~/catkin_ws/src$ catkin_create_pkg learn_topic std_msgs rospy roscpp Created file learn_topic/package.xml Created file learn_topic/CMakeLists.txt Created folder learn_topic/include/learn_topic Created folder learn_topic/src Successfully created files in /home/ros/catkin_ws/src/learn_topic. Please adjust the values in package.xml. ros@ros-virtual-machine:~/catkin_ws/src$ cd .. ros@ros-virtual-machine:~/catkin_ws$ catkin_make Base path: /home/ros/catkin_ws Source space: /home/ros/catkin_ws/src Build space: /home/ros/catkin_ws/build Devel space: /home/ros/catkin_ws/devel Install space: /home/ros/catkin_ws/install Creating symlink "/home/ros/catkin_ws/src/CMakeLists.txt" pointing to "/opt/ros/noetic/share/catkin/cmake/toplevel.cmake" #### #### Running command: "cmake /home/ros/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/ros/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/ros/catkin_ws/install -G Unix Makefiles" in "/home/ros/catkin_ws/build" #### -- The C compiler identification is GNU 9.4.0 -- The CXX compiler identification is GNU 9.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Using CATKIN_DEVEL_PREFIX: /home/ros/catkin_ws/devel -- Using CMAKE_PREFIX_PATH: /opt/ros/noetic -- This workspace overlays: /opt/ros/noetic -- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.10", minimum re
03-26
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值