brainiac sardonic
Posts: 3
Joined: Sun Aug 16, 2020 3:55 am

Can't remove X due to "unmet dependencies"

Thu Apr 22, 2021 8:21 pm

This seems like the most common way to remove all GUI-related packages but I'm open to alternatives. Yes, I have run apt-get upgrade && apt-get update as well as apt-get full-upgrade -y.

sudo apt-get remove -f --purge x11-common && sudo apt-get autoremove
returns:

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libsdl1.2-dev : Depends: libsdl1.2debian (= 1.2.15+dfsg2-6rpi) but it is not going to be installed
                 Depends: libpulse-dev but it is not going to be installed
 libsdl2-dev : Depends: fcitx-libs-dev but it is not going to be installed
               Depends: libxss-dev but it is not going to be installed
               Depends: libxt-dev but it is not going to be installed
 lxlock : Depends: light-locker but it is not going to be installed or
                   xscreensaver but it is not going to be installed or
                   gnome-screensaver but it is not going to be installed or
                   i3lock but it is not going to be installed or
                   suckless-tools but it is not going to be installed or
                   slim but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
The packages seem like they could all be removed, but I'm cautious about libsdl2-dev in particular. If someone thinks they are all fine to remove I'll try that.

apt-cache policy, if it helps.

Code: Select all

Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://archive.raspberrypi.org/debian buster/main armhf Packages
     release o=Raspberry Pi Foundation,a=testing,n=buster,l=Raspberry Pi Foundation,c=main,b=armhf
     origin archive.raspberrypi.org
 500 http://raspbian.raspberrypi.org/raspbian buster/rpi armhf Packages
     release o=Raspbian,a=stable,n=buster,l=Raspbian,c=rpi,b=armhf
     origin raspbian.raspberrypi.org
 500 http://raspbian.raspberrypi.org/raspbian buster/non-free armhf Packages
     release o=Raspbian,a=stable,n=buster,l=Raspbian,c=non-free,b=armhf
     origin raspbian.raspberrypi.org
 500 http://raspbian.raspberrypi.org/raspbian buster/contrib armhf Packages
     release o=Raspbian,a=stable,n=buster,l=Raspbian,c=contrib,b=armhf
     origin raspbian.raspberrypi.org
 500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
     release o=Raspbian,a=stable,n=buster,l=Raspbian,c=main,b=armhf
     origin raspbian.raspberrypi.org
Pinned packages:

bls
Posts: 1367
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: Can't remove X due to "unmet dependencies"

Thu Apr 22, 2021 10:03 pm

Or better yet, start with RasPiOS Lite. There are no X packages to remove.

But if really want to start with RasPiOS with Desktop of some flavor, I think you need to remove raspberrypi-ui-mods, and probably a few other packages to get what you want.
Pi tools:
Quickly and easily build customized-just-for-you SD Cards: https://github.com/gitbls/sdm
Easily run your network's DHCP/DNS on a Pi: https://github.com/gitbls/ndm
Easy strongSwan VPN installer/manager: https://github.com/gitbls/pistrong
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo

brainiac sardonic
Posts: 3
Joined: Sun Aug 16, 2020 3:55 am

Re: Can't remove X due to "unmet dependencies"

Fri Apr 23, 2021 2:23 am

For anyone who may have the same issue, I resolved this by removing the packages with "unmet dependencies" individually. I was then able to remove (with --purge) X11-common and use autoremove to pick up the rest. Still not quite sure what the libsdl2* ones do but it seems not to have broken the install. Cheers.

Return to “Troubleshooting”