前提・実現したいこと
sudoを使ってpython3のプラグインpyswipをインストールしようと思い,
macOS(High Sierra バージョン10.13.6)のターミナルでsudoを実行したところ,
以下のようなエラーメッセージが出ました.
発生している問題・エラーメッセージ
sudoの他にdnfコマンドも見つからないと警告されています.
エラーメッセージ
$ sudo dnf install python3-pyswip
Password:
sudo: dnf: command not found
該当のソースコード
1 $ sudo visudoの出力結果 (#が含まれる行の行頭の>は太文字回避のためにあえてつけてあります,実際の出力結果には>はありません.)
$ sudo visudo
Password:
Defaults specification
#Defaults env_reset
Defaults env_keep += "BLOCKSIZE"
Defaults env_keep += "COLORFGBG COLORTERM"
Defaults env_keep += "__CF_USER_TEXT_ENCODING"
Defaults env_keep += "CHARSET LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE"
Defaults env_keep += "LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME"
Defaults env_keep += "LINES COLUMNS"
Defaults env_keep += "LSCOLORS"
Defaults env_keep += "SSH_AUTH_SOCK"
Defaults env_keep += "TZ"
Defaults env_keep += "DISPLAY XAUTHORIZATION XAUTHORITY"
Defaults env_keep += "EDITOR VISUAL"
Defaults env_keep += "HOME MAIL"
Defaults env_keep += "PATH"
Defaults lecture_file = "/etc/sudo_lecture"
Runas alias specification
User privilege specification
root ALL=(ALL) ALL
%admin ALL=(ALL) ALL
Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL) ALL
Same thing without a password
%wheel ALL=(ALL) NOPASSWD: ALL
Uncomment to allow members of group sudo to execute any command
%sudo ALL=(ALL) ALL
Uncomment to allow any user to run sudo if they know the password
of the user they are running the command as (root by default).
Defaults targetpw # Ask for the password of the target user
ALL ALL=(ALL) ALL # WARNING: only use this together with 'Defaults targetpw'
Read drop-in files from /private/etc/sudoers.d
(the '#' here does not indicate a comment)
#includedir /private/etc/sudoers.d
2 .bash_profile
PATH=$PATH:$HOME/bin:/sbin:/usr/sbin:/usr/local/bin
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
3 .bashrc
export PYTHONPATH=:/Users/Nishina/anaconda/lib/python3.5/site-packages:$PYTHONPATH
試したこと
https://qiita.com/iwaseasahi/items/6e00883ccd0864ede17e
https://blog.thingslabo.com/archives/000395.html
https://cha-shu00.hatenablog.com/entry/2017/03/02/123659
上のsudo command not found の問題について解決策を公開してくださった記事を参考にして
.bash_profileと.bashrcを編集してみた(上に提示した.bash_profileと.bashrcの両者は編集後の状態)のですが, 同じエラーメッセージが出ます.
$ sudo dnf install python3-pyswip
Password:
sudo: dnf: command not found
補足情報(FW/ツールのバージョンなど)
その他に試してみたコマンドとその出力結果を記載します.
$ whereis sudo
/usr/bin/sudo
$ echo $PATH
/Library/Frameworks/Python.framework/Versions/3.5/bin
:/usr/local/bin
:/usr/bin:/bin
:/usr/sbin:/sbin
:/Library/TeX/texbin
:/opt/Ghostscript/bin
:/opt/X11/bin
:/opt/ImageMagick/bin
:/Users/Nishina/bin
:/sbin
:/usr/sbin
:/usr/local/bin
何か対応策があったらお教えくださると大変助かります. よろしくお願いいたします.
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/01/10 09:27