How to create RPM fron installed packages?

I need to install a package I have in one computer, in another one, but the package is no longer available on-line?
Can anyone tell me how to create a RPM from an already installed package?

Please post the steps, since i’m not a programmer.

Thank You

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I can probably get you close, but you should find the original RPM or keep
a copy next time.

rpm -ql <packageNameHere> | xargs tar -zcvf /tmp/program.tgz

Once done copy the /tmp/program/tgz to your destination box, change to /
in the filesystem (the filesystem root), and run the following command:

tar -zxvf /path/to/your/program.tgz

Hopefully all will be installed properly, though it’s possible the RPM
does things that is not just part of its contained files, which is why you
need the original.

Good luck.

cepiolidus wrote:
> I need to install a package I have in one computer, in another one, but
> the package is no longer available on-line?
> Can anyone tell me how to create a RPM from an already installed
> package?
>
> Please post the steps, since i’m not a programmer.
>
> Thank You
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIcBAEBAgAGBQJKV+bfAAoJEF+XTK08PnB5z/oP+wbgXBQmY53sKEh4cwz4ZLX5
cPpKZVkZdp+AnXBeLdbNvc6EIzYkMFUDSgaoD/J2102rPH7wsZAOBxPHZAtpcQcj
SM+XzgHS78aCTwu9nmKUGgYwSwtVVcaI/+Je7vYlOCKYxOtT7Io1y2ioB4Fb+Nuo
NgMQUJvoKNpTMbzLEydygaL92RVSu5wISHgG54822dEgKI2zMwHRaULGIY40oXH/
vt4Ut8VA6sPvKo4Fe1XaWSx8Lz/yxiMlo1nBaHZp/WXgnK06Zbz28XaS8cTeX66r
Tn6luRkueKCGhHMC6EvX5uRwmtJtOXlNIy5CMeJ6KCfDeKTp14j8g2PybPvXoX4x
6+PTT4mwjBC3HwK5V45ubk02U3HubUTJAT+9tIIVdnkhIj2MGNo0pv7Nvgw+JYFG
DnLuMWlWY1Jscz84o7SA7/Gt6lbox4FxtpqvDyJMeH0CnErXgh73axowk6MvYYfJ
5wesaLkr+wDQH8ZBonIWnBujbCT0PzpUVhmFIDKC+iZsnpvNO6P88DVsPsWUUQbQ
ZFo6ZEMi+tN1EFn28gYtqeZub8i2Ry7zesd+zc2wZr9CgRFGADsCWWYh6B/Ly/Fw
3f0BfAZORhl5xlLB/zZxiRK1+mBI7lcmxFwRD9PRzRerPyI+Q4bQTPK3GOeLl9n4
cLLMUAeMFM8a/x9jUZ5M
=hb6R
-----END PGP SIGNATURE-----

I stumbled across this never tried it though …

How to extract RPM from RPM database in RedHat - Stack Overflow

RPM actually has this fantastic feature to repackage an installed RPM. It works wonderfully well. You do however have to un-install or upgrade the package in question to be able to do this, however that is not really a big deal. I have even forced an un-install (even if it would otherwise break dependencies) and then simply reinstalled it again afterward. [Not recommended, but I have had it work in a pinch]

To repackage an installed package simply do:

rpm -e --repackage package_name

You will now find the .rpm of what you just un-installed in /var/spool/repackage and you can reinstall it again, and keep the .rpm. I love rpm. :slight_smile:

This is great for when that particular version of that app you really need is nowhere to be found anymore.

For more info, see:

Transactions and Rollback with RPM

Manpage of rpmrebuild

Cheers,
Pete

To repackage an installed package simply do:

rpm -e --repackage package_name

You will now find the .rpm of what you just un-installed in /var/spool/repackage and you can reinstall it again, and keep the .rpm. I love rpm.

This is great for when that particular version of that app you really need is nowhere to be found anymore.

Cool tip! :slight_smile:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Agreed… presumably that would get all the install/uninstall scripts as
well. Thank-you for sharing.

Good luck.

deano ferrari wrote:
>> To repackage an installed package simply do:
>>
>> rpm -e --repackage package_name
>>
>> You will now find the .rpm of what you just un-installed in
>> /var/spool/repackage and you can reinstall it again, and keep the .rpm.
>> I love rpm.
>>
>> This is great for when that particular version of that app you really
>> need is nowhere to be found anymore.
>>
>
> Cool tip! :slight_smile:
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIcBAEBAgAGBQJKWKuVAAoJEF+XTK08PnB5hF4QALKf8PCpDWYWLjLsFJSJy89y
DdoJbIwGHtwiZgKw247s4mfHfGpKyRXj91yXuTk/4WMdyIVKNVh6YLDF/vUc/tDW
UBXh88gvs3mLk+zRnV/0dehzSlRSa+cI7qxEgjoRzXMzoG9qxD1KpsfwzGoKNUmN
MnXjXCttv51uq4zhMtwaKbWK5M8O+cwdlqYcfWXOaooaFFoUv5Cg16X2sQCyvD+S
DZNSXO1EENn3QVfXs2REUtNysQHCIFEjIYobCK3aESvKehdsOoahWs3APC6/CgfH
rM/xEsOKH8TCCSsTPJpD6dfo9cPyL501Wxi4btX56w/0u2cWpZ14zmO0ZVCdgKvi
DgI7j0w0r7bHcnstK+uMvmYkWIp8bkGSyuKUAeDMeGvm1Z7gqlEh4sWEnGwtCeif
GWB2Hs1lWEdN6j/aPj9nKW4mXvtEaWTKI2HIStgM5sgVWQJU16ljTMsYlp0+FZ3R
KrjBNZbBldxjb74nZEFrJa3pvgj47Q9wXvYp0rZ/Zz8Hp4XFTqf2REYdKTecBGKG
XtLEHQpQjFFGjMVUFbtDnsA7vWChE6G0z+FBoDb1oSMN2EYdJbGgH7GkTpLSALCN
sPaUrwfXU79I+/Baf4+5ga1QFlvDgFNy/cNP3egp25y/KL+eXXW3hUg+ABwqgp5o
45b8Z4F7gUSBxLJ/ZEcY
=7Mdx
-----END PGP SIGNATURE-----