不知道为什么这个账号没有在BUG区回复的权限。。运行官方的脚本没用,把自己的解决方案发出来分享一下。
主要问题
最后有提示以下报错无法修复的。
E: Held packages were changed and -y was used without --allow-change-held-packages.
解决方案
- 先下载官方的脚本到本地。
- 找到最后
apt install -y ./\*.deb 改为 apt install -y ./\*.deb --allow-change-held-packages 。
#!/usr/bin/env
apt update
apt-mark unhold samba samba-common samba-common-bin samba-dsdb-modules samba-libs samba-vfs-modules
apt --fix-broken install
apt-get install -y samba=2:4.17.12+dfsg-0+deb12u1 samba-common=2:4.17.12+dfsg-0+deb12u1 samba-common-bin=2:4.17.12+dfsg-0+deb12u1 samba-libs=2:4.17.12+dfsg-0+deb12u1 samba-dsdb-modules=2:4.17.12+dfsg-0+deb12u1 samba-vfs-modules=2:4.17.12+dfsg-0+deb12u1 python3-samba=2:4.17.12+dfsg-0+deb12u1 libldb2=2:2.6.2+samba4.17.12+dfsg-0+deb12u1 python3-ldb=2:2.6.2+samba4.17.12+dfsg-0+deb12u1 winbind=2:4.17.12+dfsg-0+deb12u1 libwbclient0=2:4.17.12+dfsg-0+deb12u1 libavahi-common-data=0.8-10+deb12u1 libsmbclient=2:4.17.12+dfsg-0+deb12u1 avahi-daemon=0.8-10+deb12u1 avahi-utils=0.8-10+deb12u1 libavahi-core7=0.8-10+deb12u1 libavahi-common3=0.8-10+deb12u1 libavahi-client3=0.8-10+deb12u1 --allow-change-held-packages --allow-downgrades
TMPDIR=$(mktemp -d /tmp/samba-fix-XXXX)
cd "$TMPDIR"
URLS=(
https://static2.fnnas.com/aptfix/sambadeb/libavahi-common-data_0.8-11_deb12u1_amd64.deb
https://static2.fnnas.com/aptfix/sambadeb/libavahi-core7_0.8-11_deb12u1_amd64.deb
https://static2.fnnas.com/aptfix/sambadeb/avahi-daemon_0.8-11_deb12u1_amd64.deb
https://static2.fnnas.com/aptfix/sambadeb/libavahi-client3_0.8-11_deb12u1_amd64.deb
https://static2.fnnas.com/aptfix/sambadeb/avahi-utils_0.8-11_deb12u1_amd64.deb
https://static2.fnnas.com/aptfix/sambadeb/libavahi-common3_0.8-11_deb12u1_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/libnm0_1.42.4-02-deb12u1_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/network-manager_1.42.4-02-deb12u1_amd64-new.deb
http://static2.fnnas.com/aptfix/sambadeb/libldb2_2.6.2-samba4.17.12-dfsg-0-deb12u2_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/ldb-tools_2.6.2-samba4.17.12-dfsg-0-deb12u2_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/libwbclient0_4.17.12-dfsg-0-deb12u2_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/samba-libs_4.17.12-dfsg-0-deb12u2_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/libsmbclient_4.17.12-dfsg-0-deb12u2_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/python3-ldb_2.6.2-samba4.17.12-dfsg-0-deb12u2_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/python3-samba_4.17.12-dfsg-0-deb12u2_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/registry-tools_4.17.12-dfsg-0-deb12u2_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/samba-common_4.17.12-dfsg-0-deb12u2_all.deb
http://static2.fnnas.com/aptfix/sambadeb/samba-common-bin_4.17.12-dfsg-0-deb12u2_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/samba-dsdb-modules_4.17.12-dfsg-0-deb12u2_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/samba-vfs-modules_4.17.12-dfsg-0-deb12u2_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/samba_4.17.12-dfsg-0-deb12u2_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/winbind_4.17.12-dfsg-0-deb12u2_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/samba-ad-dc_4.17.12-dfsg-0-deb12u2_all.deb
http://static2.fnnas.com/aptfix/sambadeb/libnss-winbind_4.17.12-dfsg-0-deb12u2_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/libpam-winbind_4.17.12-dfsg-0-deb12u2_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/smbclient_4.17.12-dfsg-0-deb12u2_amd64.deb
http://static2.fnnas.com/aptfix/sambadeb/samba-ad-provision_4.17.12-dfsg-0-deb12u2_all.deb
)
for u in "${URLS[@]}"; do
echo "Downloading $u"
wget -c "$u"
done
apt install -y ./*.deb --allow-change-held-packages
apt-mark hold samba samba-common samba-common-bin samba-dsdb-modules samba-libs samba-vfs-modules
rm -rf "$TMPDIR"
sudo -i提权,执行修改后的脚本。
- 正常情况会运行到
Samba配置界面,选择No,修复完成。