GrepBoard/매뉴얼
605 편 ·

dpkg was interrupted 해결 (configure -a)

·시험 환경 Ubuntu 24.04 (Docker) · apt 2.8.3 · dpkg 1.22.6 · 2026-10·시험 범위 ↓·5 단계

E: dpkg was interrupted 는 설치가 중간에 끊긴 상태입니다. 다른 apt 가 없는지 본 뒤 sudo dpkg --configure -a 로 마저 끝내고 원래 설치를 다시 합니다.

output
E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.

앞선 패키지 설치·업그레이드가 끝나기 전에 끊겨서(전원·SSH 끊김·Ctrl+C·메모리 부족으로 죽음 등) dpkg 가 하던 일이 남아 있다는 뜻입니다. 이 상태에서 apt 는 다른 설치를 모두 거절합니다. 다른 apt 가 돌고 있지 않은지 확인한 뒤 sudo dpkg --configure -a 로 남은 작업을 끝내면 됩니다.

[1] 지금 apt·dpkg 가 돌고 있는지 먼저 봅니다. 자동 업데이트(unattended-upgrades)가 한창 설치 중인데 끊긴 줄 알고 손을 대면 일이 더 꼬입니다.

console
$ ps -eo pid,comm | grep -E 'apt|dpkg|unattended' || echo '(no apt/dpkg process)'(no apt/dpkg process)

프로세스가 보이면 끝날 때까지 기다립니다. 이때 나오는 오류는 이 글의 문구가 아니라 잠금 오류입니다 — Could not get lock … lock-frontend 대처 를 봅니다. 잠금 파일을 지워서 넘어가지 않습니다.

[2] 무엇이 덜 끝났는지 봅니다. dpkg --audit 는 반만 설치된 패키지를 찾아 줍니다(man dpkg).

console
$ sudo dpkg --auditThe following packages are only half configured, probably due to problemsconfiguring them the first time.  The configuration should be retried usingdpkg --configure <package> or the configure menu option in dselect: python3.12-minimal   Minimal subset of the Python language (version 3.12) The following packages have been triggered, but the trigger processinghas not yet been done.  Trigger processing can be requested usingdselect or dpkg --configure --pending (or dpkg --triggers-only): libc-bin             GNU C Library: Binaries

여기 나온 패키지가 끊긴 작업의 대상입니다. 커널·libc·systemd 처럼 부팅에 걸린 패키지가 보이면 [3] 을 끝내기 전에는 재부팅하지 않습니다.

[3] 남은 설정을 끝냅니다. -a 는 「풀어 놓기만 하고 설정하지 않은 패키지를 모두 설정」합니다.

console
$ sudo dpkg --configure -aSetting up python3.12-minimal (3.12.3-1ubuntu0.17) ...Processing triggers for libc-bin (2.39-0ubuntu8.9) ...

설정 파일을 물어보는 질문이 나오면 읽고 답합니다. 끝난 뒤 dpkg --audit 가 아무것도 출력하지 않으면 정상입니다.

console
$ sudo dpkg --audit$ echo $?0

[4] 의존성을 맞추고 원래 하려던 설치를 다시 합니다. --configure -a 는 이미 받아 둔 패키지만 마무리하므로, 끊긴 설치에서 아직 받지 못했거나 풀지 못한 패키지는 들어오지 않습니다.

console
$ sudo apt-get -f installBuilding dependency tree...Reading state information...The following packages were automatically installed and are no longer required:  libexpat1 libpython3.12-minimal python3.12-minimalUse 'apt autoremove' to remove them.0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

-f(--fix-broken)는 깨진 의존성을 채웁니다. 이 예에서는 고칠 것이 없어 0 newly installed 로 끝났고, 끊기기 전에 풀린 의존 패키지(python3.12-minimal 등)를 「더 이상 필요 없다」고 표시했습니다. 처음 요청한 python3 가 들어오지 않았다는 뜻입니다. 여기서 apt autoremove 를 하지 말고 원래 하려던 설치를 다시 합니다.

console
$ sudo apt-get install python3

이 시험에서는 복구 뒤 다른 패키지(nano) 설치가 종료 코드 0 으로 끝나 apt 가 다시 정상 동작하는 것까지 확인했고, python3 재설치 자체는 돌리지 않았습니다. 업그레이드 중에 끊겼다면 sudo apt upgrade 를 다시 돌려 남은 패키지를 마저 올립니다.

[5] --configure -a 가 특정 패키지에서 실패하면 그 패키지의 오류 줄을 봅니다. 패키지의 설치 스크립트(post-installation script)가 실패했다는 줄이 보이면, 진짜 원인은 그보다 위에 찍힌 줄(디스크 공간·설정 파일 문법·서비스 시작 실패 등)에 있습니다. 디스크가 원인이면 디스크가 꽉 찼을 때 공간을 먹는 것 찾기 로 자리를 만든 뒤 [3] 을 다시 합니다.

#apt#dpkg#ubuntu#package