5

Final update

Similar issue has been reported here.

Discourse announcement: Build/CI failures with ros-testing repository enabled?


Update2

Actually, installation of ROS Melodic failed at the end in my case:

Errors were encountered while processing:
 /tmp/apt-dpkg-install-lRVV2P/0767-python-catkin-pkg-modules_0.4.22-1_all.deb
 /tmp/apt-dpkg-install-lRVV2P/0794-python-rospkg-modules_1.2.8-1_all.deb
 /tmp/apt-dpkg-install-lRVV2P/0796-python-rosdistro-modules_0.8.2-1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

More logs:

Selecting previously unselected package python-catkin-pkg-modules.
Preparing to unpack .../0767-python-catkin-pkg-modules_0.4.22-1_all.deb ...
Unpacking python-catkin-pkg-modules (0.4.22-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-lRVV2P/0767-python-catkin-pkg-modules_0.4.22-1_all.deb (--unpack):
 trying to overwrite '/usr/lib/python2.7/dist-packages/catkin_pkg/__init__.py', which is also in package python-catkin-pkg 0.3.9-1
Selecting previously unselected package python-rospkg-modules.
Preparing to unpack .../0794-python-rospkg-modules_1.2.8-1_all.deb ...
Unpacking python-rospkg-modules (1.2.8-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-lRVV2P/0794-python-rospkg-modules_1.2.8-1_all.deb (--unpack):
 trying to overwrite '/usr/lib/python2.7/dist-packages/rospkg/__init__.py', which is also in package python-rospkg 1.1.4-1
Selecting previously unselected package python-rosdistro-modules.
Preparing to unpack .../0796-python-rosdistro-modules_0.8.2-1_all.deb ...
Unpacking python-rosdistro-modules (0.8.2-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-lRVV2P/0796-python-rosdistro-modules_0.8.2-1_all.deb (--unpack):
 trying to overwrite '/usr/lib/python2.7/dist-packages/rosdistro/__init__.py', which is also in package python-rosdistro 0.6.6-1


Update

When faulty:

The following packages have unmet dependencies:
 python-rosinstall-generator : Depends: python-catkin-pkg (>= 0.1.28) but it is not going to be installed
                               Depends: python-pkg-resources but it is not going to be installed
                               Depends: python-rosdistro (>= 0.7.3) but it is not going to be installed
                               Depends: python-rospkg but it is not going to be installed
                               Depends: python-yaml but it is not going to be installed
                               Depends: python2 (< 2.8) but it is not installable
                               Depends: python2 (>= 2.7) but it is not installable
                               Depends: python2:any (>= 2.6.6-7~) but it is not installable
E: Unable to correct problems, you have held broken packages.
apt-cache policy python-rosinstall-generator
python-rosinstall-generator:
  Installed: (none)
  Candidate: 0.1.20-1
  Version table:
     0.1.20-1 500
        500 http://packages.ros.org/ros/ubuntu bionic/main amd64 Packages
        500 http://packages.ros.org/ros/ubuntu bionic/main i386 Packages
     0.1.13-3 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu bionic/universe i386 Packages
apt-cache policy python3-rosinstall-generator
python3-rosinstall-generator:
  Installed: (none)
  Candidate: 0.1.20-1
  Version table:
     0.1.20-1 500
        500 http://packages.ros.org/ros/ubuntu bionic/main amd64 Packages
        500 http://packages.ros.org/ros/ubuntu bionic/main i386 Packages
     0.1.13-3 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu bionic/universe i386 Packages

I have some issue to install the following package python-rosinstall-generator on Ubuntu 18.04 with apt:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies: python-rosinstall-generator : Depends: python2 (< 2.8) but it is not installable Depends: python2 (>= 2.7) but it is not installable Depends: python2:any (>= 2.6.6-7~) but it is not installable E: Unable to correct problems, you have held broken packages.

Since I am using Docker, I have an old image where python-rosinstall-generator has been successfully installed with apt install python-rosinstall-generator:

apt-cache depends python-rosinstall-generator
python-rosinstall-generator
  Depends: python
  Depends: python
  Depends: python-catkin-pkg
  Depends: python-pkg-resources
  Depends: python-rosdistro
  Depends: python-rospkg
  Depends: python-yaml
  Depends: <python:any>
    python:i386
    python
  Depends: <python-argparse>
    libpython2.7-stdlib
  Conflicts: python3-rosinstall-generator

After doing apt update in the Docker, it gives now:

apt-cache depends python-rosinstall-generator
python-rosinstall-generator
  Depends: python-catkin-pkg
  Depends: python-pkg-resources
  Depends: python-rosdistro
  Depends: python-rospkg
  Depends: python-yaml
  Depends: <python2>
  Depends: <python2>
  Depends: <python2:any>
  Depends: <python-argparse>
    libpython2.7-stdlib
  Conflicts: python3-rosinstall-generator

And python2 package cannot be installed:

apt install python2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python2' has no installation candidate

It looks like a recent update has broken something, and has introduced a python2 package dependency.


dockerfile

FROM ubuntu:18.04

ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --yes
build-essential
software-properties-common
pkg-config
cmake
g++

RUN add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"

RUN echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 RUN apt-get update && apt-get install --yes python-rosinstall-generator

Catree
  • 153
  • 1
    Does this answer your question? How do I enable the "Universe" repository? , also check all your repositories. I can't reproduce the issue on clean 18.04 LTS VM. – N0rbert Jun 25 '20 at 07:09
  • @N0rbert Did not work for me. I have added the commands used in the dockerfile. – Catree Jun 25 '20 at 07:27
  • Then docker-file is wrong. – N0rbert Jun 25 '20 at 07:28
  • dpkg --get-selections | grep hold returns blank. Using aptitude gives: The following packages have unmet dependencies: – Catree Jun 25 '20 at 07:56
  • `python-rosinstall-generator : Depends: python2 (< 2.8) which is a virtual package and is not provided by any available package
                               Depends: python2 (>= 2.7) which is a virtual package and is not provided by any available package
    
                               Depends: python2:any (>= 2.6.6-7~) which is a virtual package and is not provided by any available package
    
    

    The following actions will resolve these dependencies:

     Keep the following packages at their current version:
    
    1. python-rosinstall-generator [Not Installed]`
      
    – Catree Jun 25 '20 at 07:56

2 Answers2

2

It looks like that packages.ros.org repository provides python3-rosinstall-generator package which is not compatible with Ubuntu 18.04 LTS.

The container creation using Dockerfile without such repository is successful:

FROM ubuntu:18.04

ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --yes
build-essential
software-properties-common
pkg-config
cmake
g++

RUN apt-get update && apt-get install --yes python-rosinstall-generator

But installation of ros-melodic-desktop-full ends successfully using your original Dockerfile.

N0rbert
  • 99,918
  • Yes, I noticed that also when trying to shrink the dockerfile to reproduce the issue. – Catree Jun 25 '20 at 08:32
  • Unfortunately, I just realised that the installation of ROS Melodic failed at the end. Maybe I am doing something wrong, but I have given up. – Catree Jun 25 '20 at 13:21
  • @Catree, please verify the kernel compatibility. The installation of ROS is strongly dependent on the OS kernel version. – singrium Jun 25 '20 at 13:26
  • @singrium I believe my issue has been already reported here. So nothing to do except waiting for the new packaging. – Catree Jun 25 '20 at 14:44
  • One of my colleagues had issues with Ubuntu 18.04 and ROS installation, so he downgraded to Ubuntu 16.04 and ROS Kinetic. – singrium Jun 25 '20 at 14:47
  • 1
    @singrium Sorry but your colleagues issues do not seem related to my issues. My issue has already been reported and the fix will be available soon. Please refer to the link I have posted. – Catree Jun 25 '20 at 14:55
  • The link says the patch will be available soon via apt repos, that's great news. – singrium Jun 25 '20 at 15:00
0

One way to go around this issue may be to install it using pip package manager. Since you are using python2 for ROS, just try the following:

sudo apt install python-pip
sudo pip install -U rosdep rosinstall_generator vcstool rosinstall

This has worked for me. I hope this helps.

Aditya
  • 101