Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7068345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:18:45+00:00 2026-05-28T05:18:45+00:00

On linux can we repackage a installed rpm if so how.I remember that the

  • 0

On linux can we repackage a installed rpm if so how.I remember that the a rpm can be generated from the installed binaries

  rpm -??? > my.rpm

Also the later i.e, the newer rpm should work on a different machine

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:18:46+00:00Added an answer on May 28, 2026 at 5:18 am

    This is possible, but not with the rpm command. I wrote a perl script that does this; it crafts a spec file based on the outputs of rpm -q and does a “build” which just copies the installed files from the system.

    You can find it here: https://github.com/cormander/rogue-beret-tools/blob/master/scripts/rpm-repack

    Usage example, re-packaging the mailx rpm:

    Query it:

    $ rpm -ql mailx
    /bin/mail
    /etc/mail.rc
    /usr/bin/Mail
    /usr/lib/mail.help
    /usr/lib/mail.tildehelp
    /usr/share/man/man1/Mail.1.gz
    /usr/share/man/man1/mail.1.gz
    

    Repack it:

    $ ./rpm-repack -p mailx
    Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.9773
    + umask 022
    + cd /usr/src/redhat/BUILD
    + /usr/lib/rpm/brp-compress
    + /usr/lib/rpm/brp-strip
    + /usr/lib/rpm/brp-strip-static-archive
    + /usr/lib/rpm/brp-strip-comment-note
    Processing files: mailx-8.1.1-44.2.2
    Provides: mailx
    Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
    Requires: libc.so.6 libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.3) libc.so.6(GLIBC_2.3.4) libc.so.6(GLIBC_2.4) rtld(GNU_HASH)
    Checking for unpackaged file(s): /usr/lib/rpm/check-files /tmp/tlkN4yrYEi
    Wrote: ~/rpmbuild/RPMS/i386/mailx-8.1.1-44.2.2.i386.rpm
    

    Query the newly built package:

    $ rpm -qpl ~/rpmbuild/RPMS/i386/mailx-8.1.1-44.2.2.i386.rpm
    /bin/mail
    /etc/mail.rc
    /usr/bin/Mail
    /usr/lib/mail.help
    /usr/lib/mail.tildehelp
    /usr/share/man/man1/Mail.1.gz
    /usr/share/man/man1/mail.1.gz
    

    The code isn’t at all elegant, but functional. It does copy a lot of the rpm info (everything from rpm -qi and most of the scripts), but it isn’t by any means comprehensive. Also, it can’t copy the GPG signature, nor will it have the same checksums as the original RPM file.

    NOTE: This is not a “proper” way to build and distribute RPM packages, and was mainly written for troubleshooting and educational purposes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can sendfile() linux syscall be used to send part of file from one mmaped
I'm looking for a linux utility that can alter the payloads of network packets
I want to find a linux command that can return a part of the
I am trying to make a script (on linux) that can turn a light
On linux we can use time command. Or from C++: #include <sys/time.h> #include <sys/resource.h>
Here's the output dumped from od -cx (on linux you can reproduce with echo
Is there an editor in Linux that can highlight all instances of a word
I'm looking for a tool (in linux) that can montior a tomcat/jboss process and
I'd like to set up an OpenGL development environment in Linux that I can
I am to program a simple shell in linux that can implement various stuffs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.