解决ros-melodic打包package为deb安装包问题
安装依赖
1
| sudo apt install python-bloom python-rosdep fakeroot debhelper dh-python
|
rosdep init失败
打开host及相关文件进行修改
在ipv4的部分加入
1 2 3 4 5 6 7 8
| 185.199.108.133 raw.githubusercontent.com
185.199.109.133 raw.githubusercontent.com
185.199.110.133 raw.githubusercontent.com
185.199.111.133 raw.githubusercontent.com
|
再次运行sudo rosdep init,需要多尝试几次
rosdep update报错
通过git clone将安装包下载
1 2
| git clone git@github.com:ros/rosdistro.git
|
修改rep3.py
进入路径
1
| cd /usr/lib/python2.7/dist-packages
|
修改文件
1
| sudo gedit rosdep2/rep3.py
|
将原来的 REP3_TARGETS_URL = ‘https://raw.githubusercontent.com/ros/rosdistro/master/releases/targets.yaml’用 # 注释掉,修改成以下代码,主要是把你的文件路径进行替换,下面的文件路径是我装的时候的路径
将
1
| REP3_TARGETS_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/releases/targets.yaml'
|
替换为
1 2
| REP3_TARGETS_URL = 'file:///opt/rosdistro/releases/targets.yaml'
|
其中/opt/rosdistro为rosdistro文件所在路径,根据文件所在位置改成自己的路径
修改sources_list.py
1 2
| sudo gedit rosdep2/sources_list.py
|
将
1
| DEFAULT_SOURCES_LIST_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list'
|
替换为
1 2
| DEFAULT_SOURCES_LIST_URL = 'file:///opt/rosdistro/rosdep/sources.list.d/20-default.list'
|
修改init.py
进入路径
1
| cd /usr/lib/python2.7/dist-packages/rosdistro
|
将
1
| DEFAULT_INDEX_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml'
|
替换为
1 2
| DEFAULT_INDEX_URL = 'file:///opt/rosdistro/index-v4.yaml'
|
修改20-default.list
1 2
| cd /etc/ros/rosdep/sources.list.d
|
1 2
| sudo gedit 20-default.list
|
将
1 2 3 4 5 6 7 8 9 10 11
| yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml gbpdistro https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte
|
替换为
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
yaml file:///opt/rosdistro/rosdep/osx-homebrew.yaml osx
yaml file:///opt/rosdistro/rosdep/base.yaml
yaml file:///opt/rosdistro/rosdep/python.yaml
yaml file:///opt/rosdistro/rosdep/ruby.yaml
gbpdistro file:///opt/rosdistro/releases/fuerte.yaml fuerte
|
rosdep update
1
| rosdep update --include-eol-distros
|
Build the debian from the package
1
| bloom-generate rosdebian --os-name ubuntu --ros-distro melodic
|
1
| fakeroot debian/rules binary
|