I met the same problem after installing a new python version 3.10 and chose this python version as the default python. I used following command line changing the python version from 3.8 to 3.10
sudo update-alternatives --config python3
Then, the problem occurred.
I think if you got the same problem as mine you can fix it by just changing the python version back to the old one.
You can check whether it is the issue of python version by using following command:
run-parts /etc/update-motd.d/
After running above command I got following warnings:
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-1042-azure x86_64)
* Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage
System information as of Wed Jul 26 03:08:59 UTC 2023
Traceback (most recent call last): File "/usr/bin/landscape-sysinfo", line 22, in <module>
run(sys.argv[1:], reactor) File "/usr/lib/python3/dist-packages/landscape/sysinfo/deployment.py", line 115, in run
for plugin in config.get_plugins(): File "/usr/lib/python3/dist-packages/landscape/sysinfo/deployment.py", line 69, in get_plugins
return [namedClass("landscape.sysinfo.%s.%s" File "/usr/lib/python3/dist-packages/landscape/sysinfo/deployment.py", line 69, in <listcomp>
return [namedClass("landscape.sysinfo.%s.%s" File "/usr/lib/python3/dist-packages/twisted/python/reflect.py", line 173, in namedObject
module = namedModule('.'.join(classSplit[:-1])) File "/usr/lib/python3/dist-packages/twisted/python/reflect.py", line 159, in namedModule
topLevel = __import__(name) File "/usr/lib/python3/dist-packages/landscape/sysinfo/network.py", line 4, in <module>
from netifaces import AF_INET, AF_INET6 ModuleNotFoundError: No module named 'netifaces' run-parts: /etc/update-motd.d//50-landscape-sysinfo exited with return code 1
* Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8s just raised the bar for easy, resilient and secure K8s cluster deployment.
https://ubuntu.com/engage/secure-kubernetes-at-the-edge
Expanded Security Maintenance for Applications is not enabled.
0 updates can be applied immediately.
2 additional security updates can be applied with ESM Apps. Learn more about enabling ESM Apps service at https://ubuntu.com/esm
Hope above information help!