{"id":2358,"date":"2018-01-29T23:44:24","date_gmt":"2018-01-30T04:44:24","guid":{"rendered":"http:\/\/osric.com\/chris\/accidental-developer\/?p=2358"},"modified":"2018-01-29T23:44:24","modified_gmt":"2018-01-30T04:44:24","slug":"yum-error-requested-datatype-primary-not-available","status":"publish","type":"post","link":"https:\/\/osric.com\/chris\/accidental-developer\/2018\/01\/yum-error-requested-datatype-primary-not-available\/","title":{"rendered":"yum Error: requested datatype primary not available"},"content":{"rendered":"<p>I ran into a new-to-me <code>yum<\/code> error earlier today:<\/p>\n<p><code>$ yum --quiet check-updates<br \/>\nError: requested datatype primary not available<\/code><\/p>\n<p>Following the tips on <a href=\"https:\/\/unix.stackexchange.com\/questions\/114983\/error-requested-datatype-primary-not-available\">Unix &#038; Linux StackExchange: Error: requested datatype primary not available<\/a>, I:<\/p>\n<ul>\n<li>ran <code>yum clean all<\/code><\/li>\n<li>disabled repositories one at a time to identify the repo that was causing the error<\/li>\n<\/ul>\n<p>In my case, it turned out to be the <strong>extras<\/strong> repo. The following did not produce any errors:<\/p>\n<p><code>$ yum --quiet --disablerepo=extras check-updates<\/code><\/p>\n<p>What is wrong with the <strong>extras<\/strong> repo? It is defined in <code>\/etc\/yum.repos.d\/CentOS-Base.repo<\/code>, so I took a look at what was there:<\/p>\n<p><code>[extras]<br \/>\nname=CentOS-$releasever - Extras<br \/>\nmirrorlist=http:\/\/mirrorlist.centos.org\/?release=$releasever&amp;arch=$basearch&amp;repo=extras&amp;infra=$infra<br \/>\n#baseurl=http:\/\/mirror.centos.org\/centos\/$releasever\/extras\/$basearch\/<br \/>\ngpgcheck=1<br \/>\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-7<\/code><\/p>\n<p>None of that looked unusual (or had changed recently), so back to Google.<\/p>\n<p>I tried excluding the specific mirror that was listed for the extras repo (<a href=\"http:\/\/mirrors.unifiedlayer.com\/centos\/7.4.1708\/extras\/x86_64\/\">http:\/\/mirrors.unifiedlayer.com\/centos\/7.4.1708\/extras\/x86_64\/<\/a>) by adding unifiedlayer.com to the exclude line in <code>\/etc\/yum\/pluginconf.d\/fastestmirror.conf<\/code>, as described in <a href=\"http:\/\/sgros.blogspot.com\/2012\/10\/yum-and-fastestmirror-plugin.html\">yum and fastestmirror plugin<\/a>. Although <code>yum<\/code> appeared to pick a different mirror it still gave me the same error.<\/p>\n<p>It turns out, the mirror in question was &#8220;poisoned&#8221; (rerouted) by my DNS servers, as it had been identified (possibly erroneously) as malicious. As such, the domain still resolved but the path to the CentOS repository did not exist.<\/p>\n<p>I didn&#8217;t think that excluding the domain in <code>fastestmirror.conf<\/code> was having the intended effect, and <code>yum<\/code> was still trying to contact the bad mirror. I took the following steps, which resolved the error, although I can&#8217;t say I entirely understand why:<\/p>\n<p><code>$ sudo yum makecache<\/code><\/p>\n<p>This still produced the error.<\/p>\n<p>I removed the bad entry from:<\/p>\n<p><code>\/var\/cache\/yum\/x86_64\/7\/extras\/mirrorlist.txt<\/code><\/p>\n<p>Then I ran <code>makecache<\/code> again:<\/p>\n<p><code>$ sudo yum makecache<\/code><\/p>\n<p>No error this time! I tried running <code>check-update<\/code>:<\/p>\n<p><code>$ yum check-update<\/code><\/p>\n<p>No error!<\/p>\n<p>Shouldn&#8217;t <code>yum clean all<\/code> have eliminated the bad cache value in <code>\/var\/cache\/yum\/x86_64\/7\/extras\/mirrorlist.txt<\/code>?<\/p>\n<p>Cache invalidation, one of the hard problems. At least I have steps to take if I run into this problem again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I ran into a new-to-me yum error earlier today: $ yum &#8211;quiet check-updates Error: requested datatype primary not available Following the tips on Unix &#038; Linux StackExchange: Error: requested datatype primary not available, I: ran yum clean all disabled repositories one at a time to identify the repo that was causing the error In my &hellip; <a href=\"https:\/\/osric.com\/chris\/accidental-developer\/2018\/01\/yum-error-requested-datatype-primary-not-available\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">yum Error: requested datatype primary not available<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[422],"tags":[415,424],"class_list":["post-2358","post","type-post","status-publish","format-standard","hentry","category-sysadmin","tag-centos-7","tag-yum"],"_links":{"self":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2358","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/comments?post=2358"}],"version-history":[{"count":6,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2358\/revisions"}],"predecessor-version":[{"id":2367,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2358\/revisions\/2367"}],"wp:attachment":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/media?parent=2358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/categories?post=2358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/tags?post=2358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}