YUM configuration problems

Issues related to applications and software problems
Post Reply
supertight
Posts: 171
Joined: 2017/02/07 21:47:51

YUM configuration problems

Post by supertight » 2017/11/20 15:34:07

I'm trying to get my servers to use the local mirror for updates.

Using code:

Code: Select all

cd /etc/yum.repos.d
perl -npe '/mirrorlist=.*repo=os/ && s/^/#/' -i CentOS-Base.repo
perl -npe '/mirrorlist=.*repo=updates/ && s/^/#/' -i CentOS-Base.repo
perl -npe '/#baseurl=.*\/os\// && s/^#//' -i CentOS-Base.repo
perl -npe '/#baseurl=.*\/updates\// && s/^#//' -i CentOS-Base.repo
perl -npe '/^baseurl=/ && s/mirror.centos.org/pxe.p.local/7.3/' -i CentOS-Base.repo
The first four(4) commands complete the 5th gives the following errors:

Code: Select all

Having no space between pattern and following word is deprecated at -e line 1.
Number found where operator expected at -e line 1, near "s/mirror.centos.org/pxe.p.local/7.3"
syntax error at -e line 1, near "s/mirror.centos.org/pxe.p.local/7.3"
Execution of -e aborted due to compilation errors.
I'm lost. Can someone shine some light on this for me?
Thanks for reading.
Last edited by supertight on 2017/11/20 15:46:33, edited 1 time in total.

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

Re: YUM configuration problems

Post by TrevorH » 2017/11/20 15:43:04

No idea but hard coding 7.3 seems like a mistake. You should read the local mirror wiki page https://wiki.centos.org/HowTos/CreateLocalMirror

Sync the point release directory - e.g. 7.4.1708 to your local system but maintain the /7/ symlink yourself and flip it to the new version once you're happy. Syncing /7/ from the mirror will lead to all sorts of weird problems since it's not designed to work that way.
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

stevemowbray
Posts: 519
Joined: 2012/06/26 14:20:47

Re: YUM configuration problems

Post by stevemowbray » 2017/11/20 15:46:24

You have a / in your substitution string pxe.p.local/7.3 which is terminating it there.

supertight
Posts: 171
Joined: 2017/02/07 21:47:51

Re: YUM configuration problems

Post by supertight » 2017/11/20 16:05:06

TrevorH wrote:No idea but hard coding 7.3 seems like a mistake. You should read the local mirror wiki page https://wiki.centos.org/HowTos/CreateLocalMirror

Sync the point release directory - e.g. 7.4.1708 to your local system but maintain the /7/ symlink yourself and flip it to the new version once you're happy. Syncing /7/ from the mirror will lead to all sorts of weird problems since it's not designed to work that way.
It's as simple as changing the file location to /pxe.p.lcoal/7/ and amending the supporting config files?
I have a 32-bit 6.9 mirror too. should I change that to /pxe.p.local/6/ ??


If I recall, I'm synced to 7.3.1611. I'm not sure if that matters. Or if I should start a new Sync to 7.4.1708 @ /7/ & remove 7.3.1611 & /7.3/

If I have servers running 7.3.1611 and I switch my local mirror to 7.4.1708, can the servers running 17.3.1611 still update from the local mirror?
Last edited by supertight on 2017/11/20 16:17:08, edited 1 time in total.

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

Re: YUM configuration problems

Post by TrevorH » 2017/11/20 16:15:51

You should sync the point release directory and maintain your own symlink to it - /7/ or /6/ or whatever. If you sync from e.g. /7/ and CentOS flips the symlink on the mirror then you will end up with weird results as the new base will get merged into the old one and the new updates will get merged into the old one.

The wiki article I linked to has an example script and instructions on what to do when the point release changes. They work.
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

supertight
Posts: 171
Joined: 2017/02/07 21:47:51

Re: YUM configuration problems

Post by supertight » 2017/11/20 16:20:17

TrevorH wrote:You should sync the point release directory and maintain your own symlink to it - /7/ or /6/ or whatever. If you sync from e.g. /7/ and CentOS flips the symlink on the mirror then you will end up with weird results as the new base will get merged into the old one and the new updates will get merged into the old one.

The wiki article I linked to has an example script and instructions on what to do when the point release changes. They work.

I obviously have some reading to do.
I used, this: https://wiki.centos.org/HowTos/NetworkInstallServer to set up the mirror originally. However, I can see the problem, this is about PXE/HTTP/Kickstart than the mirror itself.

I will report back. When I have some clew as to what is going on.
Thanks, TrevorH

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: YUM configuration problems

Post by jlehtone » 2017/11/21 13:03:10

I would not (I don't) edit the CentOS-Base.repo.
What I do is to create a separate *.repo file for my local repositories.
(In fact I've created an rpm with that file into local repo so that kickstart can install it among the rest.)

IMHO, addition is merrier than replacement.

The local mirror how-to sets high(er) priority for local repositories. That works fine.
Alternatively, one can disable the CentOS-Base repositories:

Code: Select all

yum-config-manager --disable base extras updates

supertight
Posts: 171
Joined: 2017/02/07 21:47:51

Re: YUM configuration problems

Post by supertight » 2017/11/21 20:18:02

jlehtone wrote:I would not (I don't) edit the CentOS-Base.repo.
What I do is to create a separate *.repo file for my local repositories.
(In fact I've created an rpm with that file into local repo so that kickstart can install it among the rest.)

IMHO, addition is merrier than replacement.

The local mirror how-to sets high(er) priority for local repositories. That works fine.
Alternatively, one can disable the CentOS-Base repositories:

Code: Select all

yum-config-manager --disable base extras updates

I'm so lost right now.... I can't seem to make heads or tails of this. The "how To" is incredibly vague. I have no idea what to do.

supertight
Posts: 171
Joined: 2017/02/07 21:47:51

Re: YUM configuration problems

Post by supertight » 2017/11/21 21:14:45

supertight wrote:
jlehtone wrote:I would not (I don't) edit the CentOS-Base.repo.
What I do is to create a separate *.repo file for my local repositories.
(In fact I've created an rpm with that file into local repo so that kickstart can install it among the rest.)

IMHO, addition is merrier than replacement.

The local mirror how-to sets high(er) priority for local repositories. That works fine.
Alternatively, one can disable the CentOS-Base repositories:

Code: Select all

yum-config-manager --disable base extras updates

I'm so lost right now.... I can't seem to make heads or tails of this. The "how To" is incredibly vague. I have no idea what to do.
I only have 7 servers. I have unlimited 150mb/s fiber optic access. I think I'm just going to configure my pxe system to use a public mirror for now.

Post Reply