[Solved] How to resolve conflict between Nuitrack and ROS packages? (problem with openni-utils)

Hi, I am running an Ubuntu 16.04 PC with Intel RealSense D415.

After installing Nuitrack and RealSense, my team decided to install ROS for project purposes.
We’ve attempted to install the following ROS packages. Here are the error messages:

sudo apt-get install ros-kinetic-joy ros-kinetic-teleop-twist-joy ros-kinetic-teleop-twist-keyboard ros-kinetic-laser-proc ros-kinetic-rgbd-launch ros-kinetic-depthimage-to-laserscan ros-kinetic-rosserial-arduino ros-kinetic-rosserial-python ros-kinetic-rosserial-server ros-kinetic-rosserial-client ros-kinetic-rosserial-msgs ros-kinetic-amcl ros-kinetic-map-server ros-kinetic-move-base ros-kinetic-urdf ros-kinetic-xacro ros-kinetic-compressed-image-transport ros-kinetic-rqt-image-view ros-kinetic-gmapping ros-kinetic-navigation ros-kinetic-interactive-markers
Reading package lists… Done
Building dependency tree
Reading state information… Done
ros-kinetic-compressed-image-transport is already the newest version (1.9.5-0xenial-20191214-091745+0000).
ros-kinetic-compressed-image-transport set to manually installed.
ros-kinetic-interactive-markers is already the newest version (1.11.5-1xenial-20200406-132203+0000).
ros-kinetic-interactive-markers set to manually installed.
ros-kinetic-rqt-image-view is already the newest version (0.4.14-1xenial-20200229-052458+0000).
ros-kinetic-urdf is already the newest version (1.12.12-0xenial-20191214-074930+0000).
ros-kinetic-urdf set to manually installed.
ros-kinetic-xacro is already the newest version (1.11.3-0xenial-20191214-075015+0000).
ros-kinetic-xacro set to manually installed.
You might want to run ‘apt-get -f install’ to correct these:
The following packages have unmet dependencies:
libopenni-sensor-pointclouds0 : Depends: openni-utils but it is not going to be installed
ros-kinetic-gmapping : Depends: ros-kinetic-openslam-gmapping but it is not going to be installed
ros-kinetic-joy : Depends: joystick but it is not going to be installed
ros-kinetic-map-server : Depends: libsdl-image1.2 (>= 1.2.10) but it is not going to be installed
Depends: libsdl1.2debian (>= 1.2.11) but it is not going to be installed
Depends: libbullet-dev but it is not going to be installed
Depends: libsdl-image1.2-dev but it is not going to be installed
Depends: libsdl1.2-dev but it is not going to be installed
ros-kinetic-move-base : Depends: ros-kinetic-base-local-planner but it is not going to be installed
Depends: ros-kinetic-clear-costmap-recovery but it is not going to be installed
Depends: ros-kinetic-costmap-2d but it is not going to be installed
Depends: ros-kinetic-move-base-msgs but it is not going to be installed
Depends: ros-kinetic-nav-core but it is not going to be installed
Depends: ros-kinetic-navfn but it is not going to be installed
Depends: ros-kinetic-rotate-recovery but it is not going to be installed
ros-kinetic-navigation : Depends: ros-kinetic-base-local-planner but it is not going to be installed
Depends: ros-kinetic-carrot-planner but it is not going to be installed
Depends: ros-kinetic-clear-costmap-recovery but it is not going to be installed
Depends: ros-kinetic-costmap-2d but it is not going to be installed
Depends: ros-kinetic-dwa-local-planner but it is not going to be installed
Depends: ros-kinetic-fake-localization but it is not going to be installed
Depends: ros-kinetic-global-planner but it is not going to be installed
Depends: ros-kinetic-move-base-msgs but it is not going to be installed
Depends: ros-kinetic-move-slow-and-clear but it is not going to be installed
Depends: ros-kinetic-nav-core but it is not going to be installed
Depends: ros-kinetic-navfn but it is not going to be installed
Depends: ros-kinetic-robot-pose-ekf but it is not going to be installed
Depends: ros-kinetic-rotate-recovery but it is not going to be installed
Depends: ros-kinetic-voxel-grid but it is not going to be installed
ros-kinetic-rosserial-arduino : Depends: arduino-core but it is not going to be installed
E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).

After a bunch of dependency errors, I did as the error said.

sudo apt-get -f install

Reading package lists… Done
Building dependency tree
Reading state information… Done
Correcting dependencies… Done
The following package was automatically installed and is no longer required:
snapd-login-service
Use ‘sudo apt autoremove’ to remove it.
The following additional packages will be installed:
openni-utils
The following NEW packages will be installed:
openni-utils
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
823 not fully installed or removed.
Need to get 0 B/113 kB of archives.
After this operation, 460 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database … 293729 files and directories currently installed.)
Preparing to unpack …/openni-utils_1.5.4.0-14_amd64.deb …
Unpacking openni-utils (1.5.4.0-14) …
dpkg: error processing archive /var/cache/apt/archives/openni-utils_1.5.4.0-14_amd64.deb (–unpack):
trying to overwrite ‘/usr/bin/niReg’, which is also in package nuitrack 0.30.0
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for man-db (2.7.5-1) …
Errors were encountered while processing:
/var/cache/apt/archives/openni-utils_1.5.4.0-14_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Now, I am no longer able to do sudo apt-get upgrade:

sudo apt-get upgrade
[sudo] password for huegi:
Reading package lists… Done
Building dependency tree
Reading state information… Done
You might want to run ‘apt-get -f install’ to correct these.
The following packages have unmet dependencies:
libopenni-sensor-pointclouds0 : Depends: openni-utils but it is not installed
E: Unmet dependencies. Try using -f.

Since all of the error messages include ‘openni-utils’, I’m guessing there’s a problem with this package.
I’ve tried this all over again (from Ubuntu installation) and the same thing happens.
How should I solve this problem? Please help!

We solved the problem.
We’ve backed up the files, reinstalled Ubuntu, installed ROS first and then installed Nuitrack.