A relatively unknown officer was named tonight to head the KGB, the Soviet secret police, replacing Politburo member Yuri Andropov, who was elected Monday to the secretariat of the Communist Party's Central Committee.

The government news agency Tass announced appointment of Vitaly Fedorchuk, 64, in a two-paragraph dispatch. He has served the Committee for State Security (KGB from Russian initials) for 43 years.

Appointment of a nonpolitical figure to the KGB chairmanship underscored the impression here that Andropov, 67, has emerged as a possible successor to Soviet President Leonid Brezhnev.

Andropov's departure from the KGB post had been regarded by Soviet and Western observers here as a necessary move to establish a new image and enhance his political prospects. Although his background was that of a political worker, diplomat and Central Committee secretary, his 15-year tenture as the head of the much-feared organization had been regarded as a serious drawback in any future succession.

Fedorchuk, who holds the rank of colonel general, has been the chief of the KGB in the Ukraine. He is not a member of the Central Committee nor is he widely known here.

His appointment was a surprise since it was rumored here that Andropov would be replaced by a middle-level political figure. Frequently mentioned was Gaidar Aliyev, a career KGB officer who branched into politics to become the Communist Party chief of Soviet Azerbaijan.

There is little information about Fedorchuk. What is available on public record shows that he was born in the Ukraine, served in unspecified positions within the KGB until 1970 and was appointed then to head the organization in the native republic.

The only immediately available article written by Fedorchuk was published in an ideological journal last winter. He discussed alleged U.S. subversive activities against the Soviet Union and its allies and cited Poland as an arena chosen for subversion.

Fedorchuk also issued an apparent warning against nationalist sentiments in the Ukraine. He criticized "morally corrupt" Soviet citizens who were "infected by nationalist prejudices and religious intoxicants."

The departure of Andropov from the KGB chairmanship was preceded by the death earlier this year of Semyon Tsvigun, the number two man in the organization and a career officer. Tsvigun was replaced by two Army generals, Georgy Tsinev, 74, and Viktor Chebrikov, 59.