为了进行某些文件共享,我不得不安装 X2Go Client,这会删除一些软件包。我认为它还删除了 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.
输出apt-cache policy nautilus ubuntu-desktop
:
nautilus:
Installed: (none)
Candidate: 1:3.26.3-0ubuntu4
Verstion table:
1:3.26.4-0~ubuntu18.04.4 -1
100 /var/lib/dpkg/status
1:3.26.3-0ubuntu4 500
500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
ubuntu-desktop:
Installed: (none)
Candidate: 1.417
Version table:
1.417 500
500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
安装单独的软件包(nautilus、libreoffice)也会导致类似的错误。迄今为止采取的措施:
- 使用 aptitude 进行安装
- 安装前删除 X2Go 客户端
- 第一次运行
sudo apt install -f
- 第一次运行
sudo apt --fix-broken install
- 跑步
sudo apt install --reinstall ubuntu-desktop
- 跑步
sudo 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
使用Ubuntu 18.04.2 LTS
答案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