简体   繁体   中英

Adding yum .repo to install RPM breaks build; other ways to install RPM? “HTTPS Error 404 - Not found”

I am trying to add a .repo file to the yum repository at /etc/yum.repos.d so I can point to a repo we have at Jfrog artifactory (artifactory.OurWebsite.com/artifactory/...) that has some RPMs that I need.

I am adding this .repo file inside a build script, ./build.sh in a repository we have that basically "builds" up a Red Hat Enterprise Linux OS on a OVF file, that we later install and run as a VirtualMachine (VM) on a Server running a VMWare ESXi (Can manage/hosts multiple VirtualMachines).

We have the build script working. It calls some other artifactory RPMs that it is pointed to, and uses yum install to install their RPMS. I even copied the code structure for the one I am trying to add. There is a section where it cats in some artifactories with this structure:

cat > /etc/yum.repos.d/csr.repo <<'CAT'

[Artifactory]
name=Artifactory
username=
password=
baseurl=https://artifactory.OurWebsite.com/artifactory/virtualrepo/PathToRepoData
gpgcheck=0
enabled=1

[Artifactory2]
name=Artifactory2
username=
password=
baseurl=https://artifactory.websitename.com/artifactory/repo2/PathToRepoData2
gpgcheck=0
enabled=1
CAT

yum install -y name-of-rpm1 name-of-rpm2 ...

Everytime I add the REPO in question, that I am trying to add, it breaks the entire build process because when yum install is called, it returns:

failure: repodata/repod.xml from Artifactory1: [Errno 256] No more mirros to try
https://artifactory.OurWebsite.com/artifactory/virtualrepo/PathToRepoData/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not found

Another engineer told me it could be related to a DNS issue where we can't reach this artifactory behind our firewall, and thus it cannot resolve the FQDN of the artifactory...

...But I am running in a Sandbox environment where there "should" be no firewall issues...can anyone please help? Could it be my baseurl path? I think I am pointing to not a normal artifactory repo but a "virtual repo"......

This was because my baseurl was wrong. It needed to point to the directory that contained the repomd.xml file, which is meta data created for the repo. It ended up being located at:

baseurl=https://artifactory.websitename.com/artifactory/

because it looks like it automatically appended repodata to the baseurl, and it was looking for the repomd.xml file so the final string was like: baseurl=https://artifactory.websitename.com/artifactory/repodata/repomd.xml

and this is what worked

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM