• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

pkgadd -d command is not supported in linux

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I used one file one.pkg in solaris server. It will create some new directories, new files and executes some scripts in solaris server by giving the command "pkgadd -d one.pkg". Clearly its works only in solaris server but not in Linux, because commands like pkgadd, pkginfo not supported in linux. I need to create similar file in linux to do all tasks what ever performed by the command "pkadd -d one.pkg".

Could you please suggest which way is better for me and which one is alternative for .pkg in linux.

Thanks in advance.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Different Linux distributions use different package management systems.

Debian, Ubuntu, and other Linux distributions which are based on Debian use .deb packages, which are managed using dpkg. You install a .deb package with "dpkg -i one.deb". See "man dpkg" for details.

Red Hat Linux and Fedora use RPM packages, which are managed with a program named "yum".

So it depends on which Linux distribution exactly you are using.
 
Mani Raju
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jesper de Jong wrote:Different Linux distributions use different package management systems.

Debian, Ubuntu, and other Linux distributions which are based on Debian use .deb packages, which are managed using dpkg. You install a .deb package with "dpkg -i one.deb". See "man dpkg" for details.

Red Hat Linux and Fedora use RPM packages, which are managed with a program named "yum".

So it depends on which Linux distribution exactly you are using.




Thanks,
How can we find Linux Distribution in our server?
Could you please tell me the way to find it?


 
Mani Raju
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mani Raju wrote:

Jesper de Jong wrote:Different Linux distributions use different package management systems.

Debian, Ubuntu, and other Linux distributions which are based on Debian use .deb packages, which are managed using dpkg. You install a .deb package with "dpkg -i one.deb". See "man dpkg" for details.

Red Hat Linux and Fedora use RPM packages, which are managed with a program named "yum".

So it depends on which Linux distribution exactly you are using.




Thanks,
Yes, i found distribution in my linux server. It is Red Hat Enterprise Linux Client release 5.5 (Tikanga)
Could you suggest me which is better one whether RPM or dpkg for Red Hat Enterprise Linux Client release 5.5 (Tikanga) and process to create new package?


 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Red Hat Enterprise Linux works with RPM packages, not dpkg.

How to make RPM packages: See the manual of Red Hat Enterprise Linux and http://www.rpm.org/
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, the Red Hat Package Manager utility is "rpm". YUM is the Yellowdog Update Manager and it uses RPM to pull and install packages from package repository servers, resolving package dependencies as it does. RPM can download a URL, but you have to provide a specific server URL and it won't resolve dependencies, just download and install the package(s) indicated on the RPM command.

The definitive guide for creating RPMs is still Maximum RPM, I think, even though it's horribly out of date. Among other things, I think that the RPM building process is now a separate program named rpmbuild. Or maybe it used to be and it's now the "-b" option on RPM. I can never remember.

As in the case of Solaris packages, you lay out an RPM project according to a specific directory plan, the package is built from there. A primary difference, however, is that Solaris copies and explodes the dpkg. RPM does not. It deploys the package components, runs the scripts, and makes entries in the RPM database, but it doesn't archive the RPM itself. YUM can cache downloaded RPMs, but it doesn't reshape them the way that Solaris does.

One other distinction that RPMs provide is that they allow for the common case where the original source is not Red Hat-specific and may require patching to build and deploy properly in a Red Hat/CentOS/Fedora environment. RPMs therefore come in 2 formats: Source RPMS (srpms) and installation RPMS (rpms). If I sent you an SRPM file and you install it using the RPM utility, it will explode the generic source out into a work directory. The rpmbuild will then apply the vendor-specific patches, run the "make" process, then bundle up the results to construct an installation RPM.

RPMs are also different than Debian packages (and, IIRC Solaris dpkg) in that an RPM is not supposed to be interactive when installing. No console questions/answers.

Finally, for Java-specific projects, you can produce an RPM using the Maven RPM mojo from CodeHaus. I do this often, as frequently a WAR will require the construction and/or maintenance of resources external to the J2EE server and an RPM can handle that. The Maven RPM mojo skips the source unpacking and patching and simply builds the RPM based on information from the POM.
 
Mani Raju
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim,

i have java code and we will run that code in any linux server but we not developed code in J2EE environment. We develop code in simple manner by using collections and we can create one new jar file for this code.
In earlier we used one.pkg for solaris servers. Actually it is not supported in linux server. So we are looking for alternative one in linux. we can install one.pkg by using command "pkgadd -d one.pkg".
By giving this command installation started and it will ask the location to store[location in server in which we are installing] all java files,java classes, xml files, some scripts and jar files. After storing all these files in specified location in installation process, it will execute scripts which we copied into specific location in installation and asks user to know some locations to perform operations in that location[this operations also need to be specified in copied scripts]. All these actions has to be performed in linux server while installing package.
Similarly we need to implement in rpm for linux server.

Can you please share complete process in step by step to create rpm package for all above activities.

Thanks in advance.
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not really sure what you are asking.

If you build an RPM, it will contain the set of files to be installed, the locations where they are to be installed, and the file attributes (access rights) of those file. You can also qualify "permanent" files or "config files" so that custom configuration options won't be destroyed if you do an upgrade of the package later. RPMs can run shell scripts before and/or after installation, before and/or after package removal (the rpm --erase command) and I think a few other places as well. The Maven rpm mojo can be used with a POM that creates an executable jar and bundles it into an RPM, if that's what your are looking for.

Ultimately, all RPMs are built by the rpmbuild utility, either directly or indirectly. In the case of the Maven rpm goal, you have to have the rpmbuild program installed (it's in the rpm package named rpm-build).

Incidentally, there was a "universal" package builder created several years ago that could build Solaris packages, Debian packages and/or RPM packages, as desired using a compromise package model. It couldn't produce packages as full-featured as native package building can, but it was good for minimizing maintenance on packages destined for multiple platforms. I think it was named "epkg".
 
Mani Raju
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your information. Please kindly provide step by step procedure for creating rpm packages.
In creating .pkg file we will follow below process:

Step 1: First create pkginfo file.
Step 2: Create required jar file and stored in "jars" folder.
Step 3: Create BOM file. If we want to run checkinstall, request, postinstall scripts then just simply specify them at the top inside BOM file. Specify the path of the files[in BOM] which we need to pack inside the package.
Step 4: Give the above BOM file as input to the pkgmk command while creating package.
Step 5: Inside package, we have files pkginfo and pkgmap. Pkgmap file contains the pathnames to all the files and permissions and checksums for each of them.


Similarly can you please tell me the step by step process for creating rpm packages and to perform validations to check copied locations by this rpm package installation.


Thanks in advance!

 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is "BOM"? I don't recognize the term.

In RPM, the "pkgmap" is part of the rpm SPEC file, as are the scripts. So is the "pkginfo", actually.

RPM is very powerful. It not only validates at install time, it has an option to re-validate installed files at any later time to assist in detecting components that have been damaged or tampered with.

Detailed instructions fall under billable time, but if you are looking to install a single WAR, JAR, EAR or other Java component file, I do recommend using the Maven RPM plugin, since it's simpler to set up. Otherwise, consult "Maximum RPM".
 
Mani Raju
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks TIM.

Can you please provide step by step procedure to create RPM Package. Actually i don't know that SPEC files, basics in creating RPM packages. I am struggling lot to know how to create.

Could you please provide step by step documentation to create any kind of RPM package to work on Red Hat Linux distributions.

Thanks in advance!

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic