今天在安装软件包的时候,发现执行add-apt-repository命令会出现错误,无法添加软件源
Traceback (most recent call last): File "/usr/bin/add-apt-repository", line 191, in原因:if not sp.add_source_from_shortcut(shortcut, options.enable_source): File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 777, in add_source_from_shortcut if worker.isAlive(): AttributeError: 'Thread' object has no attribute 'isAlive'
文件SoftwareProperties.py里引用了"isAlive",电脑上安装的Python版本是3.9.2,3.9已不支持这个方法。
解决方案:修改"/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py"文件,第777行的"isAlive"改成"is_alive"即可。



