I got a local repository in /var/www/html/centos/7 directory. In here, all rpm packages from centos are downloaded. I will create a crontab for updating my local repository every 1 week or sth.

I want to learn that does repocreate --update do this? Or should I download all the packages from centos repo again?

If I should download the packages from centos repo, is there a way to skip the downloaded packages (they're in /centos/7 directory as I mentioned) and download just the new (updated) packages from centos?


I have found the solution but it's not working for me. I created a new directory centos7/repo and download some files to check if the rsync --ignore-existing will work. But whenever I run the below command, I got an error

failed to connect to ftp.linux.org.tr ( Connection timed out (110)

rsync: failed to connect to ftp.linux.org.tr (2001:a98:11::100): Network is unreachable (101)

rsync error: error in socket IO (code 10) at clientserver.c(125) [Receiver=3.1.2]

The command is:

rsync -avz --ignore-existing rsync://ftp.linux.org.tr/centos/7/os/x86_64/ /var/www/html/centos7/repo/

I tried other mirrors as well from https://centos.org/download/mirrors/ (there are rsync location in this site as well). But none of them worked. Can anybody validate that rsync mirrors does work? Probably I can't go through firewall with port 873.

Is there anyway that I can use this rsync through port 80 or is there another way to accomplish this task? (I tried zsync but it needs a zsync file.)

  • 2
    I think you should see if they offer rsync mirrors. createrepo --update won't download the packages, it will update the repodata – Pierre-Alain TORET Oct 24 '18 at 12:26
  • I think this can be done with rsync. It has --ignore-existing option. I will try it tomorrow and see if it will do the job. – G.Baysec Oct 24 '18 at 13:25

If you have problems with rsync, then you can use reposync. It is able to download all packages (or --newest-only| -n) from repo, configured in the system. So final commands in script looks like:

/usr/bin/reposync --repoid=updates --download_path=/var/www/html/centos7/repo/updates --newest-only
/usr/bin/createrepo /var/www/html/centos7/repo/updates
  • It gives me error of "Warning: cannot find repository updates". No repositories found. My repository configuration hasn't got any problem because I can download packages – G.Baysec Oct 30 '18 at 6:14

you can try the following mirror which is supporting rsync as well


  • It says could not resolve host name. Maybe it can work with rsync://mirror.nl.leaseweb.net/centos/ but firewall is blocking me with rsync:// – G.Baysec Oct 30 '18 at 6:13

repoquery queries every package in repository that you configured for your system and after that give the list to xargs to download all packages (new ones not existing ones)with repotrack to your server.

repoquery -a | xargs repotrack -a x86_64 -p .

The rsync solution also works if you haven't got any firewall rules that restrict the rsync daemon port.

rsync -avz --ignore-existing rsync://ftp.linux.org.tr/centos/7/os/x86_64/ /var/www/html/centos7/repo/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.