Question:
Need help with Linux question on yum?
Wanbi Ha
2011-07-03 00:33:17 UTC
Previously I was stuck on a question about the cpio command and some of you guys here helped me which I really appreciated. :)

The question I'm stuck on now is about 'yum'..

Explain how you would set up a yum client on a Linux machine to install packages available on the Lab Server, given that the IP address of the Lab Server is 192.168.183.40. What would you do with the default configuration files?

Thanks for all your help guys
Three answers:
2011-07-03 01:10:07 UTC
You can probably open Yum and go to the menus at the top and find the one for repository, Click on one and it should open some boxes that will show you the format it is using to locate the servers and the directories it is using. This may help when you set it up for the Lab Server. They don't normally use an IP address but an http or ftp address. This may not be the answer you are looking for, but I don't like doing things the complicated way.
2011-07-03 00:48:04 UTC
I think what you are asking is how to make a repository?

Google it, there are tutorials everywhere :)

Then add the IP address to your repositories list after you create the repository.

I am unsure how to do this in a yum environment but in Debian I would add

deb 192.168.183.40

to

/etc/apt/sources.list



I hope this gives you some sort of direction, and I apologise for not being able to help any further.



Shane
xjonquilx
2011-07-03 16:39:17 UTC
Let us say you would like to install 3rd party repository from foo.nixcraft.com. Create a file called foo:

# cd /etc/yum.repos.d

# vi foo



Append following code:

[foo]

name=Foo for RHEL/ CentOS $releasever - $basearch

baseurl=http://foo.nixcraft.com/centos/$releasever/$basearch/

enabled=1

gpgcheck=1

gpgkey=http://foo.nixcraft.com/RPM-GPG-KEY.txt



Save and close the file.



Where,

[foo] : Repository name i.e. The [main] section must exist for yum to do anything.

name=Foo for RHEL/ CentOS $releasever - $basearch : A human readable string describing the repository name

baseurl=http://foo.nixcraft.com/centos/$releasever/$basearch/ : Must be a URL to the directory where the yum repository’s ‘repodata’ directory lives

enabled=1 : Enabled or disabled repo. To disable the repository temporarily, set the enabled to 0

gpgcheck=1 : Security feature, use GPG key

gpgkey=http://foo.nixcraft.com/RPM-GPG-KEY.txt : GPL file location



Also you need to import the gpg key for the repository as follows:

# rpm --import http://foo.nixcraft.com/RPM-GPG-KEY.txt


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...