Search code examples
cygwinsudoyum

/usr/bin/sudo: Permission denied in cygwin when installing "libpng-dev"


I am getting the error as follows in cygwin

$ make
g++  -O3 -W -Wall -g  -c -o ImageIOpng.o ImageIOpng.cpp
ImageIOpng.cpp:19:17: fatal error: png.h: No such file or directory
compilation terminated.
make: *** [<builtin>: ImageIOpng.o] Error 1

After followin to this answer. png.h file not found - Linux,

I had error in the following,

$ sudo apt-get install libpng-dev
-bash: /usr/bin/sudo: Permission denied

I have read that in Linux, I don't need to write sudo, instead of that I can use yum. So, I have tried yum install. But, it says

 Traceback (most recent call last):
  File "/usr/bin/yum", line 22, in <module>
    import yummain
  File "/usr/share/yum/yummain.py", line 22, in <module>
    import clientStuff
  File "/usr/share/yum/clientStuff.py", line 18, in <module>
    import rpm
ImportError: No module named rpm

Almost, in every steps, I am getting errors. What was the problem? yum is very useful package, but it seems installed not correctly.I have installed yum-2.0.7.


Solution

  • To install package on cygwin you need to use its setup as downloaded by
    https://cygwin.com

    see
    https://cygwin.com/cygwin-ug-net/setup-net.html#setup-packages
    for how to select packages.

    yum will not work and please note that Cygwin is not Linux. Most things works in the same way but not all.