targetctl command not found
Introduction
When you run more command in linux terminal / console, you get the following error message
targetctl: command not found
or when using sudo you get the following error message
sudo: targetctl: command not found
Solutions to targetctl: command not found
How To Fix targetctl: command not found in Ubuntu / Debian / Kali Linux / Raspbian
In Ubuntu targetctl is provided by python3-rtslib-fb package.
python3-rtslib-fb is:
The rtslib-fb package is an object-based Python library for configuring the LIO generic SCSI target, present in 3.x Linux kernel versions.
The rtslib-fb package is a fork of the “rtslib” code written by RisingTide Systems. The “-fb” differentiates between the original and this version. Ensure to use either all “fb” versions of the targetcli components – targetcli, rtslib, and configshell, or stick with all non-fb versions, since they are no longer strictly compatible.
This package contains the Python 3.x module.
To fix this problem, we can install more using the command below.
sudo apt-get -y install python3-rtslib-fb
This command might take some time to finish depending on your machine internet connection.
You can also use apt command to install python3-rtslib-fb.
sudo apt -y install python3-rtslib-fb
Or if you have aptitude installed you can use the following command.
sudo aptitude install python3-rtslib-fb
Summary
In this tutorial we learn how to fix targetctl command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.