MOSCOW (AP) _ Adm. Sergei Gorshkov, who commanded the Soviet navy for nearly 30 years and turned it into a global nuclear force, has been replaced, it was announced today.

Gorshkov's retirement was announced indirectly when the Defense Ministry newspaper Red Star carried a brief story saying that Adm. Vladimir N. Chernavin had left for Tunisia on an official visit and identified him as navy commander in chief.

Chernavin, 57, was one of Gorshkov's two deputies and formerly headed the Soviet navy's northern fleet. Gorshkov is 75.

Western military attaches in Moscow said the Soviet navy does not actually ''retire'' its personnel, and that Gorshkov probably would continue to be listed as a member of navy.

The Defense Ministry would not comment. A spokesman said by telephone that the information in the ministry newspaper was true, but declined further comment.

Military attaches said they had inquired about the newspaper story and were also told that Chernavin is the new head of the Soviet navy.

Gorshkov is considered the father of the Soviet nuclear submarine fleet. He was appointed by Nikita S. Khrushchev in 1956 to rebuild the navy, which at that time was kept close to home shores.

Gorshkov transformed it into a blue water navy of submarines and sleek warships and advocated using it as an instrument of global strategy.

Chernavin has been chief of the main naval staff and first deputy commander of the navy. He became a fleet admiral, equivalent to a four-star admiral, in November 1983.

He is a 38-year veteran of the navy and has been a member of the communist party since 1947.