Situation

When Use apt As root User, Get

root@truenas[~]#
root@truenas[~]#
root@truenas[~]# whoami
root
root@truenas[~]# apt update
zsh: permission denied: apt

Solution

root@truenas[~]# chmod +x /bin/apt*
root@truenas:~# apt-get update
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://deb.debian.org/debian bullseye/main Sources [8627 kB]
Get:3 http://deb.debian.org/debian bullseye/main amd64 Packages [8182 kB]
Get:4 http://deb.debian.org/debian bullseye/main Translation-en [6241 kB]
Fetched 23.1 MB in 5s (4973 kB/s)
Reading package lists... Done

Attentions

Do not use "apt/apt-get upgrade"