# Relocate an rpm

**URL:** <https://forum.ansible.com/t/relocate-an-rpm/16466>\
**Category:** Ansible Project\
**Created:** [October 8, 2014, 3:38pm UTC](https://forum.ansible.com/t/relocate-an-rpm/16466 "2014-10-08T15:38:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Morgan1](https://avatars.discourse-cdn.com/v4/letter/j/57b2e6/32.png) [@James\_Morgan1](https://forum.ansible.com/u/James_Morgan1)\
**Post date:** [October 8, 2014, 3:38pm UTC](https://forum.ansible.com/t/relocate-an-rpm/16466/1 "2014-10-08T15:38:41Z")

</div>

Hi,

I have a relocatable rpm that I would like to install into a different directory.

I have read that Yum doesn’t really support this and a solution with yum is to use

```auto
yum install XXX --downloadonly --downloaddir=/tmp

```

Then use rpm and --prefix

[http://research.cs.wisc.edu/htcondor/yum/#relocatable](http://research.cs.wisc.edu/htcondor/yum/#relocatable)

I was wondering if there was any way of doing this with the core yum module.

I appreciate that changing the install directory is not the best approach but I have customers with non-standard release directories.

My solution at the moment would be to use command and do things more manually for this pesky rpm.

Thanks

James

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [October 10, 2014, 4:47am UTC](https://forum.ansible.com/t/relocate-an-rpm/16466/2 "2014-10-10T04:47:56Z")

</div>

Yeah, the command module and either using yum --downloadonly or using  
yumdownloader (from the yum-utils package) followed by rpm is the way  
to go here. Adding a means for the yum module to download an rpm is  
probably a reasonable feature enhancement but it doesn't exist at the  
moment so the command module is the way to go.

-Toshio

---

<div class="post-metadata">

**Author:** ![James\_Morgan1](https://avatars.discourse-cdn.com/v4/letter/j/57b2e6/32.png) [@James\_Morgan1](https://forum.ansible.com/u/James_Morgan1)\
**Post date:** [October 15, 2014, 8:08am UTC](https://forum.ansible.com/t/relocate-an-rpm/16466/3 "2014-10-15T08:08:21Z")

</div>

Ok thanks for the reply. I’ll try and avoid doing it in the first place but if I can’t do that I’ll use one of the two options you mention.

I’ve already used yumdownloader elsewhere to build a custom repo.

Thanks
