A premade libcec deb

I’ve run across people who are interested in using libcec and would prefer to get started as soon as possible rather than going down the compile it up route.  For those people, you can download gzipped deb files from


Then gunzip the deb file and install

cd Downloads 
gunzip libcec_20150809-1_armhf.deb.gz 
sudo dpkg -i libcec_20150809-1_armhf.deb 
sudo ldconfig

A prerequisite is to have liblockdev1 installed.

sudo apt-get install liblockdev1
Tagged with: , ,
Posted in Uncategorized
20 comments on “A premade libcec deb
  1. Ted Barnes says:

    Great step forward, but I note it is only version 3.0.0, not 3.0.1 which seems to include some bug fixes. Any chance of an updated version?


  2. Ted Barnes says:

    Many thanks for the quick response, but unfortunately when I try overwriting version 3.0.0 and then run “cec-client -l” I get:

    “libcec.so.3.0: cannot open shared object file: No such file or directory”

    Also in the instructions you need a sudo in the “dpkg … ” line.



    • Ted Barnes says:

      Just tried the new version on a “virgin” Pi1 after doing complete update/upgrade sequence, and getting the same error message.



      • Hi Ted,

        I took the “short path” and remotely created the deb so I was unable to test it. Looks like that choice has bitten you. Oops. I’ll be a little more thorough tonight.


  3. Ted Barnes says:

    No problem Geoff – always happy to help those trying to make life easier for the less experienced.


    • The instructions have an extra line now “sudo ldconfig”. Give that a go. Really, the deb file should do this as a part of the install and one day I’ll put the time in to learn how to create a proper deb package.

      Best wishes,

      • Ted Barnes says:

        Sorry, the new instructions don’t seem to help on the Pi1 that I tried before. As it is just an extra action, I am assuming the fact that I tried before rather than going back to a clean build should not be the source of the problem.



  4. Ted Barnes says:

    Have just tried the new instructions on a clean build on my Pi2 – different error report, but still not there:

    “No device type given. Using ‘recording device’
    liblockdev.so.1: cannot open shared object file: No such file or directory
    Cannot load libcec.so”

    Not sure whether this reflects the Pi1/Pi2 difference, or the fact that it was a clean build.



    • The short version is that libcec needs liblockdev1 installed. Again, the libcec package really should list that as a dependency but at the moment doesn’t. The work around is to simply install liblockdev1 by

      sudo apt-get install liblockdev1

      If you are wondering how on earth do I know that, the answer is by working backwards from the error message. On my working machine I framed the question “what package provides the shared object file that Ted is missing”

      dpkg –search liblockdev.so.1

      which returns

      liblockdev1: /usr/lib/liblockdev.so.1

      If you keep sending me error messages, I’ll gather the list together and make a proper dpkg.

      Best wishes,

      • Ted Barnes says:

        That’s cleared the problem on both Pi’s – many thanks for that – but I am puzzled why the different error reports.

        One very minor nit-pick – cec-client reports ” git revision: “. I noticed this when I compiled it myself, but IIRC there was a value here in your posts concerning compiling Is this an error in the github files?

        Thanks again,


  5. Ted Barnes says:

    Oops – I pasted git revision “unknown”, but using greater/less than signs instead of quotation marks, but wordpress seems to have removed it!


  6. Thank you for this premade libcec. This is exactly what I’m looking for and it works fine on my pi.

  7. Dominic Afonso says:

    just got this installed and have run cec-client to see what i get. The remote buttons give me some feedback in my terminal so it looks like i’m good to go. I’d like to be able to turn my tv on from the pi but also control the pi with the tv remote. Any suggestions for getting started?

    • Hi Dominic,
      I’ve not tried this but a web search leads me to believe that

      /opt/vc/bin/tvservice -o
      /opt/vc/bin/tvservice -p

      will turn your tv off/on

      As for “controlling the pi” I’m not entirely sure of your use case. In my use cases I write C++ code that uses libcec. Then my program can react any way I want. For example I can write a game that uses the tv remote as an input device.

      This is the simplest C++ program that uses libcec that I know of:


      But maybe you were simply trying to use the tv buttons as a mouse replacement? If so, I’d believe it to be a feasible project but I haven’t done that myself.

      If you are new to programming in general, don’t go and try to use C or C++. Stick to python for a while. Python will be the easiest way to get using the RPi. I’m not trying to say never use C or C++, just that those languages have a larger barrier to entry.

      Good luck,

  8. Tilo Schulz says:

    To whom it may still concern. I needed to additionally install the package libudev0 to make the message “cannot open shared object file: No such file or directory
    Cannot load libcec.so” disappear.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: