LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   usage of rpm command (https://www.linuxquestions.org/questions/linux-newbie-8/usage-of-rpm-command-139114/)

woja 01-27-2004 03:30 AM

usage of rpm command
 
Hi,

I am using redhat 9. I made some stupid changes late at night to smb.conf, not really knowing what I was doing, without making a backup, and need to start over. How do I replace the copy in etc/samba with the original from on the installation CDs? I know it's something to do with the rpm command. I've looked at "man rpm" and can't make sense of it.

Thanks,
Roger

huibert.alblas 01-27-2004 04:17 AM

If you only nned the orginal smb.conf,
the easyest way is to locate the samba.common (?) package on your install CD's.
With the use of the mc in a terminal (midnight commander) you can easaly access the rpm contents, just like a zip file.

navigate to the etc/samaba/smb.conf file and copy it to a convinient location.

The midnight commander ist a very helpfull tool for tasks like extracting one or two files from an archive.

Have fun!

Pankrat

woja 01-27-2004 11:27 AM

Thanks for your help, I'm making progress but stuck again.

I can locate the samba.common.2.2.7a-7.9.0.i386.rpm file using midnight commander. I can copy the file to another location with no problems. I don't see how to view the contents of the rpm file itself, either in mc or konqueror. What do I need to do now?

Roger

Netizen 01-27-2004 11:44 AM

You are prolly going to have to install the rpm. That will extract files you need to the folders and should overwrite everything.

Netizen

huibert.alblas 01-30-2004 04:32 AM

The following maybe is a little to detailed,
I just wanted to make clear the concept of virtual file systems in MC
(works the same in a lot of other tools too)

In the MC (on the 'left-side') :
navigate to the rpm using the cursor keys,
and enter key to access a directory. (this is common sense,
you probably knew this allready.)

This is so simple, you are probaly not consiously aware that it works that way.

Now, the beauty of the MC is;

you can access ZIP, TAR, RPM, CPIO and loads of other files just in the same way as you enter directories.
(The only caveat is, that you should make sure the file you want to 'enter' is not flagged as executable (marked green and a * in MC)
otherwise MC will convienetly try to execute said file. For RPMS this will result in an error)

To retrive one (1) file from an RPM (or other encapsulated format)
you navigate to the file, and press the enter key on this file.

this should show you the contents off the RPM file.

you will see 2 directories (/etc and /usr) and some RPM internal information files (you can ignore these)

in the RPM you navigate to /etc/samba/smb.conf, now on the right side of MC, you go to (for instance) /tmp.
Now you change back to the left side with the TAB key, and press F5 (copy file)

Thats it, now you have the orignal smb.conf lying around in /tmp.


All times are GMT -5. The time now is 07:51 PM.