실패 후 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해야 합니까?

관련 정보