0

I recently really screwed up my Kali VM. There was a package I installed by accident ("fontconfig"). I didn't know what it was or why it took so long to install. I tried to purge it and realized that when the purge started many many packages were being removed. I quickly canceled the purge, and did a snapshot. I tried to reboot to make sure my system was still stable, but now only boots to a black screen with a blinking cursor.

I rolled the snapshot back and am able to get back to my state right after I did the purge. I knew some configuration or vital package was removed from the mistake I made.

Looking at the term.log I see the last entries. When checking these packages were removed for sure.

Log started: 2021-04-26  21:50:52                                                                                                                                                                                                            
(Reading database ... ^M(Reading database ... 5%^M(Reading database ... 10%^M(Reading database ... 15%^M(Reading database ... 20%^M(Reading database ... 25%^M(Reading database ... 30%^M(Reading database ... 35%^M(Reading database ... 40%
Removing apt-listchanges (3.22) ...^M                                                                                                                                                                                                        
Removing kali-desktop-xfce (2020.1.13) ...^M                                                                                                                                                                                                 
Removing atril (1.24.0-1) ...^M                                                                                                                                                                                                              
Removing binwalk (2.2.0+dfsg1-1) ...^M                                                                                                                                                                                                       
Removing bless (0.6.0-7) ...^M                                                                                                                                                                                                               
Removing cherrytree (0.39.4-0) ...^M                                                                                                                                                                                                         
Removing chromium-driver (81.0.4044.92-1) ...^M                                                                                                                                                                                              
Removing kali-desktop-core (2020.2.21) ...^M                                                                                                                                                                                                 
Removing chromium (81.0.4044.92-1) ...^M                                                                                                                                                                                                     
Removing commix (3.0-20191111-0kali1) ...^M                                                                                                                                                                                                  
Removing crackmapexec (5.0.2~dev-0kali2) ...^M                                                                                                                                                                                               
Removing creddump7 (0.1+git20190429-0kali1) ...^M                                                                                                                                                                                            
Removing crowbar (4.1-0kali1) ...^M                                                                                                                                                                                                          
Removing legion (0.3.6b-0kali2) ...^M                                                                                                                                                                                                        
Removing cutycapt (0.0~svn10-0.1+b2) ...^M                                                                                                                                                                                                   
Removing faraday (3.10.2-0kali1) ...^M                                                                                                                                                                                                       
^X^X^X                                              

I tried fixing the problem by trying to reinstall / fix broken packages in apt. But I keep running into unmet dependencies.

I also tried the whole clear out /var/lib/dpkg/status, but this does nothing to fix the problem.

Commands I have tried:

sudo apt update
sudo apt install -f
sudo apt --fix-borken install
sudo apt upgrade
sudo apt auto-remove
sudo apt-get clean && sudo apt-get update
sudo apt-get autoclean
sudo apt-get clean
apt --fix-broken install
sudo apt --fix-broken install
apt update && apt install -f
sudo apt update && apt install -f

Running most of the commands above ends up with me trying to run fix-broken, which ends up with the output you see at the end of this post.

It seems like much was removed. Is the only way to fix this by manually installing all of this? How do I go about trying to install all this? When I try to sudo apt install the first package (libpangoft2-1.0-0) I get unmet dependencies as well.

What can I do at this point?

       Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 gir1.2-pango-1.0 : Depends: libpangoft2-1.0-0 (= 1.44.7-4) but 1.46.2-3 is to be installed
 guymager : Depends: libqt5gui5 (>= 5.0.2) but it is not going to be installed or
                     libqt5gui5-gles (>= 5.0.2) but it is not going to be installed
 keditbookmarks : Depends: libqt5gui5 (>= 5.7.0) but it is not going to be installed or
                           libqt5gui5-gles (>= 5.7.0) but it is not going to be installed
 kio : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 kolourpaint : Depends: libqt5gui5 (>= 5.11.0~) but it is not going to be installed or
                        libqt5gui5-gles (>= 5.11.0~) but it is not going to be installed
 kwayland-integration : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                                 libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libdbusmenu-qt5-2 : Depends: libqt5gui5 (>= 5.0.2) but it is not going to be installed or
                              libqt5gui5-gles (>= 5.0.2) but it is not going to be installed
 libkf5auth5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                        libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5bookmarks5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                             libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5completion5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                              libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5configgui5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                             libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5configwidgets5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                                 libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5crash5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                         libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5globalaccel-bin : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                                  libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5globalaccel5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                               libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5globalaccelprivate5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                                      libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5guiaddons5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                             libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5iconthemes-bin : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                                 libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5iconthemes5 : Depends: libqt5gui5 (>= 5.12.2) but it is not going to be installed or
                              libqt5gui5-gles (>= 5.12.2) but it is not going to be installed
 libkf5idletime5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                            libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5itemviews5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                             libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5jobwidgets5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                              libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5kdelibs4support5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                                   libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5kdelibs4support5-bin : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                                       libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5kiofilewidgets5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                                  libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5kiogui5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                          libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5kiowidgets5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                              libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5notifications5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                                 libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5parts5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                         libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5sane5 : Depends: libqt5gui5 (>= 5.7.0) but it is not going to be installed or
                        libqt5gui5-gles (>= 5.7.0) but it is not going to be installed
 libkf5solid5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                         libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5sonnetui5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                            libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5textwidgets5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                               libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5wallet-bin : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                             libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5waylandclient5 : Depends: libqt5gui5 (>= 5.12.2) but it is not going to be installed or
                                 libqt5gui5-gles (>= 5.12.2) but it is not going to be installed
 libkf5widgetsaddons5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                                 libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5windowsystem5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                                libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libkf5xmlgui5 : Depends: libqt5gui5 (>= 5.12.0~) but it is not going to be installed or
                          libqt5gui5-gles (>= 5.12.0~) but it is not going to be installed
 libpangocairo-1.0-0 : Depends: libpangoft2-1.0-0 (= 1.44.7-4) but 1.46.2-3 is to be installed
 libpangoft2-1.0-0 : Depends: libpango-1.0-0 (= 1.46.2-3) but 1.44.7-4 is to be installed
                     Breaks: libpangoft2-1.0-0:i386 (!= 1.46.2-3) but 1.44.7-4 is to be installed
 libpangoft2-1.0-0:i386 : Breaks: libpangoft2-1.0-0 (!= 1.44.7-4) but 1.46.2-3 is to be installed
 libpangoxft-1.0-0 : Depends: libpangoft2-1.0-0 (= 1.44.7-4) but 1.46.2-3 is to be installed
 libphonon4qt5-4 : Depends: libqt5gui5 (>= 5.7.0) but it is not going to be installed or
                            libqt5gui5-gles (>= 5.7.0) but it is not going to be installed
 libpolkit-qt5-1-1 : Depends: libqt5gui5 (>= 5.1.0) but it is not going to be installed or
                              libqt5gui5-gles (>= 5.1.0) but it is not going to be installed
 libqscintilla2-qt5-15 : Depends: libqt5gui5 (>= 5.6.0~beta) but it is not going to be installed or
                                  libqt5gui5-gles (>= 5.6.0~beta) but it is not going to be installed
 libqt5charts5 : Depends: libqt5gui5 (>= 5.12.5+dfsg~) but it is not going to be installed or
                          libqt5gui5-gles (>= 5.12.5+dfsg~) but it is not going to be installed
 libqt5designer5 : Depends: libqt5gui5 (>= 5.7.0) but it is not going to be installed or
                            libqt5gui5-gles (>= 5.7.0) but it is not going to be installed
 libqt5help5 : Depends: libqt5gui5 (>= 5.0.2) but it is not going to be installed or
                        libqt5gui5-gles (>= 5.0.2) but it is not going to be installed
 libqt5multimedia5 : Depends: libqt5gui5 (>= 5.12.5+dfsg~) but it is not going to be installed or
                              libqt5gui5-gles (>= 5.12.5+dfsg~) but it is not going to be installed
 libqt5multimedia5-plugins : Depends: libqt5gui5 (>= 5.12.5+dfsg~) but it is not going to be installed or
                                      libqt5gui5-gles (>= 5.12.5+dfsg~) but it is not going to be installed
 libqt5multimediagsttools5 : Depends: libqt5gui5 (>= 5.12.5+dfsg~) but it is not going to be installed or
                                      libqt5gui5-gles (>= 5.12.5+dfsg~) but it is not going to be installed
 libqt5multimediawidgets5 : Depends: libqt5gui5 (>= 5.12.5+dfsg~) but it is not going to be installed or
                                     libqt5gui5-gles (>= 5.12.5+dfsg~) but it is not going to be installed
 libqt5opengl5 : Depends: libqt5gui5 (>= 5.1.0) but it is not going to be installed
                 Depends: libqt5gui5 (>= 5.12.5) but it is not going to be installed or
                          libqt5gui5-gles (>= 5.12.5) but it is not going to be installed
 libqt5printsupport5 : Depends: libqt5gui5 (>= 5.11.0~rc1) but it is not going to be installed or
                                libqt5gui5-gles (>= 5.11.0~rc1) but it is not going to be installed
 libqt5quick5 : Depends: libqt5gui5 (>= 5.1.0) but it is not going to be installed
                Depends: libqt5gui5 (>= 5.12.5) but it is not going to be installed or
                         libqt5gui5-gles (>= 5.12.5) but it is not going to be installed
 libqt5svg5 : Depends: libqt5gui5 (>= 5.12.5+dfsg~) but it is not going to be installed or
                       libqt5gui5-gles (>= 5.12.5+dfsg~) but it is not going to be installed
 libqt5waylandclient5 : Depends: libqt5gui5 (>= 5.12.5+dfsg~) but it is not going to be installed or
                                 libqt5gui5-gles (>= 5.12.5+dfsg~) but it is not going to be installed
 libqt5waylandcompositor5 : Depends: libqt5gui5 (>= 5.12.5+dfsg~) but it is not going to be installed or
                                     libqt5gui5-gles (>= 5.12.5+dfsg~) but it is not going to be installed
 libqt5webkit5 : Depends: libqt5gui5 (>= 5.9.0~beta) but it is not going to be installed or
                          libqt5gui5-gles (>= 5.9.0~beta) but it is not going to be installed
 libqt5widgets5 : Depends: libqt5gui5 (>= 5.12.5) but it is not going to be installed or
                           libqt5gui5-gles (>= 5.12.5) but it is not going to be installed
 libqt5x11extras5 : Depends: libqt5gui5 (>= 5.12.5+dfsg~) but it is not going to be installed or
                             libqt5gui5-gles (>= 5.12.5+dfsg~) but it is not going to be installed
 libqtermwidget5-0 : Depends: libqt5gui5 (>= 5.7.0) but it is not going to be installed or
                              libqt5gui5-gles (>= 5.7.0) but it is not going to be installed
 ophcrack : Depends: libqt5gui5 (>= 5.0.2) but it is not going to be installed or
                     libqt5gui5-gles (>= 5.0.2) but it is not going to be installed
 phonon4qt5-backend-vlc : Depends: libqt5gui5 (>= 5.0.2) but it is not going to be installed or
                                   libqt5gui5-gles (>= 5.0.2) but it is not going to be installed
 python3-pyqt5 : Depends: libqt5gui5 (>= 5.1.0) but it is not going to be installed
                 Depends: libqt5gui5 (>= 5.12.2) but it is not going to be installed or
                          libqt5gui5-gles (>= 5.12.2) but it is not going to be installed
 python3-pyqt5.qtopengl : Depends: libqt5gui5 (>= 5.1.0) but it is not going to be installed
 qt5-gtk-platformtheme : Depends: libqt5gui5 (>= 5.10.0) but it is not going to be installed or
                                  libqt5gui5-gles (>= 5.10.0) but it is not going to be installed
 qt5-gtk2-platformtheme : Depends: libqt5gui5 (>= 5.10.0) but it is not going to be installed or
                                   libqt5gui5-gles (>= 5.10.0) but it is not going to be installed
 qt5-style-plugin-cleanlooks : Depends: libqt5gui5 (>= 5.2.0) but it is not going to be installed or
                                        libqt5gui5-gles (>= 5.2.0) but it is not going to be installed
 qt5-style-plugin-motif : Depends: libqt5gui5 (>= 5.3.0) but it is not going to be installed or
                                   libqt5gui5-gles (>= 5.3.0) but it is not going to be installed
 qt5-style-plugin-plastique : Depends: libqt5gui5 (>= 5.2.0) but it is not going to be installed or
                                       libqt5gui5-gles (>= 5.2.0) but it is not going to be installed
 qterminal : Depends: libqt5gui5 (>= 5.7.0) but it is not going to be installed or
                      libqt5gui5-gles (>= 5.7.0) but it is not going to be installed
 qtwayland5 : Depends: libqt5gui5 (>= 5.12.5+dfsg~) but it is not going to be installed or
                       libqt5gui5-gles (>= 5.12.5+dfsg~) but it is not going to be installed
 sqlitebrowser : Depends: libqt5gui5 (>= 5.3.0) but it is not going to be installed or
                          libqt5gui5-gles (>= 5.3.0) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

2 Answers 2

0

Run the following command:

sudo apt-get update && sudo apt-get autoclean && sudo apt-get clean && sudo apt-get autoremove

That cleans up most errors.

When done, restart and run sudo apt-get update followed by sudo apt-get upgrade.

If this does not work, you very most likely need to reinstall Kali. This is best approached by making a new machine and copying any data over to it.

Follow up note: I make a backup of all my virtual machines on another computer so I can retrieve a working machine if need be.

3
  • Thanks for the reply, running that one-liner still ends up with E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).. I ran it anyway, and rebooted. Unfortunately after reboot, I still get a black screen with a blinking cursor. Believe kali xfce is very damaged...
    – Dave
    Commented Apr 27, 2021 at 12:37
  • If his is the case, you need to reinstall Kali. Perhaps make a new VM and then you can copy any data over.
    – anon
    Commented Apr 27, 2021 at 12:38
  • Why was a known working answer downvoted? Used this method to fix Linux numerous times. Or is as normal, someone just getting their joliies and kicks
    – anon
    Commented May 10 at 21:49
-1

There was no way to fix this problem easily. Luckily I had a snapshot from December. I was able to first scp into the system and backup what I needed, then rollback to the snapshot from December and fix all deltas between now and then.

Take backup's folks. Also read documentation. Lesson learned.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .