使用 apt-get purge package\* 删除了大多数软件包;我该如何恢复它们?

使用 apt-get purge package\* 删除了大多数软件包;我该如何恢复它们?

我在终端中执行以下命令时意外丢失了一些系统文件:

sudo apt-get purge wine\*

大多数已安装的软件(终端、软件中心、libreoffice 等)现在都丢失了。

有人能解决这个问题吗?

答案1

以下是已删除软件包的列表(至少在 Debian 上):

➜  ~  apt-get -s purge wine\*
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'kmfl-keyboards-mywin' for regex 'wine*'
Note, selecting 'kwin-style-qtcurve' for regex 'wine*'
Note, selecting 'windows-el' for regex 'wine*'
Note, selecting 'avifile-win32-plugin' for regex 'wine*'
Note, selecting 'libunwind8' for regex 'wine*'
Note, selecting 'navit-graphics-gtk-drawing-area' for regex 'wine*'
Note, selecting 'golang-go-darwin-amd64' for regex 'wine*'
Note, selecting 'hwinfo' for regex 'wine*'
Note, selecting 'libchewing2-dev' for regex 'wine*'
Note, selecting 'winff-gtk2' for regex 'wine*'
Note, selecting 'wine64-unstable' for regex 'wine*'
Note, selecting 'wine64-bin' for regex 'wine*'
Note, selecting 'winff-qt' for regex 'wine*'
Note, selecting 'scim-chewing' for regex 'wine*'
Note, selecting 'openwince-jtag' for regex 'wine*'
Note, selecting 'gpgv-win32' for regex 'wine*'
Note, selecting 'libwine-openal' for regex 'wine*'
Note, selecting 'gemrb-icewind-dale-data' for regex 'wine*'
Note, selecting 'wine32-dev-tools' for regex 'wine*'
Note, selecting 'petitboot-twin' for regex 'wine*'
Note, selecting 'libswing-layout-java' for regex 'wine*'
Note, selecting 'libswing-layout-java-doc' for regex 'wine*'
Note, selecting 'gemrb-icewind-dale-2' for regex 'wine*'
Note, selecting 'libwine-dev' for regex 'wine*'
Note, selecting 'plplot12-driver-xwin' for regex 'wine*'
Note, selecting 'libswingx-java' for regex 'wine*'
Note, selecting 'libfreehep-swing-java' for regex 'wine*'
Note, selecting 'libchewing3-dbg' for regex 'wine*'
Note, selecting 'kdeartwork-theme-window' for regex 'wine*'
Note, selecting 'libx11-windowhierarchy-perl' for regex 'wine*'
Note, selecting 'libwine-gecko-dbg-2.21' for regex 'wine*'
Note, selecting 'golang-go-windows-amd64' for regex 'wine*'
Note, selecting 'libwine-capi' for regex 'wine*'
Note, selecting 'winbind' for regex 'wine*'
Note, selecting 'libtwin0' for regex 'wine*'
Note, selecting 'wine-utils' for regex 'wine*'
Note, selecting 'winff-doc' for regex 'wine*'
Note, selecting 'q4wine-unstable' for regex 'wine*'
Note, selecting 'win32-loader' for regex 'wine*'
Note, selecting 'wine64-development-preloader' for regex 'wine*'
Note, selecting 'cpio-win32' for regex 'wine*'
Note, selecting 'libchewing' for regex 'wine*'
Note, selecting 'wine64-development' for regex 'wine*'
Note, selecting 'wininfo' for regex 'wine*'
Note, selecting 'libkwineffects1abi5' for regex 'wine*'
Note, selecting 'freepwing' for regex 'wine*'
Note, selecting 'libchewing3-dev' for regex 'wine*'
Note, selecting 'libwine-ldap' for regex 'wine*'
Note, selecting 'libwine-oss' for regex 'wine*'
Note, selecting 'winpdb' for regex 'wine*'
Note, selecting 'libkwinglesutils1' for regex 'wine*'
Note, selecting 'libwind0-heimdal' for regex 'wine*'
Note, selecting 'libwine-gphoto2' for regex 'wine*'
Note, selecting 'libwine-sane' for regex 'wine*'
Note, selecting 'phylowin' for regex 'wine*'
Note, selecting 'qml-module-qtquick-window2' for regex 'wine*'
Note, selecting 'libwine-alsa' for regex 'wine*'
Note, selecting 'matchbox-window-manager' for regex 'wine*'
Note, selecting 'windowlab' for regex 'wine*'
Note, selecting 'wine64-bin-unstable' for regex 'wine*'
Note, selecting 'libworldwind-java' for regex 'wine*'
Note, selecting 'ibus-chewing' for regex 'wine*'
Note, selecting 'libwings-dev' for regex 'wine*'
Note, selecting 'winswitch' for regex 'wine*'
Note, selecting 'libwin-hivex-perl' for regex 'wine*'
Note, selecting 'wine' for regex 'wine*'
Note, selecting 'wing' for regex 'wine*'
Note, selecting 'wink' for regex 'wine*'
Note, selecting 'worldwind' for regex 'wine*'
Note, selecting 'libmono-system-windows-forms-datavisualization4.0a-cil' for regex 'wine*'
Note, selecting 'q4wine' for regex 'wine*'
Note, selecting 'winetricks' for regex 'wine*'
Note, selecting 'winkeydaemon' for regex 'wine*'
Note, selecting 'wine32-unstable' for regex 'wine*'
Note, selecting 'wine64-development-tools' for regex 'wine*'
Note, selecting 'libwine-development-dbg' for regex 'wine*'
Note, selecting 'mate-window-manager' for regex 'wine*'
Note, selecting 'libtwin-dev' for regex 'wine*'
Note, selecting 'shiki-wine-theme' for regex 'wine*'
Note, selecting 'wine32' for regex 'wine*'
Note, selecting 'libcsfml-window2' for regex 'wine*'
Note, selecting 'libkwinglutils1abi2' for regex 'wine*'
Note, selecting 'libmate-window-settings-dbg' for regex 'wine*'
Note, selecting 'libunwind-setjmp0-dbg' for regex 'wine*'
Note, selecting 'wings3d' for regex 'wine*'
Note, selecting 'libnss-winbind' for regex 'wine*'
Note, selecting 'libmate-window-settings1' for regex 'wine*'
Note, selecting 'kde-window-manager' for regex 'wine*'
Note, selecting 'libunwind1-dev' for regex 'wine*'
Note, selecting 'libmono-system-drawing4.0-cil' for regex 'wine*'
Note, selecting 'libswingx1-java-doc' for regex 'wine*'
Note, selecting 'libunwind7-dev' for regex 'wine*'
Note, selecting 'libwine-development-dev' for regex 'wine*'
Note, selecting 'wine-development' for regex 'wine*'
Note, selecting 'libparse-win32registry-perl' for regex 'wine*'
Note, selecting 'libswingx1-java' for regex 'wine*'
Note, selecting 'wine64' for regex 'wine*'
Note, selecting 'libwine-cms' for regex 'wine*'
Note, selecting 'libwine' for regex 'wine*'
Note, selecting 'science-viewing-dev' for regex 'wine*'
Note, selecting 'libmate-window-settings-dev' for regex 'wine*'
Note, selecting 'avant-window-navigator' for regex 'wine*'
Note, selecting 'libmono-system-reactive-windows-threading2.1-cil' for regex 'wine*'
Note, selecting 'libmono-system-drawing-design4.0-cil' for regex 'wine*'
Note, selecting 'libsfml-window2' for regex 'wine*'
Note, selecting 'libunwind-setjmp0-dev' for regex 'wine*'
Note, selecting 'ibus-chewing-dbg' for regex 'wine*'
Note, selecting 'openwince-include' for regex 'wine*'
Note, selecting 'qtdeclarative5-window-plugin' for regex 'wine*'
Note, selecting 'fcitx-chewing' for regex 'wine*'
Note, selecting 'gemrb-icewind-dale-2-data' for regex 'wine*'
Note, selecting 'libunwind8-dbg' for regex 'wine*'
Note, selecting 'libchewing-dev' for regex 'wine*'
Note, selecting 'kwin-style-dekorator' for regex 'wine*'
Note, selecting 'libchewing-data' for regex 'wine*'
Note, selecting 'libwine-bin' for regex 'wine*'
Note, selecting 'libwine-development' for regex 'wine*'
Note, selecting 'libapache2-mod-auth-ntlm-winbind' for regex 'wine*'
Note, selecting 'wine32-development' for regex 'wine*'
Note, selecting 'golang-go-windows-386' for regex 'wine*'
Note, selecting 'libmono-system-reactive-windows-forms2.1-cil' for regex 'wine*'
Note, selecting 'libwings2' for regex 'wine*'
Note, selecting 'libwine-gl' for regex 'wine*'
Note, selecting 'wine1.2' for regex 'wine*'
Note, selecting 'wine1.3' for regex 'wine*'
Note, selecting 'wine-unstable' for regex 'wine*'
Note, selecting 'wine1.4' for regex 'wine*'
Note, selecting 'wine1.5' for regex 'wine*'
Note, selecting 'x-window-system-core' for regex 'wine*'
Note, selecting 'libchewing3-data' for regex 'wine*'
Note, selecting 'libunwind8-dev' for regex 'wine*'
Note, selecting 'libmono-windowsbase3.0-cil' for regex 'wine*'
Note, selecting 'kwin-style-oxygen-transparent' for regex 'wine*'
Note, selecting 'winwrangler' for regex 'wine*'
Note, selecting 'plplot11-driver-xwin' for regex 'wine*'
Note, selecting 'libmono-system-windows-forms4.0-cil' for regex 'wine*'
Note, selecting 'libmono-system-reactive-windows-threading2.2-cil' for regex 'wine*'
Note, selecting 'wine-doc' for regex 'wine*'
Note, selecting 'golang-go-darwin-386' for regex 'wine*'
Note, selecting 'wing-data' for regex 'wine*'
Note, selecting 'libmono-winforms2.0-cil' for regex 'wine*'
Note, selecting 'arc-wine' for regex 'wine*'
Note, selecting 'x-window-manager' for regex 'wine*'
Note, selecting 'libjenkins-winstone-java-doc' for regex 'wine*'
Note, selecting 'fte-xwindow' for regex 'wine*'
Note, selecting 'libmono-system-windows-forms-datavisualization4.0-cil' for regex 'wine*'
Note, selecting 'wine32-development-tools' for regex 'wine*'
Note, selecting 'hime-chewing' for regex 'wine*'
Note, selecting 'gzip-win32' for regex 'wine*'
Note, selecting 'libjenkins-winstone-java' for regex 'wine*'
Note, selecting 'pd-windowing' for regex 'wine*'
Note, selecting 'libmono-windowsbase4.0-cil' for regex 'wine*'
Note, selecting 'libmate-window-settings1-dbg' for regex 'wine*'
Note, selecting 'libswingx-java-doc' for regex 'wine*'
Note, selecting 'libmono-system-reactive-windows-forms2.2-cil' for regex 'wine*'
Note, selecting 'wine64-dev-tools' for regex 'wine*'
Note, selecting 'libpam-winbind' for regex 'wine*'
Note, selecting 'kwin4-style-bespin' for regex 'wine*'
Note, selecting 'ucimf-chewing' for regex 'wine*'
Note, selecting 'kwin-style-crystal' for regex 'wine*'
Note, selecting 'gextractwinicons' for regex 'wine*'
Note, selecting 'uim-chewing' for regex 'wine*'
Note, selecting 'twinkle' for regex 'wine*'
Note, selecting 'emacs-window-layout' for regex 'wine*'
Note, selecting 'libchewing3' for regex 'wine*'
Note, selecting 'gemrb-icewind-dale' for regex 'wine*'
Note, selecting 'gnome-wine-icon-theme' for regex 'wine*'
Note, selecting 'x-window-system' for regex 'wine*'
Note, selecting 'libchewing1-dev' for regex 'wine*'
Note, selecting 'winbind4' for regex 'wine*'
Note, selecting 'science-viewing' for regex 'wine*'
Note, selecting 'libjswingreader-java' for regex 'wine*'
Note, selecting 'plplot9-driver-xwin' for regex 'wine*'
Note, selecting 'libmono-system-windows4.0-cil' for regex 'wine*'
Note, selecting 'twine' for regex 'wine*'
Note, selecting 'libunwind-setjmp0' for regex 'wine*'
Note, selecting 'winbindd' for regex 'wine*'
Note, selecting 'winff' for regex 'wine*'
Note, selecting 'python-strongwind' for regex 'wine*'
Note, selecting 'winff-dbg' for regex 'wine*'
Note, selecting 'libwine-gecko-2.21' for regex 'wine*'
Note, selecting 'all-knowing-dns' for regex 'wine*'
Note, selecting 'wine-bin' for regex 'wine*'

