Need help on 'Unmet dependencies' error when installing ROS Melodic
System: I'm running Ubuntu 18.04.6 64 bit with kernel 5.4.0-131-generic on Intel Core i5 CPU
Please help me successfully install ROS Melodic When following the installation guide for ROS Melodic the following encountered an error: (I have scoured the internet to find a solution, but nothing has worked!)
(base) sam@nexus:~$ sudo apt install ros-melodic-desktop-full
Reading package lists... Done
Building dependency tree
Reading state information... Done
ros-melodic-desktop-full is already the newest version (1.4.1-0bionic.20221025.215612).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
python-rosdep-modules : Depends: python-rospkg-modules (>= 1.4.0) but it is not going to be installed
python-rosdistro-modules : Depends: python-rospkg-
modules but it is not going to be installed
ros-melodic-rqt-gui : Depends: python-rospkg-modules but it is not going to be installed
ros-melodic-rqt-robot-monitor : Depends: python-rospkg-modules but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
============================ Then I tried:
(base) sam@nexus:~$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
efibootmgr libfwup1 libllvm9 linux-hwe-5.4-headers-5.4.0-124 linux-hwe-5.4-headers-5.4.0-125 linux-hwe-5.4-headers-5.4.0-126 linux-hwe-5.4-headers-5.4.0-128
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
python-rospkg-modules
The following NEW packages will be installed:
python-rospkg-modules
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
948 not fully installed or removed.
Need to get 0 B/24.0 kB of archives.
After this operation, 135 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 341929 files and directories currently installed.)
Preparing to unpack .../python-rospkg-modules_1.4.0-1_all.deb ...
Unpacking python-rospkg-modules (1.4.0-1) ...
dpkg: error processing archive /var/cache/apt/archives/python-rospkg-modules_1.4.0-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
Errors were encountered while processing:
/var/cache/apt/archives/python-rospkg-modules_1.4.0-1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
============================ Then I tried:
(base) sam@nexus:~$ sudo apt --fix-broken install python-rospkg-modules
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
efibootmgr libfwup1 libllvm9 linux-hwe-5.4-headers-5.4.0-124 linux-hwe-5.4-headers-5.4.0-125 linux-hwe-5.4-headers-5.4.0-126 linux-hwe-5.4-headers-5.4.0-128
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
python-rospkg-modules
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
948 not fully installed or removed.
Need to get 0 B/24.0 kB of archives.
After this operation, 135 kB of additional disk space will be used.
(Reading database ... 341929 files and directories currently installed.)
Preparing to unpack .../python-rospkg-modules_1.4.0-1_all.deb ...
Unpacking python-rospkg-modules (1.4.0-1) ...
dpkg: error processing archive /var/cache/apt/archives/python-rospkg-modules_1.4 ...