기록에 나열된 패키지를 쉽게 제거하려면 어떻게 해야 합니까?

기록에 나열된 패키지를 쉽게 제거하려면 어떻게 해야 합니까?

내 이력이 다음과 같다고 가정해 보겠습니다.

Start-Date: 2016-09-20  15:49:21
Commandline: apt-get install kchmviewer
Install: libkde3support4:amd64 (4.14.2-5+deb8u1, automatic), libresid-builder0c2a:amd64 (2.1.1-14, automatic), ntrack-module-libnl-0:amd64 (016-1.3, automatic), libmpeg2-4:amd64 (0.5.1-7, automatic), libwinpr-thread0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libkrosscore4:amd64 (4.14.2-5+deb8u1, automatic), libgpgme++2:amd64 (4.14.2-2+b1, automatic), oxygen-icon-theme:amd64 (4.14.0-1, automatic), libktexteditor4:amd64 (4.14.2-5+deb8u1, automatic), kdelibs5-data:amd64 (4.14.2-5+deb8u1, automatic), libchm1:amd64 (0.40a-3+b1, automatic), kchmviewer:amd64 (6.0-1), libcrystalhd3:amd64 (0.0~git20110715.fdd2f19-11, automatic), libdc1394-22:amd64 (2.2.3-1, automatic), libkdeui5:amd64 (4.14.2-5+deb8u1, automatic), libkdeclarative5:amd64 (4.14.2-5+deb8u1, automatic), libfam0:amd64 (2.7.0-17.1, automatic), libthreadweaver4:amd64 (4.14.2-5+deb8u1, automatic), libfreerdp-client1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libwinpr-utils0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libqt4-sql-mysql:amd64 (4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1, automatic), libfreerdp-core1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), kde-runtime:amd64 (4.14.2-2, automatic), libchromaprint0:amd64 (1.2-1, automatic), libwinpr-synch0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libkparts4:amd64 (4.14.2-5+deb8u1, automatic), nepomuk-core-data:amd64 (4.14.0-1, automatic), libqt4-sql:amd64 (4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1, automatic), libexiv2-13:amd64 (0.24-4.1, automatic), libqca2:amd64 (2.0.3-6, automatic), libntrack0:amd64 (016-1.3, automatic), upower:amd64 (0.99.1-3.2, automatic), kde-runtime-data:amd64 (4.14.2-2, automatic), libphonon4:amd64 (4.8.0-4, automatic), libwinpr-pool0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libkemoticons4:amd64 (4.14.2-5+deb8u1, automatic), vlc-plugin-notify:amd64 (2.2.4-1~deb8u1, automatic), libnepomukquery4a:amd64 (4.14.2-5+deb8u1, automatic), libkmediaplayer4:amd64 (4.14.2-5+deb8u1, automatic), libwinpr-handle0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libwinpr-crt0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libvlccore8:amd64 (2.2.4-1~deb8u1, automatic), libqt4-qt3support:amd64 (4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1, automatic), libdvbpsi9:amd64 (1.2.0-1, automatic), libfreerdp-cache1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libwinpr-interlocked0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), katepart:amd64 (4.14.2-2, automatic), libproxy-tools:amd64 (0.4.11-4+b2, automatic), vlc-nox:amd64 (2.2.4-1~deb8u1, automatic), libkdnssd4:amd64 (4.14.2-5+deb8u1, automatic), soprano-daemon:amd64 (2.9.4+dfsg-1.1, automatic), libupnp6:amd64 (1.6.19+git20141001-1, automatic), phonon:amd64 (4.8.0-4, automatic), libsoprano4:amd64 (2.9.4+dfsg-1.1, automatic), libdbusmenu-qt2:amd64 (0.9.2-1, automatic), libkatepartinterfaces4:amd64 (4.14.2-2, automatic), vlc-plugin-samba:amd64 (2.2.4-1~deb8u1, automatic), libusageenvironment1:amd64 (2014.01.13-1, automatic), kdelibs5-plugins:amd64 (4.14.2-5+deb8u1, automatic), libqt4-script:amd64 (4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1, automatic), libebml4:amd64 (1.3.0-2+deb8u1, automatic), libxcb-xv0:amd64 (1.10-3+b1, automatic), libkjsapi4:amd64 (4.14.2-5+deb8u1, automatic), libcddb2:amd64 (1.3.2-5, automatic), libbasicusageenvironment0:amd64 (2014.01.13-1, automatic), libkactivities6:amd64 (4.13.3-1, automatic), libfreerdp-codec1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libwinpr-input0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libgroupsock1:amd64 (2014.01.13-1, automatic), libiso9660-8:amd64 (0.83-4.2, automatic), libfreerdp-gdi1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libwinpr-heap0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libwinpr-rpc0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), vlc-data:amd64 (2.2.4-1~deb8u1, automatic), libwinpr-library0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libknewstuff3-4:amd64 (4.14.2-5+deb8u1, automatic), libnepomukutils4:amd64 (4.14.2-5+deb8u1, automatic), libfreerdp-locale1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libfreerdp-primitives1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), kdoctools:amd64 (4.14.2-5+deb8u1, automatic), libgles2-mesa:amd64 (10.3.2-1+deb8u1, automatic), libkxmlrpcclient4:amd64 (4.14.2-2+b1, automatic), libkpty4:amd64 (4.14.2-5+deb8u1, automatic), libkjsembed4:amd64 (4.14.2-5+deb8u1, automatic), libwinpr-registry0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libqt4-designer:amd64 (4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1, automatic), libsolid4:amd64 (4.14.2-5+deb8u1, automatic), libkhtml5:amd64 (4.14.2-5+deb8u1, automatic), libssh-gcrypt-4:amd64 (0.6.3-4+deb8u2, automatic), libntrack-qt4-1:amd64 (016-1.3, automatic), libtwolame0:amd64 (0.3.13-1.1, automatic), libkfile4:amd64 (4.14.2-5+deb8u1, automatic), libwinpr-sspi0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), phonon-backend-vlc:amd64 (0.8.0-2, automatic), libzvbi0:amd64 (0.2.35-3, automatic), mysql-common:amd64 (5.5.52-0+deb8u1, automatic), libgles1-mesa:amd64 (10.3.2-1+deb8u1, automatic), libattica0.4:amd64 (0.4.2-1, automatic), libkdesu5:amd64 (4.14.2-5+deb8u1, automatic), libmysqlclient18:amd64 (5.5.52-0+deb8u1, automatic), libdlrestrictions1:amd64 (0.15.15, automatic), libstreams0:amd64 (0.7.8-1.2+b2, automatic), libknotifyconfig4:amd64 (4.14.2-5+deb8u1, automatic), libfreerdp-rail1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libxcb-composite0:amd64 (1.10-3+b1, automatic), libfreerdp-common1.1.0:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libkdecore5:amd64 (4.14.2-5+deb8u1, automatic), kdelibs-bin:amd64 (4.14.2-5+deb8u1, automatic), libfreerdp-crypto1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libkactivities-bin:amd64 (4.13.3-1, automatic), libva-x11-1:amd64 (1.4.1-1, automatic), plasma-scriptengine-javascript:amd64 (4.14.2-2, automatic), libnepomukcore4:amd64 (4.14.0-1+b2, automatic), libshine3:amd64 (3.1.0-2.1, automatic), libnepomuk4:amd64 (4.14.2-5+deb8u1, automatic), libwinpr-path0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libzvbi-common:amd64 (0.2.35-3, automatic), libwinpr-dsparse0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), vlc:amd64 (2.2.4-1~deb8u1, automatic), libstreamanalyzer0:amd64 (0.7.8-1.2+b2, automatic), libvlc5:amd64 (2.2.4-1~deb8u1, automatic), libmodplug1:amd64 (0.8.8.4-4.1+b1, automatic), docbook-xsl:amd64 (1.78.1+dfsg-1, automatic), libmatroska6:amd64 (1.4.1-2+deb8u1, automatic), libkntlm4:amd64 (4.14.2-5+deb8u1, automatic), libkdewebkit5:amd64 (4.14.2-5+deb8u1, automatic), liblivemedia23:amd64 (2014.01.13-1, automatic), libvcdinfo0:amd64 (0.7.24+dfsg-0.2, automatic), libiodbc2:amd64 (3.52.9-2, automatic), libwinpr-sysinfo0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libkcmutils4:amd64 (4.14.2-5+deb8u1, automatic), libpolkit-qt-1-1:amd64 (0.103.0-1, automatic), libsidplay2:amd64 (2.1.1-14, automatic), libwinpr-environment0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libva-drm1:amd64 (1.4.1-1, automatic), libkactivities-models1:amd64 (4.13.3-1, automatic), libnl-route-3-200:amd64 (3.2.24-2, automatic), libkate1:amd64 (0.4.1-4, automatic), libkio5:amd64 (4.14.2-5+deb8u1, automatic), libxml2-utils:amd64 (2.9.1+dfsg1-5+deb8u3, automatic), kate-data:amd64 (4.14.2-2, automatic), libfreerdp-utils1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libvncclient0:amd64 (0.9.9+dfsg2-6.1+deb8u1, automatic), vlc-plugin-pulse:amd64 (2.2.4-1~deb8u1, automatic), libplasma3:amd64 (4.14.2-5+deb8u1, automatic), libupower-glib3:amd64 (0.99.1-3.2, automatic), libwinpr-file0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libqt4-declarative:amd64 (4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1, automatic), libwinpr-crypto0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-4, automatic), libmpcdec6:amd64 (0.1~r459-4.1, automatic)
End-Date: 2016-09-20  15:50:34

나열된 패키지는 많지만 패키지 이름 libkde3support4:amd64 (4.14.2-5+deb8u1, automatic)libkde3support4.

저는 lxde와 데비안을 사용하고 있습니다.

다음을 사용하여 두 패키지를 모두 제거 하십시오 apt-get remove kchmviewer && apt-get autoremove.

Start-Date: 2016-09-20  15:51:15
Commandline: apt-get remove kchmviewer
Remove: kchmviewer:amd64 (6.0-1)
End-Date: 2016-09-20  15:51:18

Start-Date: 2016-09-20  15:51:32
Commandline: apt-get autoremove
Remove: libchm1:amd64 (0.40a-3+b1)
End-Date: 2016-09-20  15:51:33

답변1

kchmviewer이론적으로는 자동으로 설치된 모든 패키지를 제거하여 이 설치를 "실행 취소" 할 수 있습니다 .

apt-get remove kchmviewer && apt-get autoremove

하지만 두 번째 명령으로 삭제된 패키지에 주의하세요. 그러나 자동 제거로는 원하는 결과가 나오지 않을 수 있습니다. 기본적으로 이 명령은 설치된 다른 패키지에서 권장하는 경우 자동으로 설치된 패키지를 제거하지 않습니다. (바라보다"apt-get autoremove"가 작동하지 않는 이유는 무엇입니까?더 알아보기. )

로그를 처리하려면 이 sed명령을 사용하여 "Install:" 줄을 사용할 수 있는 패키지 목록으로 변환 할 수 있습니다 apt-get remove(`apt-get Remove kchmviewer와 함께 사용).

sed 's/([^)]*)//g;s/Install: //;s/ ,//g'

로그를 다음 파일에 기록하십시오 log(질문에 제공된 줄만 포함).

apt-get remove kchmviewer $(grep Install: log | sed 's/([^)]*)//g;s/Install: //;s/ ,//g')

관련 정보