TRENTON, N.J. — Top U.S. drug wholesaler McKesson agreed Wednesday to create an independent board chairman, responding to a Teamsters-led shareholder protest over its role in distributing opioids.

McKesson Corp. is dealing with lawsuits, government investigations and fines for its handling of suspicious opioid orders to U.S. communities. Wholesalers buy drugs from manufacturers and sell them to pharmacies, hospitals and nursing homes.

The company’s move came even though shareholders at Wednesday’s meeting didn’t back the Teamsters’ proposal to split the CEO and board chairman jobs to provide more oversight. The change won’t take effect until after longtime CEO John Hammergren leaves.

The union, a longtime McKesson shareholder, also opposed the company’s executive pay package.

Last January, San Francisco-based McKesson agreed to pay a record $150 million settlement with the Justice Department over allegations it violated the Controlled Substances Act by not reporting frequent or suspiciously large shipments of opioids. That was required under the company’s $13.25 million settlement with the government in 2008 over similar allegations.

The January settlement also required McKesson to stop sales of controlled substances from four warehouses.