失敗後にaptの自動削除をクリーンアップする方法は?

失敗後にaptの自動削除をクリーンアップする方法は?

パッケージを自動的に削除するためにクローンジョブの設定中にapt autoremove -yコマンドが失敗する問題が発生し、ジョブを再実行する方法がわかりません。私が試したことは次のとおりです。

  1. シェルでsudo apt autoremoveこれを実行すると、削除する「linux-aws-headers」タイプパッケージのリストが表示されました。

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following packages will be REMOVED:
      linux-aws-headers-4.4.0-1090 linux-aws-headers-4.4.0-1092 linux-aws-headers-4.4.0-1094 linux-aws-headers-4.4.0-1095 linux-aws-headers-4.4.0-1096 linux-aws-headers-4.4.0-1098 linux-aws-headers-4.4.0-1099 linux-aws-headers-4.4.0-1100 linux-aws-headers-4.4.0-1101 linux-aws-headers-4.4.0-1102 linux-aws-headers-4.4.0-1104 linux-aws-headers-4.4.0-1105 linux-aws-headers-4.4.0-1106 linux-headers-4.4.0-1090-aws linux-headers-4.4.0-1092-aws linux-headers-4.4.0-1094-aws linux-headers-4.4.0-1095-aws linux-headers-4.4.0-1096-aws
      linux-headers-4.4.0-1098-aws linux-headers-4.4.0-1099-aws linux-headers-4.4.0-1100-aws linux-headers-4.4.0-1101-aws linux-headers-4.4.0-1102-aws linux-headers-4.4.0-1104-aws linux-headers-4.4.0-1105-aws linux-headers-4.4.0-1106-aws linux-image-4.4.0-1090-aws linux-image-4.4.0-1092-aws linux-image-4.4.0-1094-aws linux-image-4.4.0-1095-aws linux-image-4.4.0-1096-aws linux-image-4.4.0-1098-aws linux-image-4.4.0-1099-aws linux-image-4.4.0-1100-aws linux-image-4.4.0-1101-aws linux-image-4.4.0-1102-aws linux-image-4.4.0-1104-aws
      linux-image-4.4.0-1105-aws linux-image-4.4.0-1106-aws linux-modules-4.4.0-1090-aws linux-modules-4.4.0-1092-aws linux-modules-4.4.0-1094-aws linux-modules-4.4.0-1095-aws linux-modules-4.4.0-1096-aws linux-modules-4.4.0-1098-aws linux-modules-4.4.0-1099-aws linux-modules-4.4.0-1100-aws linux-modules-4.4.0-1101-aws linux-modules-4.4.0-1102-aws linux-modules-4.4.0-1104-aws linux-modules-4.4.0-1105-aws linux-modules-4.4.0-1106-aws
    0 upgraded, 0 newly installed, 52 to remove and 54 not upgraded.
    After this operation, 1,746 MB disk space will be freed.
    Do you want to continue? [Y/n]
    
  2. apt autoremove -y代わりにcronを作成しました。

  3. cronジョブが実行されましたが、予想通りにスペースがクリーンアップされませんでした。 /usr/src/を確認しましたが、すべてのlinux-aws-headersエントリがまだ残っていますが、後続の実行ではsudo apt autoremove削除するパッケージがないとマークされています。

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    0 upgraded, 0 newly installed, 0 to remove and 54 not upgraded.
    
  4. 他のコンピュータではcronを実行してapt autoremove -y > somefile出力を確認しましたが、出力は次のようになります。

    Reading package lists...
    Building dependency tree...
    Reading state information...
    The following packages will be REMOVED:
      linux-aws-headers-4.4.0-1090 linux-aws-headers-4.4.0-1092
      linux-aws-headers-4.4.0-1094 linux-aws-headers-4.4.0-1095
      linux-aws-headers-4.4.0-1096 linux-aws-headers-4.4.0-1098
      linux-aws-headers-4.4.0-1099 linux-aws-headers-4.4.0-1100
      linux-aws-headers-4.4.0-1101 linux-aws-headers-4.4.0-1102
      linux-aws-headers-4.4.0-1104 linux-aws-headers-4.4.0-1105
      linux-aws-headers-4.4.0-1106 linux-headers-4.4.0-1090-aws
      linux-headers-4.4.0-1092-aws linux-headers-4.4.0-1094-aws
      linux-headers-4.4.0-1095-aws linux-headers-4.4.0-1096-aws
      linux-headers-4.4.0-1098-aws linux-headers-4.4.0-1099-aws
      linux-headers-4.4.0-1100-aws linux-headers-4.4.0-1101-aws
      linux-headers-4.4.0-1102-aws linux-headers-4.4.0-1104-aws
      linux-headers-4.4.0-1105-aws linux-headers-4.4.0-1106-aws
      linux-image-4.4.0-1090-aws linux-image-4.4.0-1092-aws
      linux-image-4.4.0-1094-aws linux-image-4.4.0-1095-aws
      linux-image-4.4.0-1096-aws linux-image-4.4.0-1098-aws
      linux-image-4.4.0-1099-aws linux-image-4.4.0-1100-aws
      linux-image-4.4.0-1101-aws linux-image-4.4.0-1102-aws
      linux-image-4.4.0-1104-aws linux-image-4.4.0-1105-aws
      linux-image-4.4.0-1106-aws linux-modules-4.4.0-1090-aws
      linux-modules-4.4.0-1092-aws linux-modules-4.4.0-1094-aws
      linux-modules-4.4.0-1095-aws linux-modules-4.4.0-1096-aws
      linux-modules-4.4.0-1098-aws linux-modules-4.4.0-1099-aws
      linux-modules-4.4.0-1100-aws linux-modules-4.4.0-1101-aws
      linux-modules-4.4.0-1102-aws linux-modules-4.4.0-1104-aws
      linux-modules-4.4.0-1105-aws linux-modules-4.4.0-1106-aws
    0 upgraded, 0 newly installed, 52 to remove and 54 not upgraded.
    After this operation, 1,746 MB disk space will be freed.
    dpkg: warning: 'ldconfig' not found in PATH or not executable
    dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
    dpkg: error: 2 expected programs not found in PATH or not executable
    Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
    

PATH出力に見られるように、明らかに何かが間違っています。 cronジョブでPATHを設定しましたが、ディスク容量がまだ使用されているにもかかわらず、手動で実行してもsudo apt autoremove表示されます。0 to remove私のアパートは今台無しになり、/usr/srcで手動でrmする必要がありますか?

ベストアンサー1

おすすめ記事