# Trying to install community. General unable to install facing error

**URL:** <https://forum.ansible.com/t/trying-to-install-community-general-unable-to-install-facing-error/7536>\
**Category:** Get Help\
**Tags:** community-general, collections, ansible-core, galaxy-ng\
**Created:** [July 29, 2024, 6:07pm UTC](https://forum.ansible.com/t/trying-to-install-community-general-unable-to-install-facing-error/7536 "2024-07-29T18:07:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shivani\_Gupta](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shivani_gupta/32/2724_2.png) [@Shivani\_Gupta](https://forum.ansible.com/u/Shivani_Gupta)\
**Post date:** [July 29, 2024, 6:07pm UTC](https://forum.ansible.com/t/trying-to-install-community-general-unable-to-install-facing-error/7536/1 "2024-07-29T18:07:51Z")

</div>

I try every method except tarball file which i don’t no how to install in rhel9 … If there is any cmd fle that help me

First step I tried is  
Ansible-galaxy collection install community. General  
Error:  
Process install dependency map  
WARNING]: Skipping Galaxy server [link same as below] Got an unexpected error when getting available versions ofcollection community.general: Unknown error men attempting to call Galaxy at 'https//galaxy.ansible.com/api/: curlopen error [Errno 2) Name or service not knowm\>. \<urlopen error [Errno 2) Name or service

ot known\> ROR! Unknown error when attempting to call sal curlepen error [Errno 21 Mane or service not known\>, \<urlopen error [Erine

Name or service not known

## Second method: using requirement file Requirements. Yml

Collections:  
- name: community.general

Change in config file  
[Server]  
Server= [https://galaxy.ansible.com/](https://galaxy.ansible.com/)

Same error as above  
Can someone help me with this?

Ansible-core 2.14.4

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [July 29, 2024, 9:13pm UTC](https://forum.ansible.com/t/trying-to-install-community-general-unable-to-install-facing-error/7536/2 "2024-07-29T21:13:26Z")

</div>

> [@Shivani\_Gupta](#):
>
> 'https//galaxy.ansible.com/api/: curlopen error [Errno 2) Name or service not known\>

`Name or service not known` means that DNS doesn’t resolve for the hostname, which in this case is literally `https//galaxy.ansible.com` (note the lack of colon, `:`)

The `Server= https://galaxy.ansible.com/` line probably should just be `Server= galaxy.ansible.com`

However, my config for ansible-core 2.16.9 looks more like this:

```auto
[galaxy]
server_list = galaxy

[galaxy_server.galaxy]
url = https://galaxy.ansible.com/api/

```

---

<div class="post-metadata">

**Author:** ![Shivani\_Gupta](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shivani_gupta/32/2724_2.png) [@Shivani\_Gupta](https://forum.ansible.com/u/Shivani_Gupta)\
**Post date:** [July 30, 2024, 6:09am UTC](https://forum.ansible.com/t/trying-to-install-community-general-unable-to-install-facing-error/7536/3 "2024-07-30T06:09:54Z")

</div>

[root@c]#ansible-galaxy collection install community.general

Starting galaxy collection install process

Process install dependency map

[WARNING]: Skipping Galaxy server [https://galaxy.ansible.com](https://galaxy.ansible.com). Got an unexpected error when getting available

versions of collection community.general: Unknown error when attempting to call Galaxy at ‘[Api Root – Django REST framework](https://galaxy.ansible.com/api/)’: \<urlopen error [Errno -2] Name or service not known\>. \<urlopen error [Errno-2] Name or service

not known\>

ERROR! Unknown error when attempting to call Galaxy at ‘[Api Root – Django REST framework](https://galaxy.ansible.com/api/)’: \<urlopen error [Errno Name or service not known\>. \<urlopen error [Errno 2) Name or service not known\>

[root@c~]# cd /etc/ansible; cat ansible.cfg

[defaults]

inventory /root/ip.txt

collections\_path=/.root/ansible/collections

[galaxy]

server\_list-galaxy

[galaxy\_server.galaxy)

I

url=[Api Root – Django REST framework](https://galaxy.ansible.com/api/)  
[root@c]# ansible-galaxy collection install -r requirements.yml

ERROR! The requirements file ‘/etc/ansible/requirements.yml’ does not exist.

[root@c ~]# ansible-galaxy collection install -r requirements.yml  
Starting galaxy collection install process

Process install dependency map

[WARNING]: Skipping Galaxy server [https://galaxy.ansible.com](https://galaxy.ansible.com). Got an unexpected error when getting available

versions of collection community.general: Unknown error when attempting to call Galaxy at ‘[Api Root – Django REST framework](https://galaxy.ansible.com/api/)’: \<urlopen error [Errno -2] Name or service not known\>. \<urlopen error [Errno-2] Name or service

not known\>

ERROR! Unknown error when attempting to call Galaxy at ‘[Api Root – Django REST framework](https://galaxy.ansible.com/api/)’: \<urlopen error [Errno Name or service not known\>. \<urlopen error [Errno 2) Name or service not known\>

## [root@c ~]# cat requirements.yml

collections:  
- name: community.general

Hi @Denney-tech thanks for ur reply i had make changes has per ur instructions

Even than also getting same error

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [July 30, 2024, 2:10pm UTC](https://forum.ansible.com/t/trying-to-install-community-general-unable-to-install-facing-error/7536/4 "2024-07-30T14:10:35Z")

</div>

> [@Shivani\_Gupta](#):
>
> [root@c~]# cd /etc/ansible; cat ansible.cfg
> 
> [defaults]
> 
> inventory /root/ip.txt
> 
> collections\_path=/.root/ansible/collections
> 
> [galaxy]
> 
> server\_list-galaxy
> 
> [galaxy\_server.galaxy)
> 
> I
> 
> url=[Api Root – Pulp 3](https://galaxy.ansible.com/api/)

That looks like there’s a few typos…

```ini
[defaults]
inventory /root/ip.txt
collections_path=/.root/ansible/collections

[galaxy]
server_list = galaxy # replaced '-' with '='

[galaxy_server.galaxy] # replaced ')' with ']'
# removed random 'I' character
url = https://galaxy.ansible.com/api/

```

That being said, since it still looks like a DNS issue (and the error output looks a little more sane), can you try testing with curl or nslookup?

`curl https://galaxy.ansible.com/api/` and `nslookup galaxy.ansible.com`

* * *

On another note, can you upgrade ansible-core to a supported version? Your version predates [the switch to new ansible galaxy](https://www.ansible.com/blog/new-ansible-galaxy/), and may contain bugs relating to the api changes (not that that explains the Name resolution errors). Additionally, ansible-core \<2.16 have reached end of life, and no longer receives any level of support.

---

<div class="post-metadata">

**Author:** ![Shivani\_Gupta](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shivani_gupta/32/2724_2.png) [@Shivani\_Gupta](https://forum.ansible.com/u/Shivani_Gupta)\
**Post date:** [July 31, 2024, 4:01am UTC](https://forum.ansible.com/t/trying-to-install-community-general-unable-to-install-facing-error/7536/5 "2024-07-31T04:01:11Z")

</div>

Hii @Denney-tech thanks for help really appreciate your help actually i did same has u instructor it just i pasted here little bit wrong  
Anyway i tried other method by downloading tar file for community. General it work for me…  
[Ansible Galaxy](https://galaxy.ansible.com/ui/repo/published/community/general/) from here  
And run

ansible-galaxy collection install community.genral .tar.file

Its work for me

Thanks for ur help 🙂

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [July 31, 2024, 1:37pm UTC](https://forum.ansible.com/t/trying-to-install-community-general-unable-to-install-facing-error/7536/6 "2024-07-31T13:37:31Z")

</div>

If downloading the tar files directly is satisfactory for you, that’s fine.

If you downloaded the tar from your ansible control node, then that should rule out DNS affecting `ansible-galaxy`. Upgrading `ansible-core` would have been my next suggestion. (also, you shouldn’t need to add `galaxy.ansible.com` to the ansible.cfg in the first place, since that’s the default… you would only need it if you were configuring multiple private galaxy/hub servers and still wanted to fail back to the public galaxy)

---

<div class="post-metadata">

**Author:** ![Shivani\_Gupta](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shivani_gupta/32/2724_2.png) [@Shivani\_Gupta](https://forum.ansible.com/u/Shivani_Gupta)\
**Post date:** [August 1, 2024, 4:01am UTC](https://forum.ansible.com/t/trying-to-install-community-general-unable-to-install-facing-error/7536/7 "2024-08-01T04:01:57Z")

</div>

How can i perform from ansible-core like what cmd and steps should i follow

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [August 1, 2024, 2:27pm UTC](https://forum.ansible.com/t/trying-to-install-community-general-unable-to-install-facing-error/7536/8 "2024-08-01T14:27:12Z")

</div>

Do you mean, how should you upgrade ansible-core? That’s a slightly complex question that I can’t give an exact answer to; partially because I have no idea what OS you have it installed on. I can give you some basic steps to follow though.

1. Remove the version of ansible-core that you have by undoing whatever install process you used. If you used the system’s package manager, then it would be something like `sudo yum/dnf/apt remove ansible-core`, but if you used python’s pip installer it would be `pip3 uninstall ansible-core`. There’s also `pipx` which is a wrapper for `pip` that automatically installs packages into venvs, but it is fairly new and I doubt that’s how you’ve installed ansible. It would be similarly uninstalled though with `pipx uninstall <venv-name>`. If you installed the “batteries included” `ansible` package, this should get autoremoved when `ansible-core` is removed.

2. Install a recent version of python (and pip). I recommend python 3.11, as there are some changes in \>=3.12 that are breaking changes for a number of things (not just in Ansible, but the broader python community). `sudo yum/dnf/apt install python3.11-pip`

3. Install ansible(-core) via pip from _one_ of the options below. You don’t have to restrict the ansible-core version, but I wanted to add it as an example.  
a. `pip3.11 install --user ansible-core # just core`  
b. `pip3.11 install --user ansible # "batteries included", includes ansible-core`  
c. `pip3.11 install --user ansible-core~=2.16.0 # restrict version to latest version of 2.16`  
d. `pip3.11 install --user ansible ansible-core~=2.16.0 # "batteries included" and restricts ansible-core dependency`

4. Upgrading ansible (for future reference) would simply be the same command you chose in step 3. with the `--upgrade` argument added.

* * *

Now that you’ve upgraded ansible-core to a more recent and supported version, you could try `ansible-galaxy collection install --upgrade community.general` to see if your original `Name or service not known` error has been resolved or not.
