패키지를 제거하고 다시 설치하는 명령 패키지가 제거되었는지 확인하고 다시 설치해야합니다. 종속성을 처리하는

때때로 패키지가 손상되어 처음부터 다시 설치해야합니다. apt-get purge그다음에을 사용할 수 apt-get install있지만 종속 패키지가 제거되었는지 확인하고 다시 설치해야합니다.

종속성을 처리하는 패키지를 제거하고 다시 설치하는 명령이 있습니까? 패키지를 다시 설치할 패키지에 의존하는 경우 해당 패키지를 그대로 두거나 다시 설치해야합니다.



답변

권장하지는 않지만 언더컷 apt으로 바로 이동할 수 있습니다 dpkg.

예를 들어, postfixand postfix-dev:

$ sudo apt-get purge postfix
Reading package lists... Done
Building dependency tree
Reading state information... Done.
The following packages will be REMOVED:
  postfix* postfix-dev*
0 upgraded, 0 newly installed, 2 to remove and 99 not upgraded.
After this operation, 4449 kB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.

이제 우리는 부양 가족 dpkg을 제거 postfix하지 않고 제거하는 데 사용 합니다 .

$ sudo dpkg --purge --force-depends postfix
dpkg: postfix: dependency problems, but removing anyway as you requested:
 postfix-dev depends on postfix (>= 3.1.0-0).
 postfix-dev depends on postfix (<< 3.1.0.0-0).
 postfix-dev depends on postfix (>= 3.1.0-0).
 postfix-dev depends on postfix (<< 3.1.0.0-0).

(Reading database ... 293223 files and directories currently installed.)
Removing postfix (3.1.0-3) ...
Purging configuration files for postfix (3.1.0-3) ...
Processing triggers for libc-bin (2.23-0ubuntu5) ...
Processing triggers for man-db (2.7.5-1) ...

이제 다시 설치하십시오 postfix.

$ sudo apt-get install postfix
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  procmail postfix-mysql postfix-pgsql postfix-ldap postfix-pcre sasl2-bin dovecot-common postfix-cdb postfix-doc
The following NEW packages will be installed:
  postfix
0 upgraded, 1 newly installed, 0 to remove and 99 not upgraded.
Need to get 0 B/1152 kB of archives.
After this operation, 3697 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package postfix.
(Reading database ... 293035 files and directories currently installed.)
Preparing to unpack .../postfix_3.1.0-3_amd64.deb ...
Unpacking postfix (3.1.0-3) ...
...


답변