How to fix ‘Unable to locate package’ error in apt-cyg

Ted James
1 min readApr 28, 2024

Im using Cygwin and I need to install a g++ compiler, so I tried with apt-cyg.

It returns an error that happens with some packages but not with others. For instance, I could install git package, which I found in blogs that talk about this topic to try it as an example. However, when trying g++:

$ apt-cyg install g++
Installing g++
Unable to locate package g++

What is going on?

Solution

First, I would suggest you use the standard Cygwin setup-x86_64.exe (or its 32-bit version if appropriate) rather than apt-cyg. Scanning the "Devel" category in setup, you will see a package gcc-g++, which is what you want.

Answered By — varro

Answer Checked By — Terry (FixIt Volunteer)

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

--

--

Ted James

The world is my office, and every destination is my inspiration