openSUSE Forums > Programming/Scripting » How to create RPM fron installed packages?

Go Back   openSUSE Forums > Programming/Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read

Programming/Scripting Questions about programming, bash scripts, perl, php, cron jobs, ruby, python, etc.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-Jul-2009, 19:56
cepiolidus's Avatar
Puzzled Penguin
 
Join Date: Apr 2009
Posts: 40
cepiolidus hasn't been rated much yet
Cool 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
Reply With Quote
  #2 (permalink)  
Old 10-Jul-2009, 20:12
Explorer Penguin
 
Join Date: Apr 2009
Posts: 639
ab@novell.com hasn't been rated much yet
Default Re: How to create RPM fron installed packages?

-----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
NgMQUJvoKNpTMbzLEydygaL92RVSu5wISHgG54822dEgKI2zMw HRaULGIY40oXH/
vt4Ut8VA6sPvKo4Fe1XaWSx8Lz/yxiMlo1nBaHZp/WXgnK06Zbz28XaS8cTeX66r
Tn6luRkueKCGhHMC6EvX5uRwmtJtOXlNIy5CMeJ6KCfDeKTp14 j8g2PybPvXoX4x
6+PTT4mwjBC3HwK5V45ubk02U3HubUTJAT+9tIIVdnkhIj2MGN o0pv7Nvgw+JYFG
DnLuMWlWY1Jscz84o7SA7/Gt6lbox4FxtpqvDyJMeH0CnErXgh73axowk6MvYYfJ
5wesaLkr+wDQH8ZBonIWnBujbCT0PzpUVhmFIDKC+iZsnpvNO6 P88DVsPsWUUQbQ
ZFo6ZEMi+tN1EFn28gYtqeZub8i2Ry7zesd+zc2wZr9CgRFGAD sCWWYh6B/Ly/Fw
3f0BfAZORhl5xlLB/zZxiRK1+mBI7lcmxFwRD9PRzRerPyI+Q4bQTPK3GOeLl9n4
cLLMUAeMFM8a/x9jUZ5M
=hb6R
-----END PGP SIGNATURE-----
Reply With Quote
  #3 (permalink)  
Old 10-Jul-2009, 20:21
FeatherMonkey's Avatar
Wise Penguin
 
Join Date: Mar 2008
Posts: 1,536
FeatherMonkey has a spectacular reputation aura aboutFeatherMonkey has a spectacular reputation aura aboutFeatherMonkey has a spectacular reputation aura aboutFeatherMonkey has a spectacular reputation aura about
Default Re: How to create RPM fron installed packages?

I stumbled across this never tried it though ...

How to extract RPM from RPM database in RedHat - Stack Overflow
__________________
Man first, have a try at Info, have a look at Wiki, if all that fails Scroogle!!!!!
If I've helped click on the Rep button I don't know what it does but it sounds cool.
Reply With Quote
  #4 (permalink)  
Old 10-Jul-2009, 21:55
Explorer Penguin
 
Join Date: Oct 2008
Posts: 142
LewsTherinTelemon hasn't been rated much yet
Send a message via AIM to LewsTherinTelemon
Thumbs up Re: How to create RPM fron installed packages?

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.

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
Reply With Quote
  #5 (permalink)  
Old 10-Jul-2009, 21:59
Wise Penguin
 
Join Date: Jun 2008
Location: NZ
Posts: 1,721
deano_ferrari 's reputation will be famous soon enoughdeano_ferrari 's reputation will be famous soon enoughdeano_ferrari 's reputation will be famous soon enough
Default Re: How to create RPM fron installed packages?

Quote:
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!
Reply With Quote
  #6 (permalink)  
Old 11-Jul-2009, 10:11
Explorer Penguin
 
Join Date: Apr 2009
Posts: 639
ab@novell.com hasn't been rated much yet
Default Re: How to create RPM fron installed packages?

-----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!
>
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIcBAEBAgAGBQJKWKuVAAoJEF+XTK08PnB5hF4QALKf8PCpDW YWLjLsFJSJy89y
DdoJbIwGHtwiZgKw247s4mfHfGpKyRXj91yXuTk/4WMdyIVKNVh6YLDF/vUc/tDW
UBXh88gvs3mLk+zRnV/0dehzSlRSa+cI7qxEgjoRzXMzoG9qxD1KpsfwzGoKNUmN
MnXjXCttv51uq4zhMtwaKbWK5M8O+cwdlqYcfWXOaooaFFoUv5 Cg16X2sQCyvD+S
DZNSXO1EENn3QVfXs2REUtNysQHCIFEjIYobCK3aESvKehdsOo ahWs3APC6/CgfH
rM/xEsOKH8TCCSsTPJpD6dfo9cPyL501Wxi4btX56w/0u2cWpZ14zmO0ZVCdgKvi
DgI7j0w0r7bHcnstK+uMvmYkWIp8bkGSyuKUAeDMeGvm1Z7gql Eh4sWEnGwtCeif
GWB2Hs1lWEdN6j/aPj9nKW4mXvtEaWTKI2HIStgM5sgVWQJU16ljTMsYlp0+FZ3R
KrjBNZbBldxjb74nZEFrJa3pvgj47Q9wXvYp0rZ/Zz8Hp4XFTqf2REYdKTecBGKG
XtLEHQpQjFFGjMVUFbtDnsA7vWChE6G0z+FBoDb1oSMN2EYdJb GgH7GkTpLSALCN
sPaUrwfXU79I+/Baf4+5ga1QFlvDgFNy/cNP3egp25y/KL+eXXW3hUg+ABwqgp5o
45b8Z4F7gUSBxLJ/ZEcY
=7Mdx
-----END PGP SIGNATURE-----
Reply With Quote
Reply

Bookmarks


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2