{"record":{"id":"bb62a515f0b72b9e","repo":"puppetlabs/puppet","slug":"could-not-find-package-name-bb62a5","errorCode":null,"errorMessage":"Could not find package %{name}","messagePattern":"Could not find package %(.+?)","errorType":"exception","errorClass":"Puppet::ExecutionFailure","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/package/up2date.rb","lineNumber":18,"sourceCode":"# frozen_string_literal: true\n\nPuppet::Type.type(:package).provide :up2date, :parent => :rpm, :source => :rpm do\n  desc \"Support for Red Hat's proprietary `up2date` package update\n    mechanism.\"\n\n  commands :up2date => \"/usr/sbin/up2date-nox\"\n\n  defaultfor 'os.family' => :redhat, 'os.distro.release.full' => [\"2.1\", \"3\", \"4\"]\n\n  confine    'os.family' => :redhat\n\n  # Install a package using 'up2date'.\n  def install\n    up2date \"-u\", @resource[:name]\n\n    unless query\n      raise Puppet::ExecutionFailure, _(\"Could not find package %{name}\") % { name: name }\n    end\n  end\n\n  # What's the latest package version available?\n  def latest\n    # up2date can only get a list of *all* available packages?\n    output = up2date \"--showall\"\n\n    if output =~ /^#{Regexp.escape @resource[:name]}-(\\d+.*)\\.\\w+/\n      Regexp.last_match(1)\n    else\n      # up2date didn't find updates, pretend the current\n      # version is the latest\n      @property_hash[:ensure]\n    end\n  end\n\n  def update","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/package/up2date.rb#L1-L36","documentation":"The up2date provider (RHEL 2.1/3/4) runs 'up2date -u <name>' then re-queries; if rpm -q still cannot see the package it raises Puppet::ExecutionFailure 'Could not find package'. up2date is the legacy RHN client, so failure usually means the system is not registered to RHN or the subscribed channels lack the package.","triggerScenarios":"ensure => installed with provider => up2date on RHEL 2.1/3/4 (defaultfor those releases) when up2date exits without installing: no RHN registration, expired entitlement, package absent from subscribed channels, or a name/version the client cannot resolve.","commonSituations":"Legacy RHEL 3/4 hosts with lapsed RHN entitlements; /etc/sysconfig/rhn/sources misconfiguration; package names including versions that up2date rejects.","solutions":["Run 'up2date -u <name>' manually and read the RHN errors it prints","Re-register the system (rhn_register) and verify channel subscriptions ('up2date --show-channels')","Correct the resource to a plain package name with ensure => installed (no version suffix)","On any remotely modern system use the yum/dnf provider instead of up2date"],"exampleFix":"// before\npackage { 'gcc':\n  ensure   => '3.2.3-20',\n  provider => up2date,\n}\n// after - plain name; the provider has no reliable version pinning\npackage { 'gcc':\n  ensure   => installed,\n  provider => up2date,\n}","handlingStrategy":"validation","validationCode":"# Ruby: confirm RHN registration before up2date installs\ndef rhn_registered?\n  File.exist?('/etc/sysconfig/rhn/systemid') &&\n    Puppet::Util::Execution.execute(['/usr/sbin/up2date-nox', '--show-channels'], failonfail: false).exitstatus.zero?\nend","typeGuard":null,"tryCatchPattern":"begin\n  provider.install\nrescue Puppet::ExecutionFailure => e\n  raise unless e.message =~ /Could not find package/\n  raise Puppet::Error, \"#{resource[:name]} not in RHN channels - run rhn_register or fix entitlements\"\nend","preventionTips":["Keep RHN entitlements current on legacy RHEL 2.1-4 hosts","Verify names with 'up2date --showall' before pinning them in manifests","Migrate legacy hosts to yum-driven repos as soon as the OS allows"],"tags":["rhel","up2date","rhn","package-not-found","legacy"],"backgroundTag":"package-not-found","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}