如何恢复`dnf install`?

chr*_*ner 10 fedora live-usb package-management dnf

我已经liveusb-creator在 Fedora 24 上使用 DNF 进行了安装。这些是与它一起安装的依赖项:

liveusb-creator.noarch 3.95.2-1.fc24
python-cssselect.noarch 0.9.1-9.fc24
python-lxml.x86_64 3.4.4-4.fc24
python-pyquery.noarch 1.2.8-7.fc24
python-qt5.x86_64 5.6-4.fc24
python-qt5-rpm-macros.noarch 5.6-4.fc24
qt5-qtconnectivity.x86_64 5.6.1-2.fc24
qt5-qtenginio.x86_64 1:1.6.1-2.fc24
qt5-qtlocation.x86_64 5.6.1-2.fc24
qt5-qtmultimedia.x86_64 5.6.1-3.fc24
qt5-qtquickcontrols.x86_64 5.6.1-1.fc24
qt5-qtsensors.x86_64 5.6.1-2.fc24
qt5-qtserialport.x86_64 5.6.1-1.fc24
qt5-qttools-common.noarch 5.6.1-2.fc24
qt5-qttools-libs-clucene.x86_64 5.6.1-2.fc24
qt5-qttools-libs-designer.x86_64 5.6.1-2.fc24
qt5-qttools-libs-help.x86_64 5.6.1-2.fc24
qt5-qtwebchannel.x86_64 5.6.1-2.fc24
qt5-qtwebsockets.x86_64 5.6.1-2.fc24
sip.x86_64 4.18-2.fc24
Run Code Online (Sandbox Code Playgroud)

现在我想liveusb-creator再次卸载,但dnf remove liveusb-createor试图删除比安装更多的包(包括 Java,我不想删除):

java-1.8.0-openjdk          x86_64   1:1.8.0.101-1.b14.fc24   @updates   496 k
java-1.8.0-openjdk-devel    x86_64   1:1.8.0.101-1.b14.fc24   @updates    40 M
liveusb-creator             noarch   3.95.2-1.fc24            @updates   2.1 M
python-cssselect            noarch   0.9.1-9.fc24             @fedora    301 k
python-lxml                 x86_64   3.4.4-4.fc24             @fedora    3.0 M
python-pyquery              noarch   1.2.8-7.fc24             @fedora    171 k
python-qt5                  x86_64   5.6-4.fc24               @updates    20 M
python-qt5-rpm-macros       noarch   5.6-4.fc24               @updates   137  
qt5-qtconnectivity          x86_64   5.6.1-2.fc24             @updates   1.3 M
qt5-qtdeclarative           x86_64   5.6.1-5.fc24             @updates    14 M
qt5-qtenginio               x86_64   1:1.6.1-2.fc24           @updates   589 k
qt5-qtlocation              x86_64   5.6.1-2.fc24             @updates   2.7 M
qt5-qtmultimedia            x86_64   5.6.1-3.fc24             @updates   3.1 M
qt5-qtquickcontrols         x86_64   5.6.1-1.fc24             @updates   3.7 M
qt5-qtsensors               x86_64   5.6.1-2.fc24             @updates   801 k
qt5-qtserialport            x86_64   5.6.1-1.fc24             @updates   190 k
qt5-qttools-common          noarch   5.6.1-2.fc24             @updates    34 k
qt5-qttools-libs-clucene    x86_64   5.6.1-2.fc24             @updates   132 k
qt5-qttools-libs-designer   x86_64   5.6.1-2.fc24             @updates   5.2 M
qt5-qttools-libs-help       x86_64   5.6.1-2.fc24             @updates   647 k
qt5-qtwebchannel            x86_64   5.6.1-2.fc24             @updates   227 k
qt5-qtwebsockets            x86_64   5.6.1-2.fc24             @updates   230 k
qt5-qtxmlpatterns           x86_64   5.6.1-1.fc24             @updates   4.1 M
sip                         x86_64   4.18-2.fc24              @updates   396 k
ttmkfdir                    x86_64   3.0.9-48.fc24            @fedora    107 k
xorg-x11-fonts-Type1        noarch   7.5-16.fc24              @fedora    863 k
Run Code Online (Sandbox Code Playgroud)

为什么列表中有更多的软件包,如何只删除以前安装的软件包?

Ste*_*itt 13

我不知道你问题第一部分的答案。如果您已dnf激活历史记录(我认为默认情况下已启用),您可以使用它来撤消安装:

sudo dnf history | head
Run Code Online (Sandbox Code Playgroud)

将显示最后几笔交易,左侧有一个标识符;找到你的安装,然后

sudo dnf history info ${transaction}
Run Code Online (Sandbox Code Playgroud)

${transaction}适当替换)将显示安装的详细信息,以及

sudo dnf history undo ${transaction}
Run Code Online (Sandbox Code Playgroud)

将撤消它(如果可能)。