-1

I was install a package by rpm command in redhat, but the package is failure now. I want create a new package from installed package. what can I do?

Guohao Wang
  • 1
  • 1
  • 2

2 Answers2

0

This command would help you in that,

rpm -Fvh –repackage rpm-file-name.rpm

Here rpm-file-name.rpm is an existing package in Linux which will be repackage by using above option.

From man page of rpm;

–repackage Re-package the files before erasing.

–replacefiles Install the packages even if they replace files from other, already installed, packages.

–replacepkgs Install the packages even if some of them are already installed on this system.

Arnab Nandy
  • 6,472
  • 5
  • 44
  • 50
  • Thanks, but you may not get the point of the question, I was install a rpm package, but the package is loss now, I want repackage from exists system to new package, the 'rpm -Fvh –repackage rpm-file-name.rpm' command be commint , the system echo "error: open of –repackage failed: No such file or directory.". sorry my english not well. – Guohao Wang Apr 17 '15 at 05:54
  • Well @GuohaoWang we use this command for taking back up of existing packages in system, and same you asked for as per i understand, correct me if i'm wrong. – Arnab Nandy Apr 17 '15 at 05:56
  • sorry, my english not well, but I can use a example to explain my means. 1: rpm -qf /usr/bin/which (to query the package name) 2:now, the question is comming . how to build which-2.19-5.1.el6.x86_64.rpm. anyway, thanks very much. – Guohao Wang Apr 17 '15 at 05:59
0

rpmrebuild is built for re-creating RPM package files from already installed packages. There are options which allow you to tailor the packaging, but the most simple invocation just produces an RPM file from an installed package. Example: rpmrebuild coreutils

Juan
  • 1,204
  • 1
  • 11
  • 25