Local yum server & client issue.

General support questions
Post Reply
MadhuPalter
Posts: 1
Joined: 2018/04/17 13:10:45

Local yum server & client issue.

Post by MadhuPalter » 2018/04/17 13:12:53

Hello,

I have a test environment which has six CentOS servers, and created a local YUM repository in one of the servers, where the other five servers should be fetching packages from this local YUM server via ftp.

Server1 (Yum Server): I have installed the FTP server and was able to install local yum server without any issues, but only after renaming the remaining pre-installed CentOS-*.repo files to CentOS-*.repo.bak files.

Server2-5 (Yum Clients): I am able to fetch packages from Yum Server via ftp. But, I had to rename the pre-installed CentOS-*.repo files to CentOS-*.repo.bak files, just like I did in Server1.

Server6 (Yum Client): In this server, I did not rename the CentOS-*.repo files, but created a new file "client.repo" in the /etc/yum.repos.d/ folder. When i tried to do a yum repolist, it failed with “Another app is currently holding the yum lock” error. After going through various articles, I have disabled the PackageKit utility which was the reason for the error and then I was able to execute the yum repolist command. But, when I tried to install a package, it fetched from the CentOS-Base.repo file, instead of the "client.repo" file, which was created to fetch the packages via ftp server.

Can someone help me how can this be fixed? One of my friend said, it is okay to have multiple .repo files in /etc/yum.repos.d/ folder. How can I make sure that the packages are being fetched from the local YUM server which I created?

It would be great, if anyone can help me on this. Thanks in advance.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Local yum server & client issue.

Post by TrevorH » 2018/04/17 13:40:02

only after renaming the remaining pre-installed CentOS-*.repo files to CentOS-*.repo.bak files.
Don't do that, it won't work for long. Those .repo files are all supplied by packages, in this particular case by the centos-release package. The .repo files are marked as config,noreplace in the package so they will only be replaced if they have not been modified. If you rename the files then they are not present so the next update of centos-release will put the files back with their original names and contents.

What you should do is edit the supplied repo files and change enabled=1 to enabled=0 to disable them. Now the file still exists so when yum installs the newer centos-release, it will detect that and create a .repo.rpmnew file with the new package content in it and leave your existing file alone. Now you can drop in your own .repo files though actually it's just as easy to replace the supplied CentOS-Base.repo file with your own contents, doing what you wanted it to do.

It is also more usual to use an http server to serve the yum repo content not an ftp one. The ftp one will work but it uses many more ports and ftp is a funny protocol to devise firewall rules for.

I'd also suggest reading our wiki page about this as it covers how to update from one point release to another. Also, when you rsync the content, make sure you rsync the target of the /7/ symlink (currently 7.4.1708) and not the /7/ symlink itself. For information on how to go about setting up a local CentOS mirror please see https://wiki.centos.org/HowTos/CreateLocalMirror
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply