0

I want to install a game in Windows using Cygwin. When trying to use the sudo command, I receive the following error:

-bash:sudo:command not found

I get a similar error when trying to use command add-apt-repository:

unable to start "add-apt-repository" this specified file was not found

Why are these commands not recognized?

LawrenceC
  • 73,030
  • 15
  • 129
  • 214
lorias
  • 1
  • 1
  • 1
  • apt-get is Debian specific and afaik Cygwin uses it's own repos. Also install sudo via Cygwin installer. Be warned that what you want might not work, you definitely need to recompile the program you want to execute if it hasn't been already compiled for cygwin. – ljrk Apr 04 '16 at 14:21
  • 2
    Possible duplicate of [There's no 'sudo' command in Cygwin](http://superuser.com/questions/122418/theres-no-sudo-command-in-cygwin) – DavidPostill Apr 04 '16 at 16:26
  • The cygin package manager is [apt-cyg](https://github.com/transcode-open/apt-cyg) – DavidPostill Apr 04 '16 at 16:27

2 Answers2

2

You may have misunderstood what Cygwin is useful for. From their website:

Cygwin is not: a way to run native Linux apps on Windows. You must rebuild your application from source if you want it to run on Windows.

Packages like sudo do not exist in Cygwin. You can find available packages here.

They also have a detailed FAQ that plainly describes what it is, how it can be used, and so on.

root
  • 3,672
  • 7
  • 27
  • 45
0

I think I tried steps below after doing some research & succeeded (on Windows)

  1. Install scoop using powershell 3
    iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

  2. Do scoop install --global sudo

  3. Make sure paths (C:\Users\<username>\scoop\shims & C:\ProgramData\scoop\shims) added in environmental path variable.
Vylix
  • 1,716
  • 4
  • 22
  • 26