How to upgrade libpng in Amazon AWS using yum

amazon-web-servicesyum

I need at least libpng 1.5 installed in my server.

Client sysadmins (not reachable to me) installed my software on Amazon AWS and gave me root access.

Now this setup throws errors, that shared library libpng15 is not there.

# yum install libpng
Loaded plugins: priorities, update-motd, upgrade-helper
Package 2:libpng-1.2.49-2.14.amzn1.x86_64 already installed and latest version
Nothing to do

This is clearly wrong, there is a newer version

Even if Amazon considers this unsecure and unstable, is this possible to get this newer version 1.5 through yum somehow?

Best Answer

I would recommend finding a different way to resolve this. Adding a package from a different distro through YUM, especially when this package already exists, and it's a client's machine sounds... hazardous.

If you can get your client to use CentOS rather than Amazon Linux (a stretch, I guess), or if you can containerize your software these could likely be more robust solutions.

Consider explaining to your customer that this is will probably be a source of trouble otherwise. Create an AMI of the instance before doing any of these solutions.

Before choosing any of these solutions, you need to exclude the libpng package from it's current repo. Find out which repo it is by yum info libpng and then follow the instructions from https://www.cyberciti.biz/faq/rhel-fedora-centos-linux-yum-disable-certain-packages-from-being-installed/

1 You can find the appropriate Fedora Library from here: https://dl.fedoraproject.org/pub/fedora/ and add it's repo according to https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/add-repositories.html Add the include line in the .repo file according to https://www.digitalocean.com/community/tutorials/how-to-set-up-and-use-yum-repositories-on-a-centos-6-vps so as to only take the package you want.

2 You might want to look here: https://unix.stackexchange.com/questions/361148/how-to-add-fedora-repo-to-a-centos-7-installation for suggestions on how to rebuild from SRPM, and here: http://rpm.pbone.net/index.php3/stat/3/srodzaj/2/search/libpng-1.6.3 for the SRPM.

3 Or you can also take the binaries from here http://www.libpng.org/pub/png/libpng.html or here: http://mirror.centos.org/centos/7/os/x86_64/Packages/ and try them.