The cost of living rose at 2% in the year to June, in line with the Bank of England’s target.