# Location of collections

**URL:** <https://forum.ansible.com/t/location-of-collections/5724>\
**Category:** Get Help\
**Tags:** ubuntu, collections\
**Created:** [May 10, 2024, 9:51am UTC](https://forum.ansible.com/t/location-of-collections/5724 "2024-05-10T09:51:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ioan](https://avatars.discourse-cdn.com/v4/letter/i/bc79bd/32.png) [@ioan](https://forum.ansible.com/u/ioan)\
**Post date:** [May 10, 2024, 9:51am UTC](https://forum.ansible.com/t/location-of-collections/5724/1 "2024-05-10T09:51:23Z")

</div>

Hello, eveybody.

On all of my **Ubuntu** hosts the location of my collections is **~/.ansible/collections/ansible\_collections/**

On one of my hosts there is an additional location at **/usr/lib/python3/dist-packages/ansible\_collections/**

How come this one host has collections in two places and what does Python have to do with it?

Thank you.

---

<div class="post-metadata">

**Author:** ![akira6592](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akira6592/32/222_2.png) [@akira6592](https://forum.ansible.com/u/akira6592)\
**Post date:** [May 10, 2024, 12:56pm UTC](https://forum.ansible.com/t/location-of-collections/5724/2 "2024-05-10T12:56:02Z")

</div>

@ioan Hello!

`~/.ansible/collections/ansible_collections/` is the [default location](https://docs.ansible.com/ansible/latest/collections_guide/collections_installing.html#installing-collections-with-ansible-galaxy) where `ansible-galaxy collection install` command install to.

And `/usr/lib/python3/dist-packages/ansible_collections/` is the location where installed collections by [ansible community package](https://pypi.org/project/ansible/) (ansible-core and [collections](https://docs.ansible.com/ansible/latest/collections/index.html)).

`~/.ansible/collections/ansible_collections/` is the preferred search target for the collection.

---

<div class="post-metadata">

**Author:** ![ioan](https://avatars.discourse-cdn.com/v4/letter/i/bc79bd/32.png) [@ioan](https://forum.ansible.com/u/ioan)\
**Post date:** [May 10, 2024, 1:23pm UTC](https://forum.ansible.com/t/location-of-collections/5724/3 "2024-05-10T13:23:22Z")

</div>

Thank you.

The host with two locations for the collections is a laptop that currently shows the following:

```auto
user@laptop:~$ ansible --version
ansible [core 2.12.10]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.8.10 (default, Nov 22 2023, 10:22:35) [GCC 9.4.0]
  jinja version = 2.10.1
  libyaml = True

```

At some point I installed the ansible package with the **apt install ansible** command.

On another host I executed once **apt install ansible** and got an **Ansible** version 2.10.8. Since I wanted a newer one, I uninstalled the **ansible** package and installed the **ansible-core** package with **apt install ansible-core** command, which got me **Ansible [core 2.16.4]**.

So I am assuming that I did the same on the laptop, as well and that the **/usr/lib/python3/dist-packages/ansible\_collections** is a leftover from executing the **apt install ansible** command. What do you think? Does this make sense?

Any idea how to properly remove the **/usr/lib/python3/dist-packages/ansible\_collections** directory?

---

<div class="post-metadata">

**Author:** ![akira6592](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akira6592/32/222_2.png) [@akira6592](https://forum.ansible.com/u/akira6592)\
**Post date:** [May 13, 2024, 2:45am UTC](https://forum.ansible.com/t/location-of-collections/5724/4 "2024-05-13T02:45:47Z")

</div>

@ioan Thank you for the information.

> as well and that the **/usr/lib/python3/dist-packages/ansible\_collections** is a leftover from executing the **apt install ansible** command.

I think yes.

If you don’t need ansible(-base) 2.10.8 installed by `apt install ansible`, you can remove `/usr/lib/python3/dist-packages/ansible` and `/usr/lib/python3/dist-packages/ansible_collections` diretory by `apt remove ansible`.

---

<div class="post-metadata">

**Author:** ![ioan](https://avatars.discourse-cdn.com/v4/letter/i/bc79bd/32.png) [@ioan](https://forum.ansible.com/u/ioan)\
**Post date:** [May 13, 2024, 5:52am UTC](https://forum.ansible.com/t/location-of-collections/5724/5 "2024-05-13T05:52:55Z")

</div>

Thank you, dear Akira.

Your advice worked.

Due to some experience with another host, I thought that the **ansible** and **ansible-core** packages could not be installed simulatenously. It turns out that, actually, these two _were_ installed at the same time on my laptop, hence the two **ansible\_collections** directories.

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [May 13, 2024, 6:11am UTC](https://forum.ansible.com/t/location-of-collections/5724/6 "2024-05-13T06:11:33Z")

</div>

ansible \>= 3.0.0 and ansible-core can be installed at the same time. Actually if you install ansible \>= 3.0.0, it will always install ansible-core as a dependency.

---

<div class="post-metadata">

**Author:** ![ioan](https://avatars.discourse-cdn.com/v4/letter/i/bc79bd/32.png) [@ioan](https://forum.ansible.com/u/ioan)\
**Post date:** [May 13, 2024, 6:23am UTC](https://forum.ansible.com/t/location-of-collections/5724/7 "2024-05-13T06:23:48Z")

</div>

Thank you, Felix.

I appreciate it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [June 12, 2024, 6:24am UTC](https://forum.ansible.com/t/location-of-collections/5724/8 "2024-06-12T06:24:09Z")

</div>

Closed on June 12, 2024, 6:24am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