这些是实际删除的软件包:

The following packages will be REMOVED:
  gnome-control-center* gvfs-backends* keepass2* libglade2.0-cil*
  libgssapi3-heimdal* libgtk2.0-cil* libhdb9-heimdal* libheimntlm0-heimdal*
  libhx509-5-heimdal* libkdc2-heimdal* libkrb5-26-heimdal*
  libmate-window-settings1* libmono-cil-dev* libmono-http4.0-cil*
  libmono-microsoft-web-infrastructure1.0-cil*
  libmono-system-data-services2.0-cil* libmono-system-data-services4.0-cil*
  libmono-system-design4.0-cil* libmono-system-drawing-design4.0-cil*
  libmono-system-drawing4.0-cil* libmono-system-messaging4.0-cil*
  libmono-system-reactive-windows-forms2.2-cil*
  libmono-system-reactive-windows-threading2.2-cil*
  libmono-system-runtime4.0-cil*
  libmono-system-servicemodel-activation4.0-cil*
  libmono-system-servicemodel-discovery4.0-cil*
  libmono-system-servicemodel-routing4.0-cil*
  libmono-system-servicemodel-web4.0-cil* libmono-system-servicemodel4.0a-cil*
  libmono-system-serviceprocess4.0-cil*
  libmono-system-web-abstractions4.0-cil*
  libmono-system-web-dynamicdata4.0-cil*
  libmono-system-web-extensions-design4.0-cil*
  libmono-system-web-extensions4.0-cil*
  libmono-system-web-http-selfhost4.0-cil*
  libmono-system-web-http-webhost4.0-cil* libmono-system-web-mvc3.0-cil*
  libmono-system-web-routing4.0-cil* libmono-system-web-services4.0-cil*
  libmono-system-web-webpages-deployment2.0-cil*
  libmono-system-web-webpages-razor2.0-cil*
  libmono-system-web-webpages2.0-cil* libmono-system-web4.0-cil*
  libmono-system-windows-forms-datavisualization4.0a-cil*
  libmono-system-windows-forms4.0-cil* libmono-system-windows4.0-cil*
  libmono-system-xml-serialization4.0-cil* libmono-web4.0-cil*
  libmono-windowsbase3.0-cil* libmono-windowsbase4.0-cil*
  libmono-winforms2.0-cil* libnunit-cil-dev* libnunit2.6-cil* libsmbclient*
  libsmbclient-dev* libwebkit1.1-cil* libwind0-heimdal* libwine*
  libwine-gecko-2.21* mate-control-center* mate-desktop-environment-core*
  mono-4.0-service* mono-complete* mono-devel* monodoc-browser*
  monodoc-manual* mplayer* mpv* python-samba* samba* samba-common-bin*
  samba-dsdb-modules* samba-libs* samba-vfs-modules* wine* wine64*

被删除的最可怕的软件包是x-window-manager,但实际上并没有被删除。我可以说的是,除非您使用 KDE 或 MATE,否则没有任何软件包的删除会导致您的系统软件包被删除,或使您的系统瘫痪,事实上,如果有任何真正重要的软件包会导致您的系统处于无法启动的状态,您应该会看到类似这样的警告:

WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  apt

在这种情况下,它会要求您输入完整的短语“我知道我在做什么!”,字面意思。因此,由于我们知道哪些软件包被删除了,我们可以知道我们失去了哪些功能……事实上什么功能都没有!我们仍然有 network-manager 和 apt/dpkg,因此修复/恢复这个问题将轻而易举,只需移动到 TTY(++ Ctrl)并安装元软件包就足以让一切恢复正常。AltF1(k|l|x)ubuntu-desktop

sudo apt-get install ubuntu-desktop

从那时起,检查您安装的其他软件包是否不再安装。

啊,最后的忠告,除非你知道正则表达式会做什么,否则不要这么做。它匹配任何名称中包含win或的包wine。并且一如既往-s,/--simulate是你的朋友。

相关内容