Issue when installing openssh

I have some issue when installing openssh, here’s the log.

somehow there’s no ucf folder in /usr/bin, any solution pls?

APT install for: openssh-client

- Command: apt-get -y --allow-change-held-packages install openssh-client

- Exit code: 100

DietPi version: v8.11.2 (MichaIng/master) | HW_MODEL: 3 | HW_ARCH: 3 | DISTRO: 6

- Image creator: DietPi Core Team

- Pre-image: from scratch

- Error log: Reading package lists...

Building dependency tree...

Reading state information...

openssh-client is already the newest version (1:8.4p1-5+deb11u1).

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

1 not fully installed or removed.

After this operation, 0 B of additional disk space will be used.

Setting up openssh-server (1:8.4p1-5+deb11u1) ...^M

/usr/bin/ucf: 444: [: missing ]^M

grep: ]: No such file or directory^M

dpkg: error processing package openssh-server (--configure):^M

installed openssh-server package post-installation script subprocess returned error exit status 1^M

Errors were encountered while processing:^M

openssh-server^M

E: Sub-process /usr/bin/dpkg returned an error code (1)

Try to install it
sudo apt install ucf

thank you for reply, but ucf seems installed already

sudo apt install ucf
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
ucf is already the newest version (3.0043).
ucf set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up openssh-server (1:8.4p1-5+deb11u1) ...
/usr/bin/ucf: 444: [: missing ]
grep: ]: No such file or directory
dpkg: error processing package openssh-server (--configure):
installed openssh-server package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
openssh-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

not working for me :cold_sweat:

apt reinstall ucf
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 74.0 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 https://deb.debian.org/debian bullseye/main arm64 ucf all 3.0043 [74.0 kB]
Fetched 74.0 kB in 1s (123 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 48536 files and directories currently installed.)
Preparing to unpack .../archives/ucf_3.0043_all.deb ...
Unpacking ucf (3.0043) over (3.0043) ...
Setting up ucf (3.0043) ...
Setting up openssh-server (1:8.4p1-5+deb11u1) ...
/usr/bin/ucf: 444: [: missing ]
grep: ]: No such file or directory
dpkg: error processing package openssh-server (--configure):
installed openssh-server package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
openssh-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Try to purge hanging opnenssh server package first

apt purge openssh-server

sed -n '440,450p' /usr/bin/ucf
What’s the output?