Linux桌面 失败,ubuntu无法进入桌面,安装ubuntu-desktop失败的解决办法

在执行windows远程连接ubuntu操作(安装 Xfce 和 Xrdp )后,ubuntu在登录后无法进入桌面。

解决方法如下:

1.Ctrl+Alt+F1(或者F2-F8)进入命令行界面,登录账户

2.卸载Xwindows软件

sudo apt-get autoremove ubuntu-desktop

3.安装所有依赖软件

sudo apt-getupdate

sudo apt-get install ubuntu-desktop

4.重启 reboot

执行重装ubuntu-desktop前,可优先卸载引起该问题的软件

执行sudo apt install ubuntu-desktop时报错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:

ubuntu-desktop : Depends: nautilus but it is not going to be installed

Recommends: libreoffice-calc but it is not going to be installed

Recommends: libreoffice-gnome but it is not going to be installed

Recommends: libreoffice-impress but it is not going to be installed

Recommends: libreoffice-math but it is not going to be installed

Recommends: libreoffice-ogltrans but it is not going to be installed

Recommends: libreoffice-writer but it is not going to be installed

Recommends: nautilus-share but it is not going to be installed

E: Unable to correct problems, you have held broken packages.

解决方法1:

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ bionic main universe multiverse restricted"

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ bionic-updates main universe multiverse restricted"

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ bionic-security main universe multiverse restricted"

sudo apt-get upgrade

sudo apt-get install ubuntu-desktop

解决方法2:

First runsudo apt install -f

First runsudo apt --fix-broken install

Runsudo apt install --reinstall ubuntu-desktop

Runsudo dpkg --configure -a && sudo apt autoremove -y && sudo apt autoclean && sudo apt remove && sudo apt clean && sudo apt update && sudo apt install -f && sudo apt full-upgrade -y

----------------------------------------------------------------

最终问题未解决,重装系统

期待更好的解决办法

来源:oschina

链接:https://my.oschina.net/u/3732258/blog/4277972