This discussion is archived
1 2 Previous Next 18 Replies Latest reply: May 7, 2013 5:49 PM by alvaromiranda Go to original post RSS
  • 15. Re: Oracle Public Yum problems today (23/01/13)
    alvaromiranda Explorer
    Currently Being Moderated
    Hello there

    First of all, thanks for giving a try to the script.

    Script can be located at:

    https://github.com/kikitux/public-yum-downloader

    Direct RAW access:
    https://raw.github.com/kikitux/public-yum-downloader/master/public-yum-downloader.sh

    Download as

    # wget https://raw.github.com/kikitux/public-yum-downloader/master/public-yum-downloader.sh

    If you want to use /var/www/html you are correct

    The hierarchy is 100% the same as what is on public-yum

    however, the script take 2 arguments, one is -P for the OS directory, and --url for where the same path will be public, so you can put the mirror in a different path

    example, I have my own repo in /u02/stage/ and is shared like mirandaa00/stage

    on my apache I have

    Alias /stage "/u02/stage/"

    <Directory "/u02/stage/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>

    In that way, I have everything I want in my own path.


    When you use the url, the script will create a local-yum-ol6.repo file with the url you gave, with GPG enabled, so you can be sure nothing wrong will happen in the middle

    I use this script it this way

    as root, i have /root/bin/dl.sh with this content


    ~/bin/public-yum-downloader.sh -P /u02/stage/ -p http://proxy:3128 -R 6.latest --url http://mirandaa00/stage -l /u02/stage/repo/OracleLinux/OL6/
    ~/bin/public-yum-downloader.sh -P /u02/stage/ -p http://proxy:3128 -R 5.latest --url http://mirandaa00/stage -l /u02/stage/repo/OracleLinux/OL5/
    ~/bin/public-yum-downloader.sh -P /u02/stage/ -p http://proxy:3128 -R 4.latest --url http://mirandaa00/stage -l /u02/stage/repo/EnterpriseLinux/EL4/
    ~/bin/public-yum-downloader.sh -P /u02/stage/ -p http://proxy:3128 -R 6.4 --url http://mirandaa00/stage -l /u02/stage/repo/OracleLinux/OL6/
    ~/bin/public-yum-downloader.sh -P /u02/stage/ -p http://proxy:3128 -R 5.9 --url http://mirandaa00/stage -l /u02/stage/repo/OracleLinux/OL5/
    ~/bin/public-yum-downloader.sh -P /u02/stage/ -p http://proxy:3128 -R 4.9 --url http://mirandaa00/stage -l /u02/stage/repo/EnterpriseLinux/EL4/
    ~/bin/public-yum-downloader.sh -P /u02/stage/ -p http://proxy:3128 -R 4.8 --url http://mirandaa00/stage -l /u02/stage/repo/EnterpriseLinux/EL4/
    ~/bin/public-yum-downloader.sh -P /u02/stage/ -p http://proxy:3128 -R 6.UEK --url http://mirandaa00/stage
    ~/bin/public-yum-downloader.sh -P /u02/stage/ -p http://proxy:3128 -R 5.UEK --url http://mirandaa00/stage
    ~/bin/public-yum-downloader.sh -P /u02/stage/ -p http://proxy:3128 -r ol6_addons --url http://mirandaa00/stage
    ~/bin/public-yum-downloader.sh -P /u02/stage/ -p http://proxy:3128 -r el5_addons --url http://mirandaa00/stage
    ~/bin/public-yum-downloader.sh -P /u02/stage/ -p http://proxy:3128 -r el5_oracle_addons --url http://mirandaa00/stage
    ~/bin/public-yum-downloader.sh -P /u02/stage/ -p http://proxy:3128 -r ol6_playground_latest


    the -l will look on that path to find the rpm, useful for example if you have a dvd and you want to use as initial cache

    I do run my commands in that way as when 5.9 came out, I had a lot of those rpms in 5.8 or 5 latest, rite?
    Worst thing that could happen, is the rpm is not there, and will have to download, but if it's there will copy it

    for UEK and addons those are unique rpm, so I don't use -l

    for the playground, that are the new kernel based on 3.x directly, i don't use --url, as I don't wat the script to enable that repo, but I do want to download what that channel have

    so, for known versions 6.0 to 6.4 you can use -R 6.n or even -R 6.UEK

    for other repos you can pass the name as -r repo


    Regarding the OVM3, the OVM3 is not on the repo, so I don't use my script for that, however, you can use the tools your self

    mkdir -p /u02/stage/repo/OracleVM/OVM3/latest/x86_64/repodata/.cache

    and create a repo file

    cat /u02/stage/public-yum-ovm3.repo

    [ovm3_latest]
    name=Oracle Linux $releasever Latest (x86_64)
    baseurl=http://public-yum.oracle.com/repo/OracleVM/OVM3/latest/x86_64/
    gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
    gpgcheck=1
    enabled=1

    Then, you can download what is there as:

    http_proxy=http://proxy:3128 yumdownloader -c /u02/stage/public-yum-ovm3.repo --destdir=/u02/stage/repo/OracleVM/OVM3/latest/x86_64/ '*'
    createrepo -v -c /u02/stage/repo/OracleVM/OVM3/latest/x86_64/repodata/.cache /u02/stage/repo/OracleVM/OVM3/latest/x86_64

    Please, take note the yumdownloader use --destdir=/path  then SPACE, then what you want to download, as we want a mirror, space '*'

    any question, here, or feel free to mailme at kikitux.net@gmail.com

    if you have time, check http://kikitux.net


    Alvaro.

    Edited by: Alvaro Miranda on Apr 18, 2013 4:43 PM
  • 16. Re: Oracle Public Yum problems today (23/01/13)
    alvaromiranda Explorer
    Currently Being Moderated
    Updated the script so now it included the errata on the created mirror.

    Script can be located at:

    https://github.com/kikitux/public-yum-downloader

    Direct RAW access:
    https://raw.github.com/kikitux/public-yum-downloader/master/public-yum-downloader.sh
  • 17. Re: Oracle Public Yum problems today (23/01/13)
    Avi Miller Guru
    Currently Being Moderated
    Alvaro Miranda wrote:
    I wrote an script to download and create a local mirror from public-yum
    Your script should be using the modifyrepo command to add the updateinfo.xml.gz file into the repomd.xml, and not do it manually. We have released a new createrepo RPM that contains an updated version of modifyrepo that accepts the checksum and simple-md-filenames parameters.
  • 18. Re: Oracle Public Yum problems today (23/01/13)
    alvaromiranda Explorer
    Currently Being Moderated
    Thanks for the tip Avi.

    I did in that ugly way in the meantime I did figure how to leave something that worked OL6->OL5 and OL5->OL5

    I did update and works perfect.

    When the host is OL6, I end using:

    modifyrepo checksum sha simple-md-filenames "$container_rootfs/$basepath/repodata/updateinfo.xml"

    Thanks again,
    Alvaro.
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points