달력

12

« 2018/12 »

  •  
  •  
  •  
  •  
  •  
  •  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  •  
  •  
  •  
  •  
  •  

우분투 - 패키지 삭제시 에러 처리방법


만약 opsview-web 패키지 삭제시

subprocess installed pre-removal script returned error exit status 1

이런 에러가 생기면 체크 스크립트를 건너뛰게 하면 됩니다.



# apt-get remove --purge opsview-web
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following packages will be REMOVED:
  opsview-web*
0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded.
1 not fully installed or removed.
After this operation, 5,183 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 124433 files and directories currently installed.)
Removing opsview-web (5.4.1.172761208-1xenial1) ...
Unmonitoring opsview-web before remove

dpkg: error processing package opsview-web (--purge):
 subprocess installed pre-removal script returned error exit status 1
Errors were encountered while processing:
 opsview-web
E: Sub-process /usr/bin/dpkg returned an error code (1)

# cd /var/lib/dpkg/info

# ls opsview-web*
opsview-web.list  opsview-web.md5sums  opsview-web.postinst  opsview-web.postrm  opsview-web.preinst  opsview-web.prerm

지금은 pre-removal 에러이지만, 확장자를 자세히 보면 post-install 에러시 postinst 파일이,

post-removal 에러시 postrm 파일이 관련있다는걸 알 수 있습니다.


# vi opsview-web.prerm

이 안에 있는 스크립트를 모두 주석처리 하거나 내용을 모두 삭제하면 됩니다.

그 다음 삭제를 하면 됩니다. 나중을 위해 설정파일들은 백업하고, 설정파일 삭제까지 (purge 옵션) 해야 깔끔합니다.


# apt-get remove --purge opsview-web
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following packages will be REMOVED:
  opsview-web*
0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded.
1 not fully installed or removed.
After this operation, 5,183 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 124433 files and directories currently installed.)
Removing opsview-web (5.4.1.172761208-1xenial1) ...
Reloading Opsview Watchdog
Reinitializing opsview-monit daemon

Purging configuration files for opsview-web (5.4.1.172761208-1xenial1) ...



Posted by 멋지다마라송


티스토리 툴바