31

I'm using Red Hat 5.4.

I have installed a package using yum the package was wireshark.

However, after it has installed. Where can I find the rpm package?

I would like to locate the actual wireshark.rpm package so that I can install it on another machine that is not connected to the Internet.

fixer1234
  • 27,064
  • 61
  • 75
  • 116
ant2009
  • 3,045
  • 17
  • 46
  • 53

4 Answers4

29

The rpm cache directory location can be found in /etc/yum.conf

cachedir=/var/cache/yum/$basearch/$releasever

You should change the $basearch and $releasever, values based on your red hat release version.

If you want to keep the rpm cache after installation the keep cache value should be set 1 in:

/etc/yum.conf

set

keepcache=1
Simon
  • 3,943
  • 2
  • 24
  • 40
Sreeranj
  • 291
  • 3
  • 2
25

Take a look under /var/cache/yum directory.

They should be there unless you have some kind of autocleanup going on. If you do, try this command:

find /var/cache/yum -iname '*.rpm' –

If there's nothing there, see the cachedir variable in /etc/yum.conf and check out what's the current directory for storing packages. It can also be that tmpwatch or some other daily cron cleanup has cleared the /var/cache/yum.

random
  • 14,638
  • 9
  • 54
  • 58
Janne Pikkarainen
  • 7,715
  • 1
  • 31
  • 32
11

You also can install the download only plugin for yum which causes the rpms to be downloaded to the cache directory but not installed.

yum install yum-plugin-downloadonly

Then use it with the --downloadonly flag.

yum install --downloadonly -y wireshark

Then you will find the rpms in the cache directory as set by your /etc/yum.conf

e.g cachedir=/var/tmp/yum/cache/$basearch/$releasever

Jacob Tomlinson
  • 221
  • 2
  • 5
  • 2
    in my case, i had to do `yum reinstall --downloadonly` – Jayen Jan 01 '16 at 03:56
  • 1
    Note that the package has to be not installed at the time (otherwise yum won't do anything) – wim Oct 28 '19 at 20:28
  • You can also download to a specific directory: `yum reinstall --downloadonly --downloaddir=SOME_DIR -y` – akom Jul 12 '21 at 21:09
2

I'm assuming you are using yum against a baseurl where rpm are downloaded in background. You can keep the downloaded rpm which are deleted automatically after installation.

vim /etc/yum/yum.conf

keepcache = 1 cachedir= /XXX/XXX ---> your choice

Now the downloaded rpm will be saved in the cachedir you selected. From that you can create your own repository.

Nura Pagla
  • 21
  • 1