It is actually the second time I'm writing this, I have to retype everything, though. The first time I was using lynx from the terminal, but the system considered my post spam for some reason and everything I'd typed was lost (never thought Stack Exchange was so lynx-hostile, there wasn't a single link in my post).

Anyways, here's the problem. I installed kubuntu-desktop, played with it, didn't like it and decided to remove it. And that's where the problem comes in. I uninstalled the package and its dependencies (via apt autoremove), rebooted the system, and it didn't load properly. The only message I got was "Scanning for btrfs file systems..." Which I found strange, because I never had problems with my btrfs partitions.

The console worked, though, so I tried do seek advice online (after making sure everything else worked; even VLC worked, although I could only hear the sound). That didn't work, so I turned to trial and error.

After I installed kubuntu-desktop again, the problem was seemingly fixed. But it's not really fixed, because I still can't get rid of kubuntu-desktop and its dependencies without bringing down Xfce. Here's what I did:

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
sudo apt purge
cat ~/.bash_history | grep -P "remove|install"
sudo apt remove phonon-backend-gstreamer
sudo apt search xfce
sudo apt install --reinstall xfce4
sudo apt install --reinstall xubuntu-desktop
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

Which is when the system loaded almost properly. I say "almost" because the Greybird theme in Xfce is all broken if functional, even though I never edited the Xfce themes; that was part of the reason I decided to get rid of KDE several hours after installing it, less, if you consider I had been away for 4 hours after the installation.

I already had unrelated packages somehow marked for autoremoval. For example, I reinstalled mysql-server, mysql-common and mysql-client several days ago, imagine my surprise when I found out the package motion was missing. I checked /var/log/dpkg.log and there it was, it was really removed at the same time I purged MySQL packages.

I've run sudo apt purge --simulate kubuntu-desktop. The output is not encouraging:

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

As you can see, xfce4-pulseaudio-plugin is marked for autoremoval. And I don't doubt some essential packages might be. If only I knew which ones...

How can I fix it?


I'm glad I didn't run these commands as soon as I was recommended to try them:

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))))'

But I did run this, to see what would be deleted if I did:

aptitude search '?and(?reverse-depends(kubuntu),?not(?reverse-depends(?exact-name(xubuntu-desktop))))' | grep -vP "^p\s+[^\s]{2,}"

Here's the output:

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                    

It's even more for 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            

I had to edit some of the lines out, there's a 30,000 characters limit here, and the output was huge. Anyway, I can't imagine removing sudo, for one, would go well.

It more and more looks like I'll have to remove the unwanted packages by hand, and then apt-mark as manually installed the ones I'm not sure about, because KDE might have broken dependencies other than those of Xfce (xubuntu-desktop still directly depends on some of the packages listed above). I really don't want to do it but it's preferable to missing some essential packages or performing a clean install after trying to do it with the help of automatic tools.

What would be the fastest way to check a package? Like, build its dependecy tree or something? I suppose I can remove the packages on which nothing else depends first after identifying them with deborphan, and then gradually go up, purging their dependencies, but that'll take a lot of time.

Update #2

I think I've solved the problem, but I'll be damned if I know how I did it. I can say what I did though. I've removed both kubuntu-desktop and xubuntu-desktop (from Ctrl+Alt+F1) and autoremoved their dependencies, and then rebooted the computer. The system booted, and I've got Xfce no problem. Now, I don't know if some critically important packages are missing or not, but I've used tee this time, so I can always look up what exactly has been autoremoved. Anyway, I am going to use | tee -a <log file name> for every install and removal from now on. I really recommend anyone to do the same thing, because while /var/log/dpkg.log may be reliable, there's just too much info there.


Try this:

Start in text-only mode

  • Switch on your computer.

  • Press and hold the Shift key, which will bring up the Grub menu.

  • Select the line which starts with Advanced options.

  • Select the line ending with (recovery mode)

  • Your PC should display a menu with a number of options.

  • First select the option will be Enable networking

  • Then select the option will be Drop to root shell prompt

  • The PC will start in a terminal.

    Run these commands:

Mount partitions in read-write mode

mount -o remount,rw /

mount --all

Update repositories

apt-get update

Install aptitude and deborphan

apt-get install --reinstall aptitude deborphan

Eliminate all the components that are not necessary in 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))))'

Reinstall xubuntu-desktop

apt-get install --reinstall xubuntu-desktop

Eliminate orphan packages

apt-get --purge remove $(deborphan)
deborphan --libdevel
apt-get --purge remove $(deborphan --libdevel)
deborphan --find-config
dpkg --purge $(deborphan --find-config)

Remove unnecessary packages

apt-get autoremove

Remove downloaded packages

apt-get clean

Restart system

  • Is it really necessary to start in text-only mode? Ctrl+Alt+F1 worked the first time around, and now that I've reinstalled kubuntu-desktop both KDE and Xfce work too. The message about scanning for btrfs systems did not appear again after the reinstallation, and even if it had, my / and /home directories are mounted on btrfs partitions, both of which were operational the whole time, it was only when switched back to Ctrl+Alt+F7 that I saw that single message instead of a desktop. – Shrenostal Feb 19 '17 at 11:09
  • It is wise to work in text only mode when modifying desktops. – kyodake Feb 19 '17 at 13:00
  • If Ctrl-Alt-F1 works, there are no need to go to Rescue-mode. But never do this kind of work in a terminal-window opened with Ctrl-Alt-T!! – Soren A Feb 19 '17 at 20:42
  • Maybe... But I don't think using aptitude remove '?and(?reverse-depends(kubuntu),?not(?reverse-depends(?exact-name(xubuntu-desktop))))' is safe at all, anyway. I've run aptitude search '?and(?reverse-depends(kubuntu),?not(?reverse-depends(?exact-name(xubuntu-desktop))))' | grep -vP "^p\s+[^\s]{2,}", and updated my question. Somehow, I doubt running the first command would not remove those hundreds of packages aptitude search listed. – Shrenostal Feb 20 '17 at 17:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.