ubuntu系统下source: not found错误

时间:2025-02-23 09:52:47

ubuntu系统下运行含有source命令的Shell脚本时,出现source: not found错误,原因可能是Shell的解释器不是bash,需把Shell的解释器更改为bash。

请按以下步骤更改Shell的解释器:

  1. 执行ls -l /bin/sh命令,若得到结果/bin/sh -> dash,则说明Shell的解释器为dash。
  2. 执行sudo dpkg-reconfigure dash命令,然后选择no。
  3. 再次执行ls -l /bin/sh命令,若得到结果/bin/sh -> bash,则说明成功更改Shell的解释器为bash。

参考链接:如何解决ubuntu系统下source: not found错误?_Alibaba Cloud Toolkit-阿里云帮助中心