Lirc fails to install

I attached an IR sensor to my RPi3 but the installation of lirc fails:

root@osmcwohn:/etc/lirc# apt-get install lirc
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libftdi1 liblircclient0
Suggested packages:
  lirc-x setserial ir-keytable
The following packages will be REMOVED:
  armv7-eventlircd-osmc armv7-lirc-osmc armv7-remote-osmc rbp2-device-osmc
The following NEW packages will be installed:
  libftdi1 liblircclient0 lirc
0 upgraded, 3 newly installed, 4 to remove and 0 not upgraded.
Need to get 0 B/398 kB of archives.
After this operation, 403 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 23043 files and directories currently installed.)
Removing rbp2-device-osmc (1.3.8) ...
WARNING: You have tried to remove a package that is essential to OSMC's operation.
To undo these changes, run 'sudo apt-get -f install'.
dpkg: error processing package rbp2-device-osmc (--remove):
 subprocess installed pre-removal script returned error exit status 1
dpkg: armv7-lirc-osmc: dependency problems, but removing anyway as you requested:
 armv7-remote-osmc depends on armv7-lirc-osmc.
 armv7-eventlircd-osmc depends on armv7-lirc-osmc.

Removing armv7-lirc-osmc (0.9.0-5) ...
dpkg: armv7-remote-osmc: dependency problems, but removing anyway as you requested:
 rbp2-device-osmc depends on armv7-remote-osmc.

Removing armv7-remote-osmc (1.2.1) ...
Removing 'diversion of /etc/lirc/lircd.conf to /etc/lirc/lircd.conf.distributed by armv7-remote-osmc'
Removing armv7-eventlircd-osmc (1.2.0) ...
Errors were encountered while processing:
 rbp2-device-osmc
E: Sub-process /usr/bin/dpkg returned an error code (1)

Afterwards I fixed it via

root@osmcwohn:/etc/lirc# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  armv7-eventlircd-osmc armv7-lirc-osmc armv7-remote-osmc
The following NEW packages will be installed:
  armv7-eventlircd-osmc armv7-lirc-osmc armv7-remote-osmc
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1886 kB of archives.
After this operation, 1709 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Selecting previously unselected package armv7-lirc-osmc.
(Reading database ... 22907 files and directories currently installed.)
Preparing to unpack .../armv7-lirc-osmc_0.9.0-5_armhf.deb ...
Unpacking armv7-lirc-osmc (0.9.0-5) ...
Selecting previously unselected package armv7-eventlircd-osmc.
Preparing to unpack .../armv7-eventlircd-osmc_1.2.0_armhf.deb ...
Unpacking armv7-eventlircd-osmc (1.2.0) ...
Selecting previously unselected package armv7-remote-osmc.
Preparing to unpack .../armv7-remote-osmc_1.2.1_armhf.deb ...
Adding 'diversion of /etc/lirc/lircd.conf to /etc/lirc/lircd.conf.distributed by armv7-remote-osmc'
Unpacking armv7-remote-osmc (1.2.1) ...
Setting up armv7-lirc-osmc (0.9.0-5) ...
Setting up armv7-eventlircd-osmc (1.2.0) ...
Setting up armv7-remote-osmc (1.2.1) ...

System info:
Linux osmcwohn 4.4.27-9-osmc #1 SMP PREEMPT Tue Mar 14 20:54:19 UTC 2017 armv7l GNU/Linux

OSMC already provides lirc. Why not describe the actual issue you are experiencing and provide logs?

Hi,

Lirc is already installed by default. I can already see it installed and running on my system.

     lircd_helper@lirc0.service - lircd remote support
   Loaded: loaded (/lib/systemd/system/lircd_helper@.service; static)
   Active: active (running) since Sun 2017-04-30 22:07:45 BST; 14h ago
  Process: 323 ExecStart=/bin/sh -c /var/run/lirc/lircd-%I.sh (code=exited, status=0/SUCCESS)
 Main PID: 332 (lircd)
   CGroup: /system.slice/system-lircd_helper.slice/lircd_helper@lirc0.service
           └─332 /usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinpu.

So you don’t to install it.

I’ve just done a search of forum and found a couple of tickets which should help you setup your remote:

You seem to have also removed some packages that are dependencies and installed packages that will probably cause a conflict. You could go through and reinstall the removed packages that are listed above and uninstall the new packages, but it maybe easier to re-image.

Thanks Tom.