MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.85k stars 495 forks source link

Cannot remove Xserver #3384

Closed bugmaschine closed 4 years ago

bugmaschine commented 4 years ago

Details:

Steps to reproduce:

  1. Uninstall Xserver

Expected behaviour:

Actual behaviour:

Extra details:

Additional logs:

E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
MichaIng commented 4 years ago

@Crasher124 Many thanks for your report. Yeah I recognised this when creating images where desktop is preinstalled. Can you please run the following and paste output:

apt purge $(dpkg --get-selections | mawk '{print $1}' | grep '^(xorg|xserver-xorg|x11-|xinit$|xcompmgr$|xterm$|xfonts-base$')
bugmaschine commented 4 years ago

Here is the output Anmerkung 2020-02-15 151322

MichaIng commented 4 years ago

@Crasher124 Whoopsie, forgot the extended regex option for grep:

apt purge $(dpkg --get-selections | mawk '{print $1}' | grep -E '^(xorg|xserver-xorg|x11-|xinit$|xcompmgr$|xterm$|xfonts-base$')
bugmaschine commented 4 years ago

Anmerkung 2020-02-15 151322

Is this better?

MichaIng commented 4 years ago

@Crasher124 Still a syntax error, damn thing that APT itself does not silently ignore non-installed packages 😄:

apt purge $(dpkg --get-selections | mawk '{print $1}' | grep -E '^(xorg|xserver-xorg|xinit$|xcompmgr$|xterm$|xfonts-base$|x11-xserver-utils$|x11-utils$|x11-xkb-utils$)')

I just recognised that x11-common is required for the Java package (if installed), hence this must not be purged. I adjusted the pattern above.

bugmaschine commented 4 years ago

It worked thanks 😃

MichaIng commented 4 years ago

@Crasher124 Finally, great. Running this does not mark Xserver as uninstalled within dietpi-software, however it is practically uninstalled 😉. You could mark it manually:

sed -i '/aSOFTWARE_INSTALL_STATE\[6\]=2/aSOFTWARE_INSTALL_STATE\[6\]=0/' /DietPi/dietpi/.installed

Ah, there will be some dependency packages left. You can purge them via: G_AGA

bugmaschine commented 4 years ago

I did run the command but it is still in dietpi software. It's not important to have it not anymore listed, But thanks for the help. 😃

MichaIng commented 4 years ago

@Crasher124 I need to better review my commands :sweat_smile: it's (missed s above to do the actual replacement):

sed -i 's/aSOFTWARE_INSTALL_STATE\[6\]=2/aSOFTWARE_INSTALL_STATE\[6\]=0/' /DietPi/dietpi/.installed

I mark this issue as closed then, the following commit should fix the issue in most cases: https://github.com/MichaIng/DietPi/commit/d8b4979c77a571359d0295594866bbbd198850e2#diff-d92a6ee04e02fd2a2dc23d5bec3e6a98