升级Ubuntu 14.04后出现了依赖关系错误。

我最近升级到了Ubuntu 14.04 LTS,但是有一些软件包出现了问题。我尝试运行了apt-get -f install和dpkg --configure -a命令,但都没有起作用。 请帮忙解决一下... 以下是apt-get -f install命令的输出结果。
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  samba-libs
The following NEW packages will be installed:
  samba-libs
0 upgraded, 1 newly installed, 0 to remove and 612 not upgraded.
5 not fully installed or removed.
Need to get 0 B/4,101 kB of archives.
After this operation, 18.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 267294 files and directories currently installed.)
Preparing to unpack .../samba-libs_2%3a4.1.6+dfsg-1ubuntu2_amd64.deb ...
secrets.tdb exists in /var/lib/samba and /var/lib/samba/private, aborting samba-libs preinst
rename one of them to allow the install/upgrade to continue
http://bugs.debian.org/726472
/var/lib/samba:
total 2208
drwxr-xr-x   7 root root         4096 Apr 18 16:57 .
drwxr-xr-x  71 root root         4096 Apr 18 16:56 ..
-rw-------   1 root root       421888 Dec 11 11:30 account_policy.tdb
-rw-------   1 root root          696 Dec 11 11:30 group_mapping.tdb
drwxr-x---   2 root root         4096 Apr 18 13:54 ntp_signd
-rw-------   1 root root       421888 Jan  2 20:45 passdb.tdb
drwxr-xr-x   6 root root         4096 Apr 18 13:54 private
-rw-------   1 root root       528384 Jan  2 20:02 registry.tdb
-rw-------   1 root root       430080 Dec 11 11:30 secrets.tdb
-rw-------   1 root root       421888 Mar  9 13:46 share_info.tdb
drwxrwx---+  3 root    3000000   4096 Dec 26 17:27 sysvol
drwxrwx--T   2 root sambashare   4096 Jan  2 20:28 usershares
drwxr-x---   2 root root         4096 Apr 18 13:54 winbindd_privileged

/var/lib/samba/private:
total 10904
drwxr-xr-x 6 root root    4096 Apr 18 13:54 .
drwxr-xr-x 7 root root    4096 Apr 18 16:57 ..
-rw-r--r-- 1 root root    2270 Dec 26 17:28 dns_update_list
-rw------- 1 root root 1286144 Dec 26 17:27 hklm.ldb
-rw------- 1 root root 1286144 Dec 26 17:27 idmap.ldb
-rw-r--r-- 1 root root      92 Dec 26 17:28 krb5.conf
srwxrwxrwx 1 root root       0 Apr 18 13:54 ldapi
drwxr-x--- 2 root root    4096 Apr 18 13:54 ldap_priv
-r--r--r-- 1 root root     200 Jan  2 20:48 named.conf.update
-rw------- 1 root root 1286144 Dec 26 17:27 privilege.ldb
-rw------- 1 root root     696 Dec 26 17:28 randseed.tdb
-rw------- 1 root root 4251648 Dec 26 17:28 sam.ldb
drwx------ 2 root root    4096 Dec 26 17:27 sam.ldb.d
-rw------- 1 root root     696 Apr 18 13:54 schannel_store.tdb
-rw------- 1 root root    1087 Dec 26 17:28 secrets.keytab
-rw------- 1 root root 1286144 Dec 26 17:28 secrets.ldb
-rw------- 1 root root  430080 Dec 26 17:28 secrets.tdb
-rw------- 1 root root 1286144 Dec 26 17:27 share.ldb
drwxr-xr-x 3 root root    4096 Dec 26 17:28 smbd.tmp
-rw-r--r-- 1 root root     955 Dec 26 17:28 spn_update_list
drwxr-xr-x 2 root root    4096 Dec 26 17:28 tls
dpkg: error processing archive /var/cache/apt/archives/samba-libs_2%3a4.1.6+dfsg-1ubuntu2_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/samba-libs_2%3a4.1.6+dfsg-1ubuntu2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

1请将sudo apt-get install -f的输出结果发布出来。 - Avinash Raj
dpkg:处理存档/var/cache/apt/archives/samba-libs_2%3a4.1.6+dfsg-1ubuntu2_amd64.deb时出错(--unpack): 子进程新的预安装脚本返回错误退出状态1 在处理过程中遇到了错误: /var/cache/apt/archives/samba-libs_2%3a4.1.6+dfsg-1ubuntu2_amd64.deb E:子进程/usr/bin/dpkg返回错误代码(1) - vishgarg
请在您的问题中发布sudo apt-get install -f命令的完整输出。 - Avinash Raj
如何修改我的问题? - vishgarg
命令的输出是 dpkg: 在处理存档 /var/cache/apt/archives/samba-libs_2%3a4.1.6+dfsg-1ubuntu2_amd64.deb (--unpack) 时出错:子进程新的预安装脚本返回错误退出状态 1 处理过程中遇到了错误:/var/cache/apt/archives/samba-libs_2%3a4.1.6+dfsg-1ubuntu2_amd64.deb E: 子进程 /usr/bin/dpkg 返回错误代码 (1) - vishgarg
点击这个链接,然后将sudo apt-get install -f的完整输出贴在那里。 - Avinash Raj
请将dpkg --get-selections | grep samba-libs的输出结果发布出来。 - Avinash Raj
以上命令是否显示任何内容?如果是的话,请发布出来。 - Avinash Raj
it displays nothing - vishgarg
secrets.tdb exists in /var/lib/samba and /var/lib/samba/private, aborting samba-libs preinst 的完整句子。 - Avinash Raj
secrets.tdb存在于/var/lib/samba和/var/lib/samba/private目录中,因此中止samba-libs的预安装操作。 请将其中一个文件重命名,以便继续进行安装/升级。 - vishgarg
1个回答

这是线索。
secrets.tdb exists in /var/lib/samba and /var/lib/samba/private, aborting samba-libs preinst
rename one of them to allow the install/upgrade to continue

将文件/var/lib/samba/secrets.tdb移动到另一个位置可以解决你的问题。
sudo mv /var/lib/samba/secrets.tdb ~/Desktop

然后运行下面的命令来修复依赖关系,
sudo apt-get install -f

(链接组网的一部分)不存在;从备选列表中移除 update-alternatives: 警告:/etc/alternatives/net 是悬空的;将使用最佳选择进行更新 update-alternatives: 警告:备选项 /usr/bin/testparm.samba3(链接组 testparm 的一部分)不存在;从备选列表中移除 update-alternatives: 警告:/etc/alternatives/testparm 是悬空的;将使用最佳选择进行更新 正在设置 nautilus-share (0.7.3-1ubuntu5) ... 正在处理 libc-bin (2.19-0ubuntu6) 的触发器... - vishgarg
命令apt-get install -f now的输出结果 - vishgarg