Teacher: it means to learn from a teacher.
barbarians: barbarians. At that time, the Qing Dynasty considered itself a great power in China and called western countries barbarians.
Long skill: refers to their specialty, that is, the advanced industries, weapons and so on of western powers.
system: control, deal with, restrict and so on.
So the whole sentence probably means learning to manufacture and use foreigners' advanced technology (weapons) to combat and restrict foreigners.
This sentence comes from the "Atlas of the Sea" written by Wei Yuan. Wei Yuan put forward this famous saying about how to resist foreign aggression and effectively attack the invaders: "Learn from foreigners' skills to control them".
This is the representative slogan of learning utensils from the West in the late Qing Dynasty.