我即将安装 gparted 并使用以下命令:
sudo apt-get install gparted
但我得到的是:
root@ubuntu:~# sudo apt-get install gparted
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
gparted : Depends: gparted-common (= 1.0.0-0.1build1) but it is not going to be installed
samba : Depends: samba-common (= 2:4.15.13+dfsg-0ubuntu0.20.04.3) but 2:4.15.13+dfsg-0ubuntu0.20.04.7 is to be installed
Depends: libwbclient0 (= 2:4.15.13+dfsg-0ubuntu0.20.04.3) but 2:4.15.13+dfsg-0ubuntu0.20.04.7 is to be installed
Depends: samba-libs (= 2:4.15.13+dfsg-0ubuntu0.20.04.3) but 2:4.15.13+dfsg-0ubuntu0.20.04.7 is to be installed
samba-common-bin : Depends: samba-common (= 2:4.15.13+dfsg-0ubuntu0.20.04.3) but 2:4.15.13+dfsg-0ubuntu0.20.04.7 is to be installed
Depends: samba-libs (= 2:4.15.13+dfsg-0ubuntu0.20.04.3) but 2:4.15.13+dfsg-0ubuntu0.20.04.7 is to be installed
Depends: libwbclient0 (= 2:4.15.13+dfsg-0ubuntu0.20.04.3) but 2:4.15.13+dfsg-0ubuntu0.20.04.7 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
所以我遵循建议,tab 命令:
sudo apt --fix-broken install
我得到的是
root@ubuntu:~# sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
ieee-data python3-bpfcc python3-netaddr
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
samba samba-common-bin
Suggested packages:
bind9 bind9utils ctdb ldb-tools ntp | chrony smbldap-tools winbind heimdal-clients
The following packages will be upgraded:
samba samba-common-bin
2 upgraded, 0 newly installed, 0 to remove and 144 not upgraded.
7 not fully installed or removed.
Need to get 0 B/1,742 kB of archives.
After this operation, 2,048 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 218079 files and directories currently installed.)
Preparing to unpack .../samba_2%3a4.15.13+dfsg-0ubuntu0.20.04.7_amd64.deb ...
Unpacking samba (2:4.15.13+dfsg-0ubuntu0.20.04.7) over (2:4.15.13+dfsg-0ubuntu0.20.04.3) ...
dpkg: error processing archive /var/cache/apt/archives/samba_2%3a4.15.13+dfsg-0ubuntu0.20.04.7_amd64.deb (--unpack):
unable to create '/usr/bin/dumpmscat.dpkg-new' (while processing './usr/bin/dumpmscat'): Operation not permitted
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Samba is not being run as an AD Domain Controller: Masking samba-ad-dc.service
Please ignore the following error about deb-systemd-helper not finding those services.
(samba-ad-dc.service already masked)
Failed to preset unit: Unit file /etc/systemd/system/samba-ad-dc.service is masked.
/usr/bin/deb-systemd-helper: error: systemctl preset failed on samba-ad-dc.service: No such file or directory
nmbd.service is a disabled or a static unit not running, not starting it.
samba-ad-dc.service is a disabled or a static unit not running, not starting it.
smbd.service is a disabled or a static unit not running, not starting it.
Preparing to unpack .../samba-common-bin_2%3a4.15.13+dfsg-0ubuntu0.20.04.7_amd64.deb ...
Unpacking samba-common-bin (2:4.15.13+dfsg-0ubuntu0.20.04.7) over (2:4.15.13+dfsg-0ubuntu0.20.04.3) ...
dpkg: error processing archive /var/cache/apt/archives/samba-common-bin_2%3a4.15.13+dfsg-0ubuntu0.20.04.7_amd64.deb (--unpack):
unable to create '/usr/bin/dbwrap_tool.dpkg-new' (while processing './usr/bin/dbwrap_tool'): Operation not permitted
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Checking smb.conf with testparm
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed
Server role: ROLE_STANDALONE
Done
Errors were encountered while processing:
/var/cache/apt/archives/samba_2%3a4.15.13+dfsg-0ubuntu0.20.04.7_amd64.deb
/var/cache/apt/archives/samba-common-bin_2%3a4.15.13+dfsg-0ubuntu0.20.04.7_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
它提到的错误是
unable to create '/usr/bin/dumpmscat.dpkg-new' (while processing './usr/bin/dumpmscat'): Operation not permitted
这是真的,我甚至无法通过 sudo 在该路径中创建文件
另一个问题是 samba 守护进程
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
清楚地表明 Samba 未作为 AD 域控制器运行:屏蔽 samba-ad-dc.service
我找到了systemctl status samba-ad-dc.service
节目
● samba-ad-dc.service
Loaded: masked (Reason: Unit samba-ad-dc.service is masked.)
Active: failed (Result: exit-code) since Thu 2023-10-26 20:02:51 PDT; 20min ago
Main PID: 12975 (code=exited, status=1/FAILURE)
Status: "daemon failed to start: Samba detected misconfigured 'server role' and exited. Check logs for details"
Oct 26 20:02:51 ubuntu systemd[1]: Starting Samba AD Daemon...
Oct 26 20:02:51 ubuntu systemd[1]: samba-ad-dc.service: Main process exited, code=exited, status=1/FAILURE
Oct 26 20:02:51 ubuntu systemd[1]: samba-ad-dc.service: Failed with result 'exit-code'.
Oct 26 20:02:51 ubuntu systemd[1]: Failed to start Samba AD Daemon.
我试过重启或者其他方法,但都失败了
请问如何解决这个问题?以及如何安装gparted。