Error During Setting Up the Repository Server in CentOS 7

Issues related to applications and software problems
Post Reply
RefinedIS
Posts: 8
Joined: 2017/03/29 01:57:48

Error During Setting Up the Repository Server in CentOS 7

Post by RefinedIS » 2018/03/14 10:08:02

Hi

I followed the steps from the below URL:
https://www.tecmint.com/setup-yum-repos ... -centos-7/

But when I pull an online repository to get the latest updates of packages from mirror site where a location near me, it error occuried.
Please refer to the screen capture for details.

(This is also my first time to setup this)

Please help.

Thanks !
Attachments
Repository-update-error.jpg
Repository-update-error.jpg (142.37 KiB) Viewed 391 times

User avatar
TrevorH
Forum Moderator
Posts: 23034
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Error During Setting Up the Repository Server in CentOS 7

Post by TrevorH » 2018/03/14 15:38:33

Use https://www.centos.org/download/mirrors/ to find a mirror near you that actually offers rsync? All the ones you tried do not.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

RefinedIS
Posts: 8
Joined: 2017/03/29 01:57:48

Re: Error During Setting Up the Repository Server in CentOS 7

Post by RefinedIS » 2018/03/15 00:51:43

TrevorH wrote:Use https://www.centos.org/download/mirrors/ to find a mirror near you that actually offers rsync? All the ones you tried do not.
Thanks !

But I am in Hong Kong, I applied the sites are in Hong Kong. They are still failed to rsync !!??

Cheers ! 

User avatar
TrevorH
Forum Moderator
Posts: 23034
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Error During Setting Up the Repository Server in CentOS 7

Post by TrevorH » 2018/03/15 01:00:59

The link I gave you has 3 columns and one of those says if the mirror supports rsync or not. All 3 of the ones you picked in your original picture do not do so.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

RefinedIS
Posts: 8
Joined: 2017/03/29 01:57:48

Re: Error During Setting Up the Repository Server in CentOS 7

Post by RefinedIS » 2018/03/16 07:36:32

TrevorH wrote:The link I gave you has 3 columns and one of those says if the mirror supports rsync or not. All 3 of the ones you picked in your original picture do not do so.
Thanks for your reminder.

Since using the "rsync" to download the entire repository, I just want to download the latest one,
(e.g.) http://repo.virtualhosting.hk/centos/7. ... os/x86_64/.

then, how to only download the latest one from Hong Kong mirror site ?
https://centos.org/download/mirrors/


Thanks !

User avatar
TrevorH
Forum Moderator
Posts: 23034
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Error During Setting Up the Repository Server in CentOS 7

Post by TrevorH » 2018/03/16 07:57:27

Only one mirror on that list in Hong Kong says it offers rsync and that is rsync://mirror.xtom.com.hk/repo/centos/
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

RefinedIS
Posts: 8
Joined: 2017/03/29 01:57:48

Re: Error During Setting Up the Repository Server in CentOS 7

Post by RefinedIS » 2018/03/16 08:12:22

TrevorH wrote:Only one mirror on that list in Hong Kong says it offers rsync and that is rsync://mirror.xtom.com.hk/repo/centos/

Thanks !
Yes ! I know now.

But I ONLY want to download this one ---> centos/7.4.1708/os/x86_64/.

My question is how to only download centos/7.4.1708/os/x86_64/ ?

Thanks !

User avatar
TrevorH
Forum Moderator
Posts: 23034
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Error During Setting Up the Repository Server in CentOS 7

Post by TrevorH » 2018/03/16 08:44:13

Just rsync the bits you need. For example, I use the following script based on the one from our wiki page on setting up a local mirror

Code: Select all

CURRREL="7.4.1708"

if [ -f /var/lock/subsys/rsync_update7 ]; then
    echo "Updates via rsync already running."
    exit 0
fi

if [ -d /var/www/html/centos/$CURRREL ] ; then
    touch /var/lock/subsys/rsync_update7
    rsync  -avSHP --delete --exclude "*/i386" --exclude "*/i686" --exclude "storage" --exclude "virt" --exclude "isos" --exclude '*/x86_64/drpms' --exclude "cloud" --exclude "paas" --exclude "atomic" --exclude "sclo" mirrors.kernel.org::centos/$CURRREL/ /var/www/html/centos/$CURRREL/ >> /var/log/repo7mirror.log 2>&1
    /bin/rm -f /var/lock/subsys/rsync_update7
else
    echo "Target directory /var/www/html/centos/$CURRREL not present."
fi
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

RefinedIS
Posts: 8
Joined: 2017/03/29 01:57:48

Re: Error During Setting Up the Repository Server in CentOS 7

Post by RefinedIS » 2018/03/16 08:55:46

TrevorH wrote:Just rsync the bits you need. For example, I use the following script based on the one from our wiki page on setting up a local mirror

Code: Select all

CURRREL="7.4.1708"

if [ -f /var/lock/subsys/rsync_update7 ]; then
    echo "Updates via rsync already running."
    exit 0
fi

if [ -d /var/www/html/centos/$CURRREL ] ; then
    touch /var/lock/subsys/rsync_update7
    rsync  -avSHP --delete --exclude "*/i386" --exclude "*/i686" --exclude "storage" --exclude "virt" --exclude "isos" --exclude '*/x86_64/drpms' --exclude "cloud" --exclude "paas" --exclude "atomic" --exclude "sclo" mirrors.kernel.org::centos/$CURRREL/ /var/www/html/centos/$CURRREL/ >> /var/log/repo7mirror.log 2>&1
    /bin/rm -f /var/lock/subsys/rsync_update7
else
    echo "Target directory /var/www/html/centos/$CURRREL not present."
fi

Thanks !
But how to apply this to setup the Repository server ?

I refer to the steps in the following web site:

http://www.serverlab.ca/tutorials/linux ... nd-centos/

Please refer to the "Mirroring an Online Base Repository" in the above web site:

Example from the above web site:
------------
"Use Rsync to download the entire repository. I am only interested in CentOS 6.5, so I’m targeting the directory for it at the local university.
rsync -rz --progress rsync://mirror.csclub.uwaterloo.ca/centos/os/x86_64/ /repos/CentOS/6/5/"

User avatar
TrevorH
Forum Moderator
Posts: 23034
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Error During Setting Up the Repository Server in CentOS 7

Post by TrevorH » 2018/03/16 11:05:26

Do not be interested in CentOS 6.5. It is 4 years old and riddled with security vulnerabilities. No-one should use it. The only viable CentOS 6 to run is 6.9 as that is the latest and the only one without a truckload of known and unfixed security problems. Also, don't use random links off the internet - though I confess I didn't read the one you used - when there's already a perfectly good one on the CentOS wiki about how to do it.

For information on how to go about setting up a local CentOS mirror please see https://wiki.centos.org/HowTos/CreateLocalMirror
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply