Justin Bieber is desperate to beat One Direction on the charts this week and is taking drastic measures — from behind-the-scenes boosts of album sales to making a serious effort to put his arrogant, bratty days behind him.

Sources say his team’s found ways to pump album sales including bundling his new release, “Purpose,” with tickets to two Staples Center shows last week — “That would be nearly another 40,000 albums [sold] right there,” said a source. He’s also partnered with ride-hailing app Lyft to give riders a download of his album for $5 through a “buy and ride” button. “Those will also go toward the charts,” a source said.

Bieber and One Direction both released new albums on Friday.

But perhaps the Biebs’ most audacious move, insiders say, is putting an end to his days of getting arrested and having public meltdowns.

“He’s a 21-year-old who is coming into a period of real artistic growth,” said a source close to Bieber. “He talks about dealing with dark times and all that he’s been through on the record. He’s trying to be as candid as possible with people.”

His antics have caused celebrities from Bette Midler to Seth Rogen to ridicule him, and former cast members on “SNL” to openly dub him the worst guest to appear on the show. But Rogen and Bieber publicly ended their beef this week on “The Ellen DeGeneres Show.” And an “SNL” source told us he’s still “a friend of the show.”

“That was a totally different time in his life,” a source said. “He’s done a lot of growing and maturing. He made some missteps on a personal level, but he’s been addressing it with the media and his fans.”

He’s instead channeling his energy into “Purpose,” and is appearing this week on “The Tonight Show” and “Today” — in a Matt Lauer interview and live performance — at the same time he’s under tremendous pressure to beat One Direction.

Even uber-cool Brit rock mag NME said of Bieber’s new release, “It’s not quite redemption — only time will tell if he’ll curb the recklessness — but it’s certainly a start at reinvention.”

On Saturday night, Bieber performed for an hour at Up&Down, and then at 1Oak, where he sang another five songs. He also treated fans to a round of drinks.