Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello everyone,
I want to know the size of an rpm file in redhat.
I have used the following commands and getting confusing results.
kindly tell me,
I used
1.rpm -qip xyz.rpm
this command shows size field with some value.
2.du -sb xyz.rpm
This showing some thing different.
3.ls -l
this showing as the du command result for the corresponding rpm file.
but why the rpm command showing something different.
what is actually the size
kindly tell me it is required for my project.
Thanks
I do not get what size are you looking at. rpm is a package installer. When rpm file is installed, it may installed and configure package in various location instead of one. For example it may have its configuration files in /etc and binary files in /usr/bin. If you are looking for the file size of rpm itself, then you may use du -sh <file.rpm>
what do you want to know? the size of the package itself (that is the size of the *.rpm file) - du or ls will tell you,
or you need the size of the installed package (how much space is occupied by the package). You can see the man page of rpm about the meaning of -qip.
Thanks ,
Every one for the quick response
I have not installed any rpm,
Actually I am having one rpm file not installed only copied from pen drive to system.
I want to retrive the size using one shell scripting so i need the command ,there are many possible command .
I want to use the rpm command ,but it not giving the size properly,It showing in bytes but this is not correct.
"rpm -qip xyz.rpm | grep Size"
I came to know that it is giving the size from the header of the rpm file.where tags are there to give information about the rpm and from the size tag it is giving the result.
so my doubt is why the size is not matching with other command results.What is actually the concept behind this.
Thanks
Last edited by pradiptart; 04-12-2012 at 07:09 AM.
It works for me. The suggested commands give the same result as reported by the Size field in the summary. Maybe a mistake in the RPM header? Which package gives the wrong result? Where did you downloaded it from?
Just wanted to add that adding '-h' to the 'ls -l' command, as in
Code:
ls -lh
The file sizes will be given in a human-readable format instead of in bytes. I've found it's much easier to read something like "34.6M" instead of "34602128"
knudfl - Thanks for your reply,It is helpful for me.but can u say how to check it is correct or not,
I have uncompresed using the following command but not able to find out the exact size.
rpm2cpio xyz.rpm | cpio -ivd
I have used this command and uncompressed the rpm file,and then use the ls command to see the size but it also not giving the size mentioned in the Size attribute of rpm file.so can u say how check it the size after uncommpress the rpm file.
Thanks
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420
Rep:
Quote:
I have used this command and uncompressed the rpm file,and then use the ls command to see the size but it also not giving the size mentioned in the Size attribute of rpm file.so can u say how check it the size after uncommpress the rpm file.
You mean to say you want to check the size of each and every file of that uncompressed rpm, right? If it is so, then execute du -sh * command, will give you size of each and every file of uncompressed rpm.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.