2013年5月30日木曜日

apt-get パッケージを設定ファイルごとremove

apt-get --purge remove パッケージ名

Debianのstableが、Wheezyになってる事に気づきました。
レンタルしてるVPSの環境をアップグレード。

途中、sudoの定義ファイルのフォーマットが変わったようで、古い設定を使うか新しいのに更新するか聞かれたので、「古い設定を使用」を選択。

しばらくして、ようやくアップグレード完了。

とおもったが、、sudoでsbinに入ってるコマンドを指定すると、「コマンドが見つかりません」
フルパス指定すれば動くのだけど。

思い切ってsudoをインストールしなおす。
# apt-get remove sudo
# apt-get install sudo

これでは定義の/etc/sudoersが残っていて同じ事。

# apt-get --purge remove sudo
# apt-get install sudo

で新しいまっさらな定義になりました。
(その後visudoでユーザ追加作業)



後で調べたところ
sudoerファイルに
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

の一行追加すればよいみたいです。


------------------------------------------------
sudo (1.8.2-1) unstable; urgency=low

  The sudo package is no longer configured using --with-secure-path.
  Instead, the provided sudoers file now contains a line declaring
  'Defaults secure_path=' with the same path content that was previously
  hard-coded in the binary.  A consequence of this change is that if you
  do not have such a definition in sudoers, the PATH searched for commands
  by sudo may be empty.

  Using explicit paths for each command you want to run with sudo will work
  well enough to allow the sudoers file to be updated with a suitable entry
  if one is not already present and you choose to not accept the updated
  version provided by the package.
  
 -- Bdale Garbee  Wed, 24 Aug 2011 13:33:11 -0600




0 件のコメント:

コメントを投稿