One thing to check pointed out by mrkumar on this thread:

You don't need to use putty or ssh, regular vi or nano will do from a terminal session but the groupid's were wrong on my ootb nethunter install if anyone else is experiencing the same issue:

Using putty connect to Nethunter and Run
vi /etc/passwd,
Change the line
_apt:x:104:3004::/nonexistent:/bin/false to _apt:x:0:65534::/nonexistent:/bin/false
Save and Run apt-get update ,It Works Check it ,
Explanation: Changing GID 3004 to 65534 ,What is GID 3004 on your system?
The fact that the _apt user is part of "nogroup" is actually the problem.