这实际上是我第二次写这篇文章,不过我必须重新输入所有内容。第一次我使用终端上的 lynx,但系统出于某种原因认为我的帖子是垃圾邮件,我输入的所有内容都丢失了(从未想过 Stack Exchange 对 lynx 如此不友好,我的帖子中没有一个链接)。
无论如何,问题就在这里。我安装了kubuntu-desktop
,玩了一下,不喜欢它,然后决定删除它。问题就出在这里。我卸载了该软件包及其依赖项(通过apt autoremove
),重新启动了系统,但它没有正确加载。我收到的唯一消息是“正在扫描 btrfs 文件系统...”我觉得这很奇怪,因为我的 btrfs 分区从来没有出现过问题。
不过,控制台可以工作,所以我尝试在线寻求建议(在确保其他一切都正常之后;甚至 VLC 也可以工作,尽管我只能听到声音)。这没有用,所以我开始反复试验。
在我再次安装后,问题似乎已经解决。但问题并没有真正解决,因为如果不关闭 Xfce,kubuntu-desktop
我仍然无法摆脱它及其依赖项。以下是我所做的:kubuntu-desktop
sudo apt install kubuntu-desktop
sudo apt install phonon-backend-gstreamer
sudo apt remove --purge kubuntu-desktop
sudo apt autoremove
sudo apt autoclean
sudo apt clean
reboot
sudo apt purge
cat ~/.bash_history | grep -P "remove|install"
sudo apt remove phonon-backend-gstreamer
reboot
sudo apt search xfce
sudo apt install --reinstall xfce4
sudo apt install --reinstall xubuntu-desktop
reboot
cat dpkg.log
cat dpkg.log | grep "2017-02-18 16:"
sudo apt remove xubuntu-desktop
sudo apt autoremove
sudo apt install xubuntu-desktop
sudo apt purge xfce4
sudo install xfce4
sudo apt -f install
dpkg --configure -a
sudo !!
sudo apt install kubuntu-desktop
reboot
这时系统几乎可以正常加载。我说“几乎”是因为 Xfce 中的 Greybird 主题完全无法使用,尽管我从未编辑过 Xfce 主题;这也是我决定在安装 KDE 几个小时后放弃它的原因之一,如果考虑到我在安装后已经离开了 4 个小时,那么放弃的时间就更短了。
我已经将不相关的软件包以某种方式标记为自动删除。例如,我重新安装了,mysql-server
几天前,当我发现软件包丢失时,想象一下我的惊讶。我检查了一下,它确实在那儿,在我清除 MySQL 软件包的同时,它确实被删除了。mysql-common
mysql-client
motion
/var/log/dpkg.log
我已经运行了sudo apt purge --simulate kubuntu-desktop
。输出结果并不令人鼓舞:
The following packages were automatically installed and are no longer required:
accountwizard akonadi-backend-mysql akonadi-server akregator amarok amarok-common amarok-utils apturl-common apturl-kde baloo-kf5 baloo-utils bluedevil breeze breeze-cursor-theme cdparanoia cdrdao cracklib-runtime cryptsetup discover discover-data dolphin dragonplayer dvd+rw-tools fonts-lato fonts-noto fonts-noto-mono fonts-noto-unhinted fonts-oxygen growisofs gstreamer-qapt gtk2-engines-oxygen gtk2-engines-xfce gtk3-engines-breeze gwenview ibus-qt4 ieee-data k3b k3b-data kaccounts-integration kaccounts-providers kaddressbook kamera kate kate5-data kcalc kde-config-gtk-style kde-config-gtk-style-preview kde-config-mailtransport kde-config-sddm kde-config-telepathy-accounts kde-config-whoopsie kde-spectacle kde-style-oxygen-qt5 kde-style-qtcurve-qt4 kde-style-qtcurve-qt5 kde-telepathy kde-telepathy-approver kde-telepathy-auth-handler kde-telepathy-contact-list kde-telepathy-data kde-telepathy-desktop-applets kde-telepathy-filetransfer-handler kde-telepathy-integration-module kde-telepathy-kaccounts kde-telepathy-kpeople kde-telepathy-minimal kde-telepathy-send-file kde-telepathy-text-ui kdeconnect kdeconnect-plasma kdegraphics-strigi-analyzer kdemultimedia-kio-plugins kdenetwork-filesharing kdepim-doc kdepim-runtime kdepimlibs-data kdepimlibs-kio-plugins kdeplasma-addons-data kdesudo kdoctools5 kgamma5 khelpcenter khotkeys khotkeys-data kimageformat-plugins kinfocenter kio-audiocd kio-mtp kmail kmenuedit knotes kontact konversation konversation-data korganizer krdc kross kscreen ksysguard ksysguard-data ksysguardd ksystemlog ktnef ktorrent ktorrent-data kubuntu-settings-desktop kubuntu-web-shortcuts kwin kwin-addons kwin-common kwin-data kwin-style-breeze kwin-x11 kwrited libaccounts-glib0 libaccounts-qt5-1 libakonadi-kde4 libakonadi-kmime4 libakonadiprotocolinternals1 libappstreamqt1 libavahi-gobject0 libbaloocore4 libbaloofiles4 libbalooxapian4 libc-ares2 libcdr-0.1-1 libcrack2 libdiscover2 libdolphinvcs5 libfakekey0 libflac++6v5 libfreehand-0.1-1 libgit2-24 libgpod-common libgpod4 libgrantlee-templates5 libgrantlee-textdocument5 libhttp-parser2.1 libibus-1.0-5 libibus-qt1 libk3b6 libk3b6-extracodecs libkabc4 libkaccounts1 libkcalcore4 libkcddb4 libkcompactdisc4 libkdecorations2-5v5 libkdecorations2private5v5 libkeybinder-3.0-0 libkf5activitiesexperimentalstats1 libkf5akonadiagentbase5 libkf5akonadicalendar5 libkf5akonadicontact5 libkf5akonadicore-bin libkf5akonadicore5 libkf5akonadimime5 libkf5akonadinotes5 libkf5akonadiprivate5 libkf5akonadisearchdebug5 libkf5akonadisearchpim5 libkf5akonadiwidgets5 libkf5alarmcalendar5 libkf5baloowidgets-bin libkf5baloowidgets5 libkf5bluezqt-data libkf5bluezqt6 libkf5calendarcore5 libkf5calendarsupport5 libkf5calendarutils5 libkf5contacts-data libkf5contacts5 libkf5emoticons-bin libkf5emoticons-data libkf5emoticons5 libkf5eventviews5 libkf5followupreminder5 libkf5gapi-data libkf5gapicalendar5 libkf5gapicontacts5 libkf5gapicore5 libkf5gapidrive5 libkf5gapitasks5 libkf5gpgmepp-pthread5 libkf5gravatar5 libkf5holidays-data libkf5holidays5 libkf5identitymanagement5 libkf5imap5 libkf5incidenceeditorsng5 libkf5itemmodels5 libkf5kdcraw5 libkf5kdepimdbusinterfaces5 libkf5kdgantt2-5 libkf5kipi-data libkf5kipi30.0.0 libkf5kmanagesieve5 libkf5kontactinterface-data libkf5kontactinterface5 libkf5krosscore5 libkf5krossui5 libkf5ksieve5 libkf5ksieveui5 libkf5ldap5 libkf5libkdepim5 libkf5libkleo5 libkf5mailcommon5 libkf5mailimporter5 libkf5mailtransport-data libkf5mailtransport5 libkf5mbox5 libkf5messagecomposer5 libkf5messagecore5 libkf5messagelist5 libkf5messageviewer5 libkf5mime5 libkf5noteshared5 libkf5people-data libkf5people5 libkf5peoplebackend5 libkf5peoplewidgets5 libkf5pimcommon5 libkf5pimtextedit5 libkf5qgpgme5 libkf5sendlater5 libkf5syndication5 libkf5sysguard-bin libkf5templateparser5 libkf5tnef5 libkf5unitconversion-data libkf5unitconversion5 libkf5webkit5 libkfilemetadata4 libkfontinst5 libkfontinstui5 libkidletime4 libkldap4 libkmime4 libknewstuff2-4 libkolab1 libkolabxml1v5 libkonq-common libkonq5-templates libkpimutils4 libkresources4 libksane-data libksane0 libksignalplotter7 libktorrent-l10n libktorrent5 libktpcommoninternals9 libktplogger9 libktpmodels9 libktpotr9 libktpwidgets9 libkwin4-effect-builtins1 libkwineffects7 libkwinglutils7 libkwinxrenderutils7 liblastfm1 libloudmouth1-0 libmission-control-plugins0 libmspub-0.1-1 libmusicbrainz5cc2v5 libmygpo-qt1 liboxygenstyle5-5 liboxygenstyleconfig5-5 libpackagekitqt5-0 libpagemaker-0.0-0 libpam-kwallet4 libparted-fs-resize0 libperl4-corelibs-perl libpowerdevilcore2 libpowerdevilui5 libpwquality-common libpwquality1 libqca2-plugin-ossl libqgsttools-p1 libqjson0 libqt5concurrent5 libqt5multimedia5 libqt5multimedia5-plugins libqt5multimediaquick-p5 libqt5multimediawidgets5 libqt5qml-graphicaleffects libqt5xmlpatterns5 libqtassistantclient4 libqtcurve-utils2 libqtscript4-core libqtscript4-gui libqtscript4-network libqtscript4-sql libqtscript4-uitools libqtscript4-xml libreoffice-avmedia-backend-gstreamer libreoffice-draw libreoffice-impress libreoffice-kde libreoffice-pdfimport libruby2.3 libscim8v5 libsgutils2-2 libsignon-extension1 libsignon-glib1 libsignon-plugins-common1 libsignon-qt5-1 libsyndication4 libtag-extras1 libtelepathy-glib0 libtelepathy-logger-qt5 libtelepathy-logger3 libtelepathy-qt4-2 libtelepathy-qt5-0 libvisio-0.1-1 libwhoopsie-preferences0 libxcb-cursor0 libxcb-dpms0 libxcb-record0 libxerces-c3.1 muon-notifier muon-updater ofono oxygen-sounds partitionmanager plasma-dataengines-addons plasma-desktop plasma-desktop-data plasma-discover plasma-discover-common plasma-discover-private plasma-discover-updater plasma-look-and-feel-org-kde-breezedark-desktop plasma-pa plasma-runners-addons plasma-wallpapers-addons plasma-widgets-addons powerdevil powerdevil-data print-manager pulseaudio-module-bluetooth python-dbus python-qt4-dbus python3-pykde4 python3-pyqt4 qapt-deb-installer qml-module-org-kde-bluezqt qml-module-org-kde-draganddrop qml-module-org-kde-kio qml-module-org-kde-telepathy qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings qml-module-qtmultimedia qml-module-qtquick-controls-styles-breeze qml-module-qtquick-xmllistmodel qml-module-qtwebkit qtdeclarative5-xmllistmodel-plugin rake ruby ruby-did-you-mean ruby-minitest ruby-net-telnet ruby-power-assert ruby-test-unit ruby2.3 rubygems-integration sddm sddm-theme-breeze session-migration signon-kwallet-extension signon-plugin-oauth2 signon-plugin-password signon-ui signon-ui-service signon-ui-x11 signond skanlite sni-qt software-properties-kde sshfs systemsettings telepathy-accounts-signon telepathy-gabble telepathy-haze telepathy-logger telepathy-mission-control-5 telepathy-ring telepathy-salut ubuntu-release-upgrader-qt user-manager vcdimager whoopsie-preferences xfce4-pulseaudio-plugin
如您所见,xfce4-pulseaudio-plugin
被标记为自动删除。而且我毫不怀疑一些必需的软件包可能被标记为自动删除。要是我知道是哪些就好了……
我该如何修复它?
更新
我很庆幸我没有在被建议尝试这些命令时立即运行它们:
aptitude remove '?and(?reverse-depends(gnome),?not(?reverse-depends(?exact-name(xubuntu-desktop))))'
aptitude remove '?and(?reverse-depends(unity),?not(?reverse-depends(?exact-name(xubuntu-desktop))))'
aptitude remove '?and(?reverse-depends(kubuntu),?not(?reverse-depends(?exact-name(xubuntu-desktop))))'
aptitude remove '?and(?reverse-depends(kde),?not(?reverse-depends(?exact-name(xubuntu-desktop))))'
但我确实运行了这个,看看如果我这样做会删除什么:
aptitude search '?and(?reverse-depends(kubuntu),?not(?reverse-depends(?exact-name(xubuntu-desktop))))' | grep -vP "^p\s+[^\s]{2,}"
输出如下:
i A ark - archive utility
idA baloo-kf5 - framework for searching and managing metad
...
idA plasma-desktop - Tools and widgets for the desktop
i plymouth - boot animation, logger and I/O multiplexer
i plymouth-label - boot animation, logger and I/O multiplexer
i plymouth-theme-ubuntu-text - boot animation, logger and I/O multiplexer
idA powerdevil - Global power saver settings.
i python - interactive high-level object-oriented lan
i python3 - interactive high-level object-oriented lan
i python3-dbus - simple interprocess messaging system (Pyth
i A python3-dbus.mainloop.pyqt5 - D-Bus Qt main loop support for Python 3
i A python3-pyqt5 - Python 3 bindings for Qt5
i A qapt-batch - Batch package manager for KDE
idA sddm-theme-breeze - Breeze SDDM theme
idA software-properties-kde - manage the repositories that you install s
idA systemsettings - System Settings interface
i ttf-ubuntu-font-family - Ubuntu Font Family, sans-serif typeface hi
v x-terminal-emulator -
v x-terminal-emulator:i386 -
i xfce4-terminal - Xfce terminal emulator
对于 来说 就更是如此了kde
。
aptitude search '?and(?reverse-depends(kde),?not(?reverse-depends(?exact-name(xubuntu-desktop))))' | grep -vP "^p\s+[^\s]{2,}"
输出:
idA accountwizard - wizard for KDE PIM applications account se
idA akonadi-server - Akonadi PIM storage service
idA akregator - RSS/Atom feed aggregator
i apport - automatically generate crash reports for d
idA apturl-common - install packages using the apt protocol -
i A breeze-icon-theme - Default Plasma icon theme.
i cron - process scheduling daemon
i dbus-x11 - simple interprocess messaging system (X11
i debconf - Debian configuration management system
v debconf-2.0 -
v debconf-2.0:i386 -
...
i perl-base - minimal Perl system
v perlapi-5.22.1 -
v perlapi-5.22.1:i386 -
i A phonon - multimedia framework from KDE using Qt 4 -
idA plasma-dataengines-addons - additional data engines for Plasma
idA plasma-desktop - Tools and widgets for the desktop
idA plasma-runners-addons - additional runners for Plasma 5 and Krunne
i A plasma-scriptengine-javascript - JavaScript script engine for Plasma
idA plasma-wallpapers-addons - additional wallpaper plugins for Plasma 5
idA plasma-widgets-addons - additional widgets for Plasma 5
i A plasma-workspace - Plasma Workspace for KF5
i policykit-1 - framework for managing administrative poli
i A polkit-kde-agent-1 - KDE dialogs for PolicyKit
i procps - /proc file system utilities
i psmisc - utilities that use the proc file system
i python - interactive high-level object-oriented lan
i python3 - interactive high-level object-oriented lan
i python3-apport - Python 3 library for Apport crash report h
i python3-dbus - simple interprocess messaging system (Pyth
i A python3-dbus.mainloop.pyqt5 - D-Bus Qt main loop support for Python 3
idA python3-pykde4 - Python 3 bindings for the KDE Development
idA python3-pyqt4 - Python3 bindings for Qt4
i A python3-pyqt5 - Python 3 bindings for Qt5
i A python3-sip - Python 3/C++ bindings generator runtime li
i python3-software-properties - manage the repositories that you install s
i A qapt-batch - Batch package manager for KDE
i A qml-module-org-kde-activities - provides integration of QML and KDE Framew
idA qml-module-org-kde-telepathy - kde-telepathy QtDeclarative QML support
i A qml-module-qtquick-controls - Qt 5 Quick Controls QML module
i A qml-module-qtquick-dialogs - Qt 5 Dialogs QML module
i A qml-module-qtquick-layouts - Qt 5 Quick Layouts QML module
i A qml-module-qtquick2 - Qt 5 Qt Quick 2 QML module
v qtbase-abi-5-5-1 -
v qtbase-abi-5-5-1:i386 -
v qtdeclarative-abi-5-5-0 -
v qtdeclarative-abi-5-5-0:i386 -
i shared-mime-info - FreeDesktop.org shared MIME database and s
v sip-api-11.2 -
v sip-api-11.2:i386 -
v sip-py3api-11.2 -
v sip-py3api-11.2:i386 -
i software-properties-common - manage the repositories that you install s
idA software-properties-kde - manage the repositories that you install s
idA sshfs - filesystem client based on SSH File Transf
i sudo - Provide limited super user privileges to s
i systemd - system and service manager
v telepathy-connection-manager -
idA telepathy-gabble - Jabber/XMPP connection manager
idA telepathy-haze - Telepathy connection manager that uses lib
idA telepathy-mission-control-5 - management daemon for Telepathy real-time
idA telepathy-ring - GSM and 3G UMTS Telepathy connection manag
idA telepathy-salut - Link-local XMPP connection manager for the
idA ubuntu-release-upgrader-qt - manage release upgrades
i ufw - program for managing a Netfilter firewall
i uno-libs3 - LibreOffice UNO runtime environment -- pub
i update-manager-core - manage release upgrades
i update-notifier-common - Files shared between update-notifier and o
i ure - LibreOffice UNO runtime environment
i whoopsie - Ubuntu error tracker submission
idA whoopsie-preferences - System preferences for error reporting
v x-terminal-emulator -
v x-terminal-emulator:i386 -
i x11-utils - X11 utilities
i xauth - X authentication utility
i xfce4-terminal - Xfce terminal emulator
i xneur - in-place conversion of text typed in with
i zlib1g - compression library - runtime
i A zlib1g:i386 - compression library - runtime
我不得不删去一些行,因为这里有 30,000 个字符的限制,输出是巨大的。无论如何,我无法想象删除sudo
会顺利进行。
看起来我越来越需要手动删除不需要的软件包,然后apt-mark
手动安装我不确定的软件包,因为 KDE 可能破坏了除 Xfce 之外的其他依赖项(xubuntu-desktop
仍然直接依赖于上面列出的一些软件包)。我真的不想这样做,但最好还是在尝试使用自动工具后丢失一些必要的软件包或执行全新安装。
检查软件包的最快方法是什么?比如,构建其依赖树或类似的东西?我想我可以先用 识别它们deborphan
,然后先删除没有其他依赖的软件包,然后逐渐向上清除它们的依赖关系,但这会花费很多时间。
更新 #2
我认为我已经解决了这个问题,但我真不知道我是怎么做到的。不过我可以说说我做了什么。我已从中删除了kubuntu-desktop
和并自动删除了它们的依赖项,然后重新启动了计算机。系统启动了,我的 Xfce 没问题了。现在,我不知道是否缺少了一些至关重要的软件包,但我已经利用了这段时间,所以我总是可以查找到底自动删除了什么。无论如何,从现在开始我将在每次安装和删除时使用它。我真的建议任何人都做同样的事情,因为虽然可能可靠,但那里的信息太多了。xubuntu-desktop
Ctrl+Alt+F1
tee
| tee -a <log file name>
/var/log/dpkg.log
答案1
尝试这个:
以纯文本模式启动
Switch on
你的电脑。Press
以及,hold
这Shift key
将调出 Grub 菜单。Select
以 开头的行Advanced options
。Select
以以下行结尾(recovery mode)
您的电脑应该会显示一个带有多个选项的菜单。
首先
select
选择Enable networking
然后
select
选项将是Drop to root shell prompt
电脑将在终端中启动。
运行以下命令:
以读写模式挂载分区
mount -o remount,rw /
mount --all
更新存储库
apt-get update
安装 aptitude 和 deborphan
apt-get install --reinstall aptitude deborphan
删除 Xubuntu 中不需要的所有组件
aptitude remove '?and(?reverse-depends(gnome),?not(?reverse-depends(?exact-name(xubuntu-desktop))))'
aptitude remove '?and(?reverse-depends(unity),?not(?reverse-depends(?exact-name(xubuntu-desktop))))'
aptitude remove '?and(?reverse-depends(kubuntu),?not(?reverse-depends(?exact-name(xubuntu-desktop))))'
aptitude remove '?and(?reverse-depends(kde),?not(?reverse-depends(?exact-name(xubuntu-desktop))))'
重新安装 xubuntu-desktop
apt-get install --reinstall xubuntu-desktop
消除孤立包
deborphan
apt-get --purge remove $(deborphan)
deborphan --libdevel
apt-get --purge remove $(deborphan --libdevel)
deborphan --find-config
dpkg --purge $(deborphan --find-config)
删除不必要的包
apt-get autoremove
删除下载的软件包
apt-get clean
重启系统
reboot