Let the packages with 12 donuts be x and let the ones with 6 donuts be y.
In that case, we can say that y + 2 = x because there are two more 12 donut packages than there are 6 donut packages.
We can also say that 12 x + 6y = 114 because the total number of donuts is made up of the number of 12 packs (x) times 12 (donuts per pack) plus the number of 6 packs (y) times 6.
So now we subsititute the first equation into the second
12 (y + 2) + 6y = 114
12y + 24 + 6y = 114
18 y = 90
y = 5
So there are 5 packages of 6 donuts. This means there must be 7 packages with 12 donuts.