The quick answer is that you don't. TrueNAS is designed as an appliance, so you should generally be interfacing with it using the webui. Installing other programs is generally unsupported, and could potentially compromise the stability or security of the system.
Furthermore, apt is not the package manager for FreeBSD (which underlies the TrueNAS system). Which implies that you are following some kind of guide to do something which is for a Debian-based system.
All together, I'd strongly recommend that you not proceed with whatever you are trying to do until you have a deeper understanding of what consequences you may be creating for your system.