大家在Cent OS上使用「yum」命令安裝軟件時可能會出現「thread.error: can't start new thread」錯誤,這個錯誤的主要原因其實時因為系統內存不足時,yum無法獲取最快的鏡像而導致崩潰
問題舉例
1、例如我在「Digital Ocean VPS」上使用 yum 安裝軟件時就碰到下列問題
| 1 2 3 4 5 6 7 | [root@arefly /]# sudo yum install screen Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile epel/metalink                                            |  14 kB     00:00      Traceback (most recent call last): 省略...... thread.error: can't start new thread | 
解決方法
1、當然解決這個問題最簡單的方法其實是等待一段一件,讓內存空間多些的時候重試就可以了 
2、不過我們還是有其他方法的,那就是(暫時)停用「Fastest Mirror」功能
3、在命令端(SSH)中輸入下列代碼來編輯 fastestmirror.conf
| 1 | vi /etc/yum/pluginconf.d/fastestmirror.conf | 
4、首先輸入 i 進入編輯模式,然後把文件內的 enabled=1 改成 enabled=0 ,最後按下 Esc 並輸入 :wq 來保存文件
| 1 2 3 4 | [main] enabled=0 verbose=0 省略...... | 
5、這下就可以安裝啦(雖然速度有些慢。。。)
參考
解決thread.error: can’t start new thread錯誤
總結
1、當然在以後內存空間多些時大家也可以重新按上述方法重新把 enabled=0 改回 enabled=1 來開啟「Fastest Mirror」功能 
2、有問題可以回覆 
