The Diamondbacks are a major-league worst 63-96 heading into the regular season's final weekend.
Trammell will manage the team this weekend, according to MLB.com's Steve Gilbert.
Gibson, a former MLB outfielder, was promoted from bench coach to manager on July 1, 2010. In his first full season as manager, the Diamondbacks went 94-68 and won the National League West. The team then had two .500 seasons before this year's decline.
Trammell, a former Detroit Tigers shortstop and manager, was named Arizona's bench coach following the 2010 season. Gibson and Trammell were teammates in Detroit and Gibson served as Trammell's bench coach when he managed the Tigers.
"Kirk has done an admirable job under difficult circumstances and we are grateful for his professionalism and his dedicated service to the organization over the past eight years," said Diamondbacks chief baseball officer Tony La Russa. "We feel like it is time for a fresh start and with our recent restructuring in Baseball Operations, we want to get started immediately moving in a new direction.
"We are also appreciative of Alan Trammell for all that he has done for the D-backs and have great respect for what both men have accomplished in the game of baseball."
The Diamondbacks said they will immediately begin their search for a new manager. On Thursday, the team announced it hired former MLB pitcher Dave Stewart as its new general manager.
- Molly Geary