Ubuntu sudo報錯command not found的解決方法
阿新 • • 發佈:2018-12-30
Ubuntu系統操作中,在使用sudo的時候出現sudo:source:command not found錯誤提示,遇到這種問題要如何處理呢?下面小編就給大家介紹下Ubuntu系統中報錯sudo:source:command not found的解決方法。
Ubuntu Server上執行以下命令,可以看到預設開啟的檔案數限制為1024個。
$ ulimit -n
1024
編輯/etc/profile配置檔案,在最後新增一行:
ulimit -SHn 65535
要讓配置生效:
$ sudo source /etc/profile
sudo: source: command not found
我們直接執行ulimit -SHn 65535命令又會怎麼樣呢?
$ ulimit -SHn 65535
-bash: ulimit: open files: cannot modify limit: Operation not permitted
$ sudo ulimit -SHn 65535
sudo: ulimit: command not found
普通使用者獲得root許可權後反而提示找不到命令了,該如何解決這個問題呢?
$ sudo -s
# source /etc/profile
再次執行ulimit,可以看到開啟檔案的限制數已改為65535了。
# ulimit -n
65535
上面就是Ubuntu解決sudo:source:command not found錯誤的方法介紹了,如果你碰到這個問題,可是嘗試使用本文介紹的方法進行處理,希望對你有所幫助。