LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   NFS works but Yum gives error (http://www.linuxquestions.org/questions/linux-server-73/nfs-works-but-yum-gives-error-797623/)

Zahir76 03-24-2010 04:47 PM

NFS works but Yum gives error
 
Installed Redhat5 using NFS-server, but when tried to install packages in the newly installed client using:

#yum install package

Client gives, ftp errno 4, error 500...can't change directory...

Edited:
/etc/yum.repos.d/rhel.debuginfo.repo
-------------
baseurl=ftp://192.168.0.5/inst
erased> enable=0
-------------

P.S. all CD copied to /inst directory in NFS-server, where all rpm's can be found in /inst/Server/

What am I missing to make YUM work, in my local repository?

Thanks, all Linux-People.

acid_kewpie 03-24-2010 06:28 PM

Why are you asking about NFS when this is very clearly an FTP error, and you can clearly see that you're using an FTP based repository..??

Zahir76 03-27-2010 03:29 PM

Sorry for delayed post, I messed-up my little-lab setup...
Thanks Chris, I guess the right question sometimes gives the right direction to a solution :)

My question now is, if I've configured NFS in a directory, for example:
#/inst/Server/*.rpm

Can I YUM from the same directory, making it a FTP-based repository? If so, which (.conf) file should I start with? OR I coping all the (rpm) to /var/ftp/pub is a way?

N.B. I can YUM in the local-server: as I used the command below.
#createrepo -v /inst/Server

But how to do YUM from a client-side?
Any clue?

Thanks, all Linux-People.

Zahir76 03-27-2010 06:33 PM

OK, solved!
After installing NFS server, copying all RHEL CDs to a directory, in my case, /inst, we need to edit, /etc/exports file, followed by NFS service reload.
Here are the steps:

###Server Side:
01#mkdir /inst
02#cp -ar /source/. /inst
[note the (.) after /source/]
03#vi /etc/exports
Add line:
/inst *(ro,sync)

04#exportfs -a
05#service nfs restart
06#chkconfig nfs on

07#rpm -ivh createrepo
08#createrepo -v /inst/Server

[/inst/Server => this is the directory where local copy of RPM packages can be found.]

09#vi /etc/yum.repo.d/file.repo
[Server]
name= redhat
baseurl=file:///inst/Server

10#yum clean all
11#yum update (to check)

###Client Side:
Check NFS connection
01#showmount -e [server-IP]
if it shows '/inst' (the shared directory), it's working.
Then we need to mount the directory locally.
02#mount server-IP:/inst/Server /var/yum
Create /var/yum, if it doesn't exist, also notice, /inst/Server at server-side is where all the rpm files are.
Now, edit /etc/yum.repos.d/file.repo
(file.repo or you filename with .repo extension)
03#vi /etc/yum.repos.d/file.repo
baseurl=file:///var/yum
enable=1

04#yum install package
Should work now!

Finally, to make this work after reboot.
#yum install autofs
#vi /etc/auto.master
/misc /etc/auto.misc --timeout=60
(timeout prevents system hanging due to network-error etc.)

#vi /etc/auto.misc
Add line:
yum -ro,soft,intr server-IP:/inst/Server

#service autofs restart
To test the result
#ls /misc/yum
(try few times if in weak network connections)

#yum update
Should now give normal YUM output.

Hope this works for you. Just showed the steps, you may need to do your man-page research for detail. :)

Thanks, all Linux-People.


All times are GMT -5. The time now is 04:08 PM.