如何删除 ubuntu-desktop 附带的软件包?(13.10)

如何删除 ubuntu-desktop 附带的软件包?(13.10)

我使用的是 Xubuntu 13.10,大约一小时前安装了 meta 包ubuntu-desktop来试用。不幸的是,它根本不起作用,所以我只能回到我的 Xfce 会话。

现在有些东西不同了,我想删除所述元包附带的包。有没有办法安装刚刚由 ubuntu-desktop 安装的那些包?也许可以通过一些apt-get魔法来实现?

答案1

你的情况并不罕见,并且已经得到解决回到纯净的 Xubuntu 这些说明适用于旧版本,不适用于 13.10即便如此,它们仍然有有用的指示,值得一看。

您可以自己做类似的事情,因为无论您使用apt-get软件中心或 Synaptic 安装或从存储库中删除软件,都会记录在 中/var/log/apt/history.log(以及较旧的存档文件中)/var/log/apt。您所做的操作应该在最新的文件中,即中history.log。查看那里并记下在相关日期安装的软件。

然后,为了简单起见,便于监控您正在做的事情,请从您已识别的列表中一次清除几个程序。每次首先使用标志-s

sudo apt-get purge -s package_name

来模拟没有开关时会执行的操作-s

另外,查看/usr/share/xsessions(使用终端以便查看真实文件名)并删除(备份后)您不想在登录时看到的会话的 .desktop 文件。


专家可能有更优雅的方式来从相关行中获取包名称,history.log但这里有一种使用 pastebinit 内容的方法:

  • 将第 3 行(以“Install:”开头的行)复制到文本编辑器,然后删除第一个包名称。将文件另存为unity
  • 打开终端并运行sed -i 's/), /)\n/g' unity。这会在每个包后引入换行符。
  • 运行awk -F: '{ print $1 }' unity > unity1。这将返回一个仅包含 可用的包名称的文件apt-get。但每个包都在单独的行上。
  • 通过运行修复该问题awk 1 ORS=', ' unity1 > unity2
  • 手动删除文件末尾的“,” **

完成这些步骤后,你就得到一些可以使用的东西了apt-get purge

python3-pyatspi, syslinux-legacy, telepathy-haze, libqt5v8-5, telepathy-idle, libsgutils2-2, rhythmbox-plugins, empathy-common, libcrypt-passwdmd5-perl, empathy, gir1.2-dbusmenu-glib-0.4, account-plugin-salut, libgdata13, libsignon-glib1, libsignon-qt5-1, xul-ext-webaccounts, libgdata-common, signon-plugin-oauth2, apturl, libxcb-render-util0, libsignon-extension1, gnome-orca, libqt5sql5-sqlite, libsbc1, account-plugin-aim, ubuntu-docs, python-pyinotify, telepathy-salut, libdmapsharing-3.0-2, python-qt4-dbus, bluez-gstreamer, telepathy-gabble, gir1.2-totem-1.0, gnome-terminal, overlay-scrollbar, evolution-data-server-goa, gir1.2-gst-plugins-base-1.0, libqt5opengl5, libgexiv2-2, libfreerdp1, ubuntu-desktop, account-plugin-facebook, python3-chardet, deja-dup-backend-gvfs, python3-debian, deja-dup-backend-ubuntuone, gnome-disk-utility, libqt4-sql-sqlite, whoopsie-preferences, libgc1c2, telepathy-mission-control-5, python-configglue, libdbusmenu-qt2, libgee-0.8-2, remmina-plugin-rdp, libprotoc7, gstreamer1.0-nice, libfolks25, libxcb-image0, python3-brlapi, mtools, gstreamer1.0-clutter, libproxy1-plugin-networkmanager, libaccount-plugin-google, libqt5sql5, libxcb-icccm4, libaccount-plugin-generic-oauth, telepathy-logger, gnome-terminal-data, libqt5qml5, libsignon-plugins-common1, nautilus-sendto-empathy, account-plugin-windows-live, duplicity, libwmf0.2-7-gtk, landscape-client-ui-install, liblouis-data, libufe-xidgetter0, rhythmbox-plugin-magnatune, libwhoopsie-preferences0, totem-plugins, libmission-control-plugins0, python-ubuntuone-client, gnome-control-center-unity, rhythmbox-mozilla, python-ubuntuone-control-panel, libaccounts-glib0, libaccounts-qt5-1, libgweather-3-3, libfarstream-0.2-2, gnome-screensaver, libqt5core5, rhythmbox-data, libssh-4, libreoffice-presentation-minimizer, shotwell-common, libfolks-eds25, liboauth0, libtelepathy-logger3, shotwell, indicator-sync, rhythmbox-plugin-cdrecorder, libgpod4, remmina-common, protobuf-compiler, apturl-common, deja-dup, gnome-contacts, liblouis2, branding-ubuntu, libaccount-plugin-1.0-0, python-twisted-names, libfreerdp-plugins-standard, vino, libtotem0, totem, libqt5xml5, guile-2.0-libs, signon-plugin-password, libqt5quick5, libsync-menu1, usb-creator-common, libqt5test5, mcp-account-manager-uoa, remmina, libqt5printsupport5, libreoffice-ogltrans, python3-dirspec, sni-qt, libvncserver0, syslinux, python-protobuf, rhythmbox, libxcb-sync0, python-ubuntuone-storageprotocol, python3-speechd, totem-common, account-plugin-jabber, overlay-scrollbar-gtk2, overlay-scrollbar-gtk3, thunderbird-gnome-support, remmina-plugin-vnc, libfolks-telepathy25, libgweather-common, libproxy1-plugin-gsettings, activity-log-manager, syslinux-common, example-content, libqt5webkit5, notify-osd-icons, libtelepathy-farstream3, libqt5widgets5, xul-ext-websites-integration, gir1.2-gnomekeyring-1.0, totem-mozilla, udisks, rhythmbox-plugin-zeitgeist, libecal-1.2-15, rhythmbox-ubuntuone, gir1.2-dee-1.0, account-plugin-yahoo, gir1.2-syncmenu-0.1, signon-ui, libgpod-common, unity-webapps-common, evolution-data-server, webaccounts-extension-common, ubuntuone-control-panel, python-markupsafe, ubuntuone-client-data, pulseaudio-module-bluetooth, gnome-control-center-signon, gnome-mahjongg, libqt53d5, python3-louis, libqt5dbus5, librsync1, ubuntuone-client, ubuntu-sso-client-qt, qt-at-spi, gir1.2-unity-5.0, usb-creator-gtk, libraw9, gir1.2-totem-plparser-1.0, libqt5gui5, account-plugin-google, signon-keyring-extension, liblvm2app2.2, libqt5network5, media-player-info, gir1.2-rb-3.0, python3-six, activity-log-manager-control-center, librhythmbox-core7, folks-common, plymouth-theme-ubuntu-logo, libqt5location5, libedata-cal-1.2-20, notify-osd, ubuntuone-control-panel-qt, libavahi-gobject0, libqt5sensors5, aisleriot, python-mako, nautilus-share, xul-ext-unity, libgail-common, signond

**https://stackoverflow.com/a/4611116/1771119用于删除终端“,”的代码。

相关内容