error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory

I was gettnig error mentioned below

“error while loading shared libraries: libasound.so.2:” on Centos 7 OS

yum -y install alsa-lib-devel fixed the issue

yum -y install alsa-lib-devel
Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile

  • EA4: 208.74.123.61
  • cpanel-addons-production-feed: 208.74.123.61
  • cpanel-plugins: 208.74.123.61
  • base: www.gtlib.gatech.edu
  • epel: mirror.oss.ou.edu
  • extras: mirror.dal10.us.leaseweb.net
  • nux-dextop: mirror.li.nux.ro
  • updates: mirror.dal10.us.leaseweb.net
    Resolving Dependencies
    –> Running transaction check
    —> Package alsa-lib-devel.x86_64 0:1.1.8-1.el7 will be installed
    –> Processing Dependency: alsa-lib = 1.1.8-1.el7 for package: alsa-lib-devel-1.1.8-1.el7.x86_64
    –> Processing Dependency: libasound.so.2()(64bit) for package: alsa-lib-devel-1.1.8-1.el7.x86_64
    –> Running transaction check
    —> Package alsa-lib.x86_64 0:1.1.8-1.el7 will be installed
    –> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================================================

Package Arch Version Repository Size

Installing:
alsa-lib-devel x86_64 1.1.8-1.el7 base 963 k
Installing for dependencies:
alsa-lib x86_64 1.1.8-1.el7 base 425 k

Transaction Summary

Install 1 Package (+1 Dependent package)

Total download size: 1.4 M
Installed size: 15 M
Downloading packages:
(1/2): alsa-lib-1.1.8-1.el7.x86_64.rpm | 425 kB 00:00:00

(2/2): alsa-lib-devel-1.1.8-1.el7.x86_64.rpm | 963 kB 00:00:00

Total 3.5 MB/s | 1.4 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : alsa-lib-1.1.8-1.el7.x86_64 1/2
Installing : alsa-lib-devel-1.1.8-1.el7.x86_64 2/2
Verifying : alsa-lib-1.1.8-1.el7.x86_64 1/2
Verifying : alsa-lib-devel-1.1.8-1.el7.x86_64 2/2

Installed:
alsa-lib-devel.x86_64 0:1.1.8-1.el7

Dependency Installed:
alsa-lib.x86_64 0:1.1.8-1.el7

Complete!
[root@ok1061 yum.repos.d]#
[root@ok1061 yum.repos.d]#
[root@ok1061 yum.repos.d]# ffmpeg -version
ffmpeg version 2.8.15 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-36)
configuration: –prefix=/usr –bindir=/usr/bin –datadir=/usr/share/ffmpeg –incdir=/usr/include/ffmpeg –libdir=/usr/lib64 –mandir=/usr/share/man –arch=x86_64 –optflags=’-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong –param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic’ –extra-ldflags=’-Wl,-z,relro ‘ –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libvo-amrwbenc –enable-version3 –enable-bzlib –disable-crystalhd –enable-gnutls –enable-ladspa –enable-libass –enable-libcdio –enable-libdc1394 –enable-libfdk-aac –enable-nonfree –disable-indev=jack –enable-libfreetype –enable-libgsm –enable-libmp3lame –enable-openal –enable-libopenjpeg –enable-libopus –enable-libpulse –enable-libschroedinger –enable-libsoxr –enable-libspeex –enable-libtheora –enable-libvorbis –enable-libv4l2 –enable-libx264 –enable-libx265 –enable-libxvid –enable-x11grab –enable-avfilter –enable-avresample –enable-postproc –enable-pthreads –disable-static –enable-shared –enable-gpl –disable-debug –disable-stripping –shlibdir=/usr/lib64 –enable-runtime-cpudetect
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
[root@ok1061 yum.repos.d]#