0017951: Missing source code for CentOS 8-stream

0017951: Missing source code for CentOS 8-stream

Source code is an IMPORTANT requirement for publishers of GPL and similar-licensed products. It is also a binding legal responsibility…<br />
<br />
Full details are here: <a href="https://unix.stackexchange.com/questions/624738/what-is-the-correct-way-to-enable-source-downloads-in-centos-8-stream">https://unix.stackexchange.com/questions/624738/what-is-the-correct-way-to-enable-source-downloads-in-centos-8-stream</a><br />
<br />
I tried to do this:-<br />
<br />
yumdownloader –source sendmail<br />
But hit this problem:-<br />
<br />
Last metadata expiration check: 0:08:48 ago on Wed 16 Dec 2020 10:34:00 AM GMT.<br />
No package sendmail-8.15.2-34.el8.src available.<br />
Exiting due to strict setting.<br />
Error: No package sendmail-8.15.2-34.el8.src available.<br />
So I made sure epel etc is installed, and I enabled all things in /etc/yum.repos.d – but there’s no existing source info.<br />
<br />
The CensOS doc unhelpfully says this:-<br />
<br />
Source RPMs will also be published once the release is done, in the usual location at <a href="http://vault.centos.org/centos/8/">http://vault.centos.org/centos/8/</a><br />
<br />
From a CentOS machine you can easily retrieve sources using the yumdownloader –source <packagename> command.<br />
<br />
Now; the stream release is not /8/ in "CentOS-Stream-AppStream.repo" – it is actually /8-stream/ – and sure enough, I can find my sendmail binary in <a href="http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/sendmail-8.15.2-34.el8.x86_64.rpm">http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/sendmail-8.15.2-34.el8.x86_64.rpm</a> – as you can tell from cd /etc/dnf/vars;cat `grep . *` which reveals their variables thus: contentdir:centos infra:stock stream:8-stream (the CentOS-Stream-AppStream.repo base URL is <a href="http://mirror.centos.org/$contentdir/$stream/AppStream/$basearch/os/">http://mirror.centos.org/$contentdir/$stream/AppStream/$basearch/os/</a> )<br />
<br />
HOWEVER…<br />
<br />
<a href="https://vault.centos.org/centos/8-stream/">https://vault.centos.org/centos/8-stream/</a> contains only empty folders – no repodata or source files, and the /8/ tree does not contain the stream source … grrr.<br />
<br />
I created the below to enable all the /8/ Source files, but sendmail-8.15.2-34.el8.src.rpm is not one of them :-(<br />
<br />
cat CentOS-Stream-Source.repo<br />
<br />
<br />
[baseos-source]<br />
name=CentOS Stream $releasever – BaseOS – Source<br />
#baseurl=<a href="http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/">http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/</a><br />
baseurl=<a href="https://vault.centos.org/$contentdir/$releasever/BaseOS/Source">https://vault.centos.org/$contentdir/$releasever/BaseOS/Source</a><br />
# /usr/libexec/platform-python -c ‘import dnf, json; db = dnf.dnf.Base(); print(json.dumps(db.conf.substitutions, indent=2))’ => { "arch": "x86_64", "basearch": "x86_64", "releasever": "8" }<br />
# See also: cd /etc/dnf/vars;grep . * => contentdir:centos infra:stock stream:8-stream<br />
#metalink=<a href="https://mirrors.fedoraproject.org/metalink?repo=epel-source-$releasever&arch=$basearch&infra=$infra&content=$contentdir">https://mirrors.fedoraproject.org/metalink?repo=epel-source-$releasever&arch=$basearch&infra=$infra&content=$contentdir</a><br />
enabled=1<br />
gpgkey=<a href="file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8">file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8</a><br />
gpgcheck=1<br />
<br />
[appstream-source]<br />
name=CentOS Stream $releasever – AppStream – Source<br />
baseurl=<a href="https://vault.centos.org/$contentdir/$releasever/AppStream/Source">https://vault.centos.org/$contentdir/$releasever/AppStream/Source</a><br />
enabled=1<br />
gpgkey=<a href="file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8">file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8</a><br />
gpgcheck=1<br />
<br />
[highavailability-source]<br />
name=CentOS Stream $releasever – HighAvailability – Source<br />
baseurl=<a href="https://vault.centos.org/$contentdir/$releasever/HighAvailability/Source">https://vault.centos.org/$contentdir/$releasever/HighAvailability/Source</a><br />
enabled=1<br />
gpgkey=<a href="file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8">file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8</a><br />
gpgcheck=1<br />
<br />
[powertools-source]<br />
name=CentOS Stream $releasever – PowerTools – Source<br />
baseurl=<a href="https://vault.centos.org/$contentdir/$releasever/PowerTools/Source">https://vault.centos.org/$contentdir/$releasever/PowerTools/Source</a><br />
enabled=1<br />
gpgkey=<a href="file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8">file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8</a><br />
gpgcheck=1<br />
<br />
[centosplus-source]<br />
name=CentOS Stream $releasever – centosplus – Source<br />
baseurl=<a href="https://vault.centos.org/$contentdir/$releasever/centosplus/Source">https://vault.centos.org/$contentdir/$releasever/centosplus/Source</a><br />
enabled=1<br />
gpgkey=<a href="file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8">file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8</a><br />
gpgcheck=1<br />
<br />
[extras-source]<br />
name=CentOS Stream $releasever – extras – Source<br />
baseurl=<a href="https://vault.centos.org/$contentdir/$releasever/extras/Source">https://vault.centos.org/$contentdir/$releasever/extras/Source</a><br />
enabled=1<br />
gpgkey=<a href="file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8">file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8</a><br />
gpgcheck=1

* This article was originally published here

Leave a Reply

Your email address will not be published. Required fields are marked *