Catalyzes the deacetylation of N-acetyl-D-galactosamine 6-phosphate to D-galactosamine 6-phosphate. Can probably also catalyze the deacetylation of N-acetyl-D-glucosamine 6-phosphate to D-glucosamine 6-phosphate. H2O + N-acetyl-D-galactosamine 6-phosphate = acetate + D-galactosamine 6-phosphate Binds 1 divalent metal cation per subunit. Induced by growth on N-acetyl-D-galactosamine but not by growth on N-acetyl-D-glucosamine. AgaA deletion mutant, but not agaA-nagA double mutant, can grow on N-acetyl-D-galactosamine. AgaA deletion mutant is probably able to grow on N-acetyl-D-galactosamine because NagA can substitute for the absence of AgaA. Deletion of agaA does not affect N-acetyl-D-glucosamine utilization. NagA and AgaA can substitute for each other and function in both the N-acetyl-D-glucosamine and N-acetyl-D-galactosamine pathways. Belongs to the metallo-dependent hydrolases superfamily. NagA family.