安装 NFS 服务器时出现“无法纠正问题,您持有损坏的软件包”

安装 NFS 服务器时出现“无法纠正问题,您持有损坏的软件包”

我正在尝试在我的 Ubuntu 12.04 机器上安装 NFS 服务器,但每次它都会出现如下错误:

david@machineA:~$ sudo apt-get install nfs-common nfs-kernel-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
nfs-common is already the newest version.
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:
 nfs-kernel-server : Depends: nfs-common (= 1:1.2.5-3ubuntu3) but 1:1.2.5-3ubuntu3.1 is to be installed
E: Unable to correct problems, you have held broken packages.

以下是输出lsb_release -a

david@machineA:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04 LTS
Release:        12.04
Codename:       precise

我做错了什么吗?我该如何解决这个问题?

答案1

尝试按以下顺序运行以下命令:

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get update
sudo apt-get install nfs-kernel-server

这基本上会强制更新包缓存,以及升级其他系统实用程序。

您可能遇到的一个问题是,您指定了nfs-common,它将获取最新版本。 IIRCapt将自动满足所有依赖关系(包括版本),但强制安装会nfs-common安装太新的版本。

相关内容