LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't rebuild RPM - rpmbuild command not found (https://www.linuxquestions.org/questions/linux-newbie-8/cant-rebuild-rpm-rpmbuild-command-not-found-605415/)

defa0009 12-08-2007 11:43 AM

Can't rebuild RPM - rpmbuild command not found
 
I can't seem to rebuild a RPM because rpm-build is not installed. And I can't use "yum install rpm-build" because I need to rebuild my Yum.src.rpm in order to get it to work with my version of Python.

Anyone know how I can:

a) get a version of rpm that has the rebuild option?

or

b) rebuild a src.rpm without having rpmbuild?


[root@RedhatRick Desktop]# rpmbuild --rebuild yum-3.2.8-1.src.rpm
bash: rpmbuild: command not found


My version of rpm is:


rpm-4.4.2-37.el5


And there is no rebuild option in the list for this version installed


[root@RedhatRick yum-3.2.8]# rpm --help
Usage: rpm [OPTION...]

Query options (with -q or --query):
-c, --configfiles list all configuration files
-d, --docfiles list all documentation files
--dump dump basic file information
-l, --list list files in package
--queryformat=QUERYFORMAT use the following query format
-s, --state display the states of the listed files
-a, --all query/verify all packages
-f, --file query/verify package(s) owning file
-g, --group query/verify package(s) in group
-p, --package query/verify a package file
-W, --ftswalk query/verify package(s) from TOP file tree
walk
--pkgid query/verify package(s) with package
identifier
--hdrid query/verify package(s) with header
identifier
--fileid query/verify package(s) with file identifier
--specfile query a spec file
--triggeredby query the package(s) triggered by the
package
--whatrequires query/verify the package(s) which require a
dependency
--whatprovides query/verify the package(s) which provide a
dependency
--nomanifest do not process non-package files as
manifests

Verify options (with -V or --verify):
--nomd5 don't verify MD5 digest of files
--nofiles don't verify files in package
--nodeps don't verify package dependencies
--noscript don't execute verify script(s)
-a, --all query/verify all packages
-f, --file query/verify package(s) owning file
-g, --group query/verify package(s) in group
-p, --package query/verify a package file
-W, --ftswalk query/verify package(s) from TOP file tree
walk
--pkgid query/verify package(s) with package
identifier
--hdrid query/verify package(s) with header
identifier
--fileid query/verify package(s) with file identifier
--specfile query a spec file
--triggeredby query the package(s) triggered by the
package
--whatrequires query/verify the package(s) which require a
dependency
--whatprovides query/verify the package(s) which provide a
dependency
--nomanifest do not process non-package files as
manifests

File tree walk options (with --ftswalk):
--comfollow FTS_COMFOLLOW: follow command line symlinks
--logical FTS_LOGICAL: logical walk
--nochdir FTS_NOCHDIR: don't change directories
--nostat FTS_NOSTAT: don't get stat info
--physical FTS_PHYSICAL: physical walk
--seedot FTS_SEEDOT: return dot and dot-dot
--xdev FTS_XDEV: don't cross devices
--whiteout FTS_WHITEOUT: return whiteout information

Signature options:
--addsign sign package(s) (identical to --resign)
-K, --checksig verify package signature(s)
--delsign delete package signatures
--import import an armored public key
--resign sign package(s) (identical to --addsign)
--nodigest don't verify package digest(s)
--nosignature don't verify package signature(s)

Database options:
--initdb initialize database
--rebuilddb rebuild database inverted lists from
installed package headers

Install/Upgrade/Erase options:
--aid add suggested packages to transaction
--allfiles install all files, even configurations
which might otherwise be skipped
--allmatches remove all packages which match <package>
(normally an error is generated if
<package> specified multiple packages)
--badreloc relocate files in non-relocatable package
-e, --erase=<package>+ erase (uninstall) package
--excludedocs do not install documentation
--excludepath=<path> skip files with leading component <path>
--fileconflicts detect file conflicts between packages
--force short hand for --replacepkgs --replacefiles
-F, --freshen=<packagefile>+ upgrade package(s) if already installed
-h, --hash print hash marks as package installs (good
with -v)
--ignorearch don't verify package architecture
--ignoreos don't verify package operating system
--ignoresize don't check disk space before installing
-i, --install install package(s)
--justdb update the database, but do not modify the
filesystem
--nodeps do not verify package dependencies
--nomd5 don't verify MD5 digest of files
--nocontexts don't install file security contexts
--noorder do not reorder package installation to
satisfy dependencies
--nosuggest do not suggest missing dependency
resolution(s)
--noscripts do not execute package scriptlet(s)
--notriggers do not execute any scriptlet(s) triggered
by this package
--oldpackage upgrade to an old version of the package
(--force on upgrades does this
automatically)
--percent print percentages as package installs
--prefix=<dir> relocate the package to <dir>, if
relocatable
--relocate=<old>=<new> relocate files from path <old> to <new>
--repackage save erased package files by repackaging
--replacefiles ignore file conflicts between packages
--replacepkgs reinstall if the package is already present
--test don't install, but tell if it would work or
not
-U, --upgrade=<packagefile>+ upgrade package(s)

Common options for all rpm modes and executables:
-D, --define='MACRO EXPR' define MACRO with value EXPR
-E, --eval='EXPR' print macro expansion of EXPR
--macros=<FILE:...> read <FILE:...> instead of default file(s)
--nodigest don't verify package digest(s)
--nosignature don't verify package signature(s)
--rcfile=<FILE:...> read <FILE:...> instead of default file(s)
-r, --root=ROOT use ROOT as top level directory (default:
"/")
--querytags display known query tags
--showrc display final rpmrc and macro configuration
--quiet provide less detailed output
-v, --verbose provide more detailed output
--version print the version of rpm being used

Options implemented via popt alias/exec:
--scripts list install/erase scriptlets from
package(s)
--setperms set permissions of files in a package
--setugids set user/group ownership of files in a
package
--conflicts list capabilities this package conflicts
with
--obsoletes list other packages removed by installing
this package
--provides list capabilities that this package provides
--requires list capabilities required by package(s)
--info list descriptive information from package(s)
--changelog list change logs for this package
--xml list metadata in xml
--triggers list trigger scriptlets from package(s)
--last list package(s) by install time, most
recent first
--filesbypkg list all files from each package
--fileclass list file names with classes
--filecolor list file names with colors
--filecontext list file names with security context from
header
--fscontext list file names with security context from
file system
--recontext list file names with security context from
policy RE
--fileprovide list file names with provides
--filerequire list file names with requires
--redhatprovides find package name that contains a provided
capability (needs rpmdb-redhat package
installed)
--redhatrequires find package name that contains a required
capability (needs rpmdb-redhat package
installed)
--buildpolicy=<policy> set buildroot <policy> (e.g. compress man
pages)
--with=<option> enable configure <option> for build
--without=<option> disable configure <option> for build

Help options:
-?, --help Show this help message
--usage Display brief usage message

btmiller 12-08-2007 12:31 PM

Get a binary rpm-build RPM. Usually you could use yum to do this, but since yours is borked you'll need to download one directly from a repo for your distribution.

Lenard 12-08-2007 12:32 PM

Nothing is stopping you from manually downloading the rpm package from RHN and installing it;

http://www.redhat.com/rhn/
rpm -Uvh rpm-build*.rpm

Noting is stopping also from installing the rpm-build rpm package from the media either.

defa0009 12-08-2007 01:06 PM

The only rpm-build version I can find is not the same version as my rpm (rpm-4.4.2-37.el5) so it complains when I try to install it.

defa0009 12-08-2007 01:27 PM

Quote:

Originally Posted by Lenard (Post 2984159)
Nothing is stopping also from installing the rpm-build rpm package from the media either.

Can't do that either because my optical drive is not being recognized... that's another thread in it's own.

defa0009 12-08-2007 01:33 PM

Quote:

Originally Posted by defa0009 (Post 2984186)
The only rpm-build version I can find is not the same version as my rpm (rpm-4.4.2-37.el5) so it complains when I try to install it.

I finally found the right version... now it complains that it needs elsutils:

[root@RedhatRick Desktop]# rpm -Uvh rpm-build-4.4.2-37.el5.i386.rpm
error: Failed dependencies:
elfutils is needed by rpm-build-4.4.2-37.el5.i386


After installing about 8 other dependencies I finally got rpm-build installed...

btmiller 12-08-2007 01:54 PM

Well, then you're going to have to get the elfutils RPM ... BTW, how did you manage to break your yum? Having yum would make this a lot easier. This is why if I need to install a newer python on a Red Hat distro I install it out of the way (/opt or /usr/local) so I don't overwrite the system python. So much stuff in Red Hat distros is python based you really do need to keep the opriginal python around...

defa0009 12-08-2007 02:03 PM

Quote:

Originally Posted by btmiller (Post 2984220)
BTW, how did you manage to break your yum?

Yum was never installed...

Lenard 12-08-2007 06:31 PM

Yum is the default and preferred update tool used by Red Hat for Enterprise Linux 5 and is installed by default. Once again it is available from RHN and/or the installation media.

defa0009 12-09-2007 11:07 AM

Quote:

Originally Posted by Lenard (Post 2984401)
Once again it is available from RHN and/or the installation media.

I shouldn't say yum wasn't installed... it never worked. Used to complain about a missing module 'cElementTree' from Python.

So I read somewhere that to get yum running with this type of error I should rebuild it from src.rpm hence the need for rebuild. And that actually did not work. So then I searched for the python-elementtree rpm and installed it and yum started working.

So to make a long story short I could have fixed yum first then I could have just did a yum install rpm-rebuild instead of taking the long way around with all the other dependencies to get rpm-rebuild working.

Quote:

Originally Posted by Lenard (Post 2984401)
Once again it is available from RHN and/or the installation media.

My optical drive is not being recognized, probably a bios issue because on boot I get this error saying the DVD drive is the parallel master and then I have to hit the F1 key to continue booting.

Lenard 12-09-2007 11:35 AM

Quote:

cElementTree' from Python.
Is also available from the media and RHN, as python-elementtree-1.2.6-5.x86_64.rpm for example.

Quote:

My optical drive is not being recognized, probably a bios issue because on boot I get this error saying the DVD drive is the parallel master and then I have to hit the F1 key to continue booting.
Bummer, check with your system/motherboard manufacturer maybe they have a fix (BIOS update) or a workaround for this issue. One can (as a suggestion) create a local repo by using the createrepo package as a workaround also;

http://dag.wieers.com/rpm/FAQ.php#B
http://dag.wieers.com/rpm/packages/createrepo/

This does take space and will require getting the ISO image(s) on the system so one can mount the ISO image(s) and copy the rpm files to a common location (say for example /RHEL5). This will eliminate the need for the media. Sample local-Media.repo file that goes into the /etc/yum.repos.d directory;

Code:

[local-media]
name=Red Hat-$releasever - Media
baseurl=file:///RHEL5
gpgcheck=0
enabled=0

Then all one needs to type is something like: yum install foo --enablerepo=local-media

To create the local repo from the directory /RHEL5 type: createrepo /RHEL5

defa0009 12-10-2007 06:35 AM

Thanks for the info Lenard... maybe someone can help me with this new problem:

I had a mishap last night after re-booting the machine for the first time since applying some more
dependencies (ie. yum install kernel) for VMware Server (the link below). My machine doesn't boot
into my Desktop anymore. I just get a command line login. I then try a startx and only one screen
comes on when I used to have 2 screens. Also when I open a terminal window it says 'bash#'
when it used to have [root@RedhatRick Desktop]#

http://www.linuxquestions.org/questi...089/page2.html


All times are GMT -5. The time now is 02:15 AM.