Why Leapp fais with "OSError: [Errno 2] No such file or directory: 'sysctl'" ?

Solution Verified - Updated -

Issue

  • leapp preupgrade fails with the error No such file or directory.

    ~~~
    Risk Factor: high (error)
    Title: Actor system_facts unexpectedly terminated with exit code: 1
    Summary: Traceback (most recent call last):
    File "/usr/lib/python2.7/site-packages/leapp/repository/actor_definition.py", line 74, in _do_run
    actor_instance.run(*args, **kwargs)
    File "/usr/lib/python2.7/site-packages/leapp/actors/__init__.py", line 289, in run
    self.process(*args)
    File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/systemfacts/actor.py", line 53, in process
    self.produce(systemfacts.get_sysctls_status())
    File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py", line 215, in get_sysctls_status
    return SysctlVariablesFacts(sysctl_variables=_get_sysctls())
    File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py", line 41, in inner
    return list(f(*args, **kwargs))
    File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py", line 188, in _get_sysctls
    for sc in run(['sysctl', '-a'], split=True)['stdout']:
    File "/usr/lib/python2.7/site-packages/leapp/libraries/stdlib/__init__.py", line 185, in run
    stdin=stdin, env=env, encoding=encoding)
    File "/usr/lib/python2.7/site-packages/leapp/libraries/stdlib/call.py", line 147, in _call
    raise OSError(errno.ENOENT, os.strerror(errno.ENOENT), command[0])
    OSError: [Errno 2] No such file or directory: 'sysctl'
    ~~~

Environment

  • Red Hat Enterprise Linux 7.9.
  • Leapp

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content