CHICAGO -- The Cubs claimed left-handed pitcher Edgar Olmos off waivers from the Orioles on Wednesday and released infielder Brendan Ryan, who was acquired from the Yankees in the Starlin Castro trade. Right-handed pitcher Yoervis Medina also was claimed off waivers by the Pirates.

The Cubs claimed Olmos, 25, for the second time this offseason, this time off the Orioles' roster. The Cubs had claimed him off waivers from the Mariners on Dec. 4, and he was then claimed by the Orioles on Dec. 10. The lefty was 1-0 with a 4.50 ERA in six appearances with the Mariners last season, including two starts. He spent the majority of the season with Triple-A Tacoma, where he went 1-1 with a 3.55 ERA in 20 games.

Medina, 27, was designated for assignment on Dec. 17. He went 1-0 with a 4.71 ERA in 17 relief appearances between the Mariners and Cubs last season.

Ryan, 33, was the player to be named later in the Cubs' deal with the Yankees, which sent Castro to New York for pitcher Adam Warren.

With the moves, Chicago's 40-man roster is at 40.