RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Error when updating: Could not install package(s): libpng-dev

    Scheduled Pinned Locked Moved Help and Support
    libpng12-dev
    26 Posts 5 Posters 3.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • vbsV
      vbs
      last edited by

      I think you are right. I get this:

      vbs@wz-retro:~$ sudo apt install libpng-dev
      Paketlisten werden gelesen... Fertig
      Abhängigkeitsbaum wird aufgebaut.
      Statusinformationen werden eingelesen.... Fertig
      Hinweis: »libpng12-dev« wird an Stelle von »libpng-dev« gewählt.
      libpng12-dev ist schon die neueste Version (1.2.54-1ubuntu1.1).
      0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
      

      This
      Hinweis: »libpng12-dev« wird an Stelle von »libpng-dev« gewählt.

      means "libpng12-dev will be chosen instead of libpng-dev".

      So I guess the check in Retropie aims at libpng-dev while Ubuntu manages to map automatically to libpng12-dev. So the package is installed but Retropie claims it is not.

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by

        What does cat /etc/debian_version say ?

        1 Reply Last reply Reply Quote 0
        • vbsV
          vbs
          last edited by

          vbs@wz-retro:~$ cat /etc/debian_version
          stretch/sid
          
          mituM 1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator @vbs
            last edited by

            @vbs Ubuntu is lying, Debian Stretch contains libpng-dev. Of course, at the time 16.04 was cut, the stretch moniker was just in testing phase and a lot changed until the official Debian Stretch release was etched (June 2017).
            Either way, we'll see how we can handle that.

            BuZzB 1 Reply Last reply Reply Quote 0
            • BuZzB
              BuZz administrators @mitu
              last edited by

              @mitu this broke with recent version changes I merged. I remember now I mapped 16.04 to Jessie due to this but someone's correction switched it.

              Tbh though 16.04 is too old for us to support. Best to upgrade to last LTS.

              To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

              1 Reply Last reply Reply Quote 0
              • vbsV
                vbs
                last edited by

                Oh well, ok thanks. I will consider upgrading the machine at some point. Am I right that I can ignore the error for now since it is a false error anyway?

                BuZzB 1 Reply Last reply Reply Quote 0
                • BuZzB
                  BuZz administrators @vbs
                  last edited by

                  @vbs Update - I have changed the logic which should help, but you definitely should update as I cannot guarantee everything in RetroPie will work correctly (and you won't get the latest ES etc)

                  To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                  1 Reply Last reply Reply Quote 0
                  • vbsV
                    vbs
                    last edited by

                    @BuZz
                    Great, thanks! Didn't know I was stuck on that ES version due to Ubuntu 16. I will definetly upgrade soon! :)

                    1 Reply Last reply Reply Quote 0
                    • B
                      bernhard263
                      last edited by bernhard263

                      Here's what's happening:
                      Older Ubuntu and Debian versions only had libpng-dev as a virtual package that was physically provided by libpng12-dev. Newer Ubuntu and Debian versions have an actual package libpng-dev.
                      The problem is that the Retropie script doesn't just check for the presence of a (virtual) package, which would work fine in this case. Instead, it explicitly checks for a package status of "installed". However, virtual packages cannot be installed and thus never return the "installed" status. It's definitely possible to solve this by re-writing the function that checks for installed packages. I will post again when I found a solution.

                      Until then, here's a workaround:
                      Open RetroPie-Setup/scriptmodules/helpers.sh in a text editor, find the function hasPackage(), and add the following lines in it at the top:

                      	if [[ "$1" == "libpng-dev" ]]; then
                      		local out=$(dpkg-query -l $1 2>/dev/null)
                      		if [[ "$?" -eq 0 ]]; then
                      			return 0
                      		fi
                      	fi
                      

                      This will make it check if a package "libpng-dev" exists, physical or virtual, and if yes, consider it to be installed and exit the function.

                      BuZzB 1 Reply Last reply Reply Quote 0
                      • BuZzB
                        BuZz administrators @bernhard263
                        last edited by BuZz

                        @bernhard263 what are you trying to fix this on? Ubuntu 16.04?. Retropie already maps the PNG package to different packages based on distro version.

                        I don't recommend anyone uses the above changes really, and I am not aware of any issue currently.

                        To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                        B 1 Reply Last reply Reply Quote 0
                        • B
                          bernhard263 @BuZz
                          last edited by

                          @BuZz I'm running the Armbian distribution on a Banana Pi board, which is built on top of Ubuntu 16.04. Why do you not recommend this workaround? It solves the problem of not being able to install the emulator cores. I never said it's pretty, but it gets the job done.

                          BuZzB 1 Reply Last reply Reply Quote 0
                          • BuZzB
                            BuZz administrators @bernhard263
                            last edited by BuZz

                            @bernhard263 because you're specifying a "fix" for an unsupported board / os combo that requires editing of core files without even clarifying why it's needed to an 11 month old thread.

                            It's also not the best way to accomplish it.

                            To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                            1 Reply Last reply Reply Quote 0
                            • BuZzB
                              BuZz administrators
                              last edited by

                              BTW I wasn't aware there was still a mapping issue with libpng as I thought I had sorted it, but actually there's a small bug still in the rework - it maps correctly for Ubuntu 16.10 but not 16.04. I will correct the issue, but note this is an old version of Ubuntu and things are likely to break.

                              Also we don't support the Banana Pi board, so I assume you're running some fork ?

                              To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                              B 1 Reply Last reply Reply Quote 0
                              • B
                                bernhard263
                                last edited by

                                BuZz I'm sure that you as a developer know a better way to fix this. I am not an expert by any means. But you said Ubuntu 16.04 is not supported anymore, so there will be no official fix, I had to edit the script myself and that's what I came up with. I didn't call it a "fix", I know it's a hack. It's just a temporary workaround that allows the cores to be built. Until there is a better solution, it gets the job done, that is all. Maybe it helps someone who has the same problem.

                                BuZzB 1 Reply Last reply Reply Quote 0
                                • BuZzB
                                  BuZz administrators @bernhard263
                                  last edited by BuZz

                                  @bernhard263 There is an official fix - as it was a bug from before when I fixed this for 16.10 - I just resolved it. You will get a warning popup saying it's unsupported which needs updating also actually (just the wording probably).

                                  https://github.com/RetroPie/RetroPie-Setup/commit/2d7297d2d20f6acaff0d0e63eaceff0e65b526b4

                                  To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                                  1 Reply Last reply Reply Quote 0
                                  • B
                                    bernhard263 @BuZz
                                    last edited by

                                    @BuZz said in Error when updating: Could not install package(s): libpng-dev:

                                    BTW I wasn't aware there was still a mapping issue with libpng as I thought I had sorted it, but actually there's a small bug still in the rework - it maps correctly for Ubuntu 16.10 but not 16.04. I will correct the issue, but note this is an old version of Ubuntu and things are likely to break.

                                    Also we don't support the Banana Pi board, so I assume you're running some fork ?

                                    No, I'm running the normal RetroPie and RetroPie-Setup from the official git repository. I know the Banana Pi is not supported, but I believe this has nothing to do with it, it's just a general issue with Ubuntu 16.04, as the creator of this thread had a regular Intel PC and he was running into the same problem. Anyway, that's great that you will try to fix it, thank you. A permanent solution would be much better than a a hack.

                                    BuZzB 1 Reply Last reply Reply Quote 0
                                    • BuZzB
                                      BuZz administrators @bernhard263
                                      last edited by

                                      @bernhard263 It should already be fixed. See above link.

                                      To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                                      B 1 Reply Last reply Reply Quote 0
                                      • B
                                        bernhard263 @BuZz
                                        last edited by bernhard263

                                        @BuZz I have just tried it, works like a charm. Thank you! Something else I noticed, every time I'm running retropie-setup I now get a popup window saying "Raspbian/Debian Jessie and Ubuntu versions below 16.04 are no longer supported". Did you just add that? This did not happen before.

                                        BuZzB 1 Reply Last reply Reply Quote 0
                                        • BuZzB
                                          BuZz administrators @bernhard263
                                          last edited by BuZz

                                          @bernhard263 I mentioned that above.

                                          To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                                          1 Reply Last reply Reply Quote 1
                                          • B
                                            bhuthogg
                                            last edited by

                                            Hi I am having this same error showing on x86 I've run through the tutorial but used mint latest 32bit (using an old thin client) not sure what I can do can't get any emulators installed due to libpng-dev ....
                                            Thanks

                                            BuZzB 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.