yum and offline repo: Error importing repomd.xml

Issue #13 closed
Former user created an issue

I have followed the instruction listed under "Offline Install Instructions (without ACS) and called the local repo for "local". When I tries to use the local repo, for example with "yum repolist" or any other yum command that will use the local repo I get the following messages:

file:///QOpenSys/etc/yum/IBMRepoLocalMirror/repo/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for local: Damaged repomd.xml file

I have tried to download the repomd.xml again but with the same results.

Does anyone have a solution for this? Has anyone got the offline installation to work?

Thanks in advance.

Comments (10)

  1. Jesse G

    What tool did you use to download the entire directory to IFS?

    The latest release of Access Client Solutions has a tool called "Open Source Package Management." Within that tool is a utility in the tools menu which should make this task more seamless. Please try that and let us know the results.

    The documentation should be updated accordingly.

  2. Krister Karlsson

    Thanks for the reply.

    I used plain ftp (FileZilla) to download the directory to my PC and then uploaded it to IFS on one of my IBM i.

    I have tried the ACS and the utility to download the directory to an local repo, but that didn't work either. We are not allowed to use ftp over Internet from our IBM i systems and the utility still needs ftp to be open in the firewall between the IBM i and ftp://public.dhe.ibm.com/software/ibmi/products/pase/rpms/repo to work. I think ACS really should act as a "bridge" between the the IBM i and the IBM repo so ftp is not required to create an local copy of the IBM repo.

    I have managed to get yum to work with http and be able to install RPMs from the IBM repo by editing the ibm.repo, but not with https, i guess you have to configure yum with the certificate, but I have been unable to find any documentation how to do that. Can you provide information on this site how to do it?

    Having yum working with the IBM repo using http and been able to install RPMs from the IBM repo using ACS, I am still unable to use the ACS utility to create an local copy of the repo, the utility does not honor the settings in ibm.repo and still tries to use ftp and I am unable to change this, the options are grayed out.

    I would prefer, if both installing directly from the IBM repo and aslo create an local copy of the repo, could be done with https.

  3. Jesse G

    IBM needs to provide the proper certificates and include them in the yum bundle for https to work. You can work around the issue (in an unsecure manner) by adding the following to ibm.repo:

    sslVerify=0
    

    In early 2019, I believe ACS will use https across the board also (in addition to the yum bundle using https), so ftp will be no longer needed. If you are interested in being an early tester when ACS gets that functionality, please let me know.

  4. Andrew Will

    Hello Jesse. If possible, I too would like to be an early tester for https access to the repos. My company does not allow for access to FTP sites and we are having trouble getting a local copy of the repo to work for us. Thank you.

  5. Kevin Adler

    I wrote a script you can use to download the repository.

    #!/usr/bin/env python3
    # -*- coding: utf-8 -*-
    
    from urllib.request import urlopen
    import xml.etree.ElementTree as ET
    import gzip
    import os
    import os.path
    import shutil
    
    REPO_URL = 'https://public.dhe.ibm.com/software/ibmi/products/pase/rpms/repo/'
    
    def download(filename):
        print(f"download {filename}")
    
        os.makedirs(os.path.dirname(filename), exist_ok=True)
        with open(filename, 'wb') as local, urlopen(REPO_URL+filename) as remote:
            shutil.copyfileobj(remote, local)
    
    namespace = {
        'rpm': 'http://linux.duke.edu/metadata/repo',
        'common': 'http://linux.duke.edu/metadata/common',
    }
    
    download('repodata/repomd.xml')
    with open('repodata/repomd.xml', 'rb') as repomd:
        root = ET.parse(repomd)
    
        for metafile in root.findall("./rpm:data/rpm:location", namespace):
            download(metafile.attrib['href'])
    
        url = REPO_URL + root.find("./rpm:data[@type='primary']/rpm:location", namespace).attrib['href']
    
        with urlopen(url) as primary_gz:
            with gzip.open(primary_gz) as primary:
                root = ET.parse(primary)
    
                for rpm in root.findall("./common:package/common:location", namespace):
                    download(rpm.attrib['href'])
    
    with open("ibm-local.repo", "w") as repo:
        repo.write(f"""[ibm-local]
    name=ibm-local
    baseurl=file://{os.getcwd()}
    enabled=1
    gpgcheck=0
    """)
    

    You need to create a directory in the IFS somewhere you want to host the repository, then cd to that directory and run the python file.

    eg.

    $ mkdir -p /QOpenSys/QIBM/UserData/repos/ibm-local
    $ cd /QOpenSys/QIBM/UserData/repos/ibm-local
    $ python3 ~/clonerepo.py
    

    You can then copy the ibm-local.repo file created to /QOpenSys/etc/yum/repos.d and edit the /QOpenSys/etc/yum/repos.d/ibm.repo file to set enabled=0 to disable it.

    If you want to host an internal http mirror of the repo, create an Apache server hosting the directory you created above and then create a repo file, changing the baseurl option to point at your http url.

  6. Christian Jorgensen

    Hi Jesse.

    I'm also interested in the https download and being an ACS early tester...

    Best regards, Christian

  7. Jesse G

    @chrjorgensen, @Andrew_Will, @krka01, et al, we do have a version available for early test. Feel free to contact IBM support and request the latest internal ACS builds or email me (jgorzins@us.ibm.com) and I will connect you. Thanks!

  8. Log in to comment