Alcaraz, who took charge of the team in April following the resignation of Georges Leekens in February, was the fourth permanent coach to take charge in 13 months.
Madjer, 58, becomes the country’s fifth national coach in three years after their failure to qualify for the 2018 World Cup last month.
Madjer’s is appointed to take the team to the 2019 Cup of Nations in Cameroon, with their next qualifier due to be against the Gambia in March.
The former Porto star became Algeria’s coach for the first time in 1993 and had a two-year spell. He was named again as their coach in 2001-2002.
Madjer has also managed three Qatari teams Al Sadd, El Wakrah and El Rayyan throughout his coaching career.
As a player, Madjer won the European Cup in 1987 when his cheeky backheel helped FC Porto beat Bayern Munich. He was crowned Africa’s best player for that year.