퍼지와 dpkg -P의 차이점은 무엇입니까?


9

프로덕션 서버에서 phpmyadmin을 제거하고 googled하고 다음을 사용했습니다.

sudo dpkg -P phpmyadmin

글쎄, 이것은 잘 작동했지만 우분투의 다른 모든 사람들이 대신 퍼지를 사용하고있는 것 같습니다.

sudo apt-get purge phpmyadmin 

내가 잘못 했어? 내가 알아야 할 결과 (결국 프로덕션 서버 임) phpmyadmin의 모든 비트가 실제로 dpkg -P를 통해 제거됩니까?


dpkg의 맨 페이지에서 "-P, --purge package"라고 표시되어 있으므로 -P는 'purge'를 의미하므로 생각하면 동일합니다. 나는 개인적으로 'apt-get을 퍼지'를 사용
hytromo

답변:


5

dpkgapt-get소프트웨어를 설치하는 2 개 가지 방법이 있습니다. 기본적으로 apt-get, aptitude 및 synaptic은 데비안의 dpkg 패키지 관리 프로그램 위에 구축되었습니다. 모두 동일한 기본 기능인 패키지 관리를 수행하지만 몇 가지 추가 기능이 있습니다. apt-get의 추가 기능 중 하나는 종속성을 설치하지만 dpkg는 설치하지 않는다는 것입니다.

-p / purge와 관련하여 ...

-Pdpkg수단 --purge과 setttings 및 구성 파일을 포함하여 모든 것을 제거합니다. 매뉴얼에서 :

-r, --remove, -P, --purge package...|-a|--pending

          Remove  an  installed  package. -r or --remove remove everything
          except conffiles. This may avoid having to reconfigure the pack‐
          age  if  it  is  reinstalled later. (Conffiles are configuration
          files that are listed in the DEBIAN/conffiles control file).  -P
          or  --purge  removes  everything,  including conffiles. If -a or
          --pending is given instead of a package name, then all  packages
          unpacked,   but   marked   to  be  removed  or  purged  in  file
          /var/lib/dpkg/status, are removed or purged, respectively. Note:
          some  configuration  files might be unknown to dpkg because they
          are created and handled  separately  through  the  configuration
          scripts. In that case, dpkg won't remove them by itself, but the
          package's postrm script (which is called by dpkg), has  to  take
          care of their removal during purge. Of course, this only applies
          to files in system directories, not configuration files  written
          to individual users' home directories.

          Removing of a package consists of the following steps:

          1. Run prerm script

          2. Remove the installed files

          3. Run postrm script

에서 동일하게 진행 purge됩니다 apt-get.

 remove
       remove is identical to install except that packages are removed
       instead of installed. Note the removing a package leaves its
       configuration files in system. If a plus sign is appended to the
       package name (with no intervening space), the identified package
       will be installed instead of removed.


 purge
       purge is identical to remove except that packages are removed and
       purged (any configuration files are deleted too).

기본적으로 동일한 옵션입니다. dpkg에서는 종속성 제거가 발생하지 않습니다. apt-get은 의존성을 제거합니다

Lekensteyn의 의견 문서 :


+1도 비슷한 대답을하려고했습니다. 설명서 : debian.org/doc/manuals/debian-faq/ch-pkgtools.en.html . 의존성이 강조되어야한다. 예 : 제거 php5하면 phpmyadmin다른 PHP SAPI가 없다고 가정해도 제거됩니다. apt이걸 다룰 수 있고, dpkg스스로 할 수는 없습니다.
Lekensteyn

우수한 레켄 스테인. 여전히 찾고 있었다 (의존적 인 것들이 나를 잔소리하고 있었다). :)에 추가 :) 당신이 더 있다면 내 대답을 자유롭게 편집하십시오 : D
Rinzwind

누군가가 사용 후 종속성 문제 안타 경우의 벌금 : dpkg직접 (들) 그는 그것을 수정할 수 있습니다 sudo apt-get install -f(에 의해 제안 dpkg)
Lekensteyn

조언 해 주셔서 감사합니다. 따라서 sudo apt-get install -f phpmyadmin종속성을 삭제하기 위해 필자의 경우를 수행 합니까? 종속성이 공유되면 어떻게됩니까?
Houman

설치된 패키지가 없으면 @Kave 종속성이 수동으로 제거됩니다.
nanofarad
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.