Pope John Paul II came to this former Solidarity union stronghold today with an appeal for national accord, saying the future of Poland depends on the regaining of "mutual trust."

To a cheering crowd, officially estimated at nearly 1 million, the pontiff proclaimed that Poland has "many people, a great many people, who hunger and thirst for righteousness" and said these feelings could not be destroyed, suppressed or ignored.

Although delivering a homily ostensibly about family values and Christian morality, John Paul II showed again, as he has throughout his week-long visit, that by accenting certain general concepts, such as truth, homeland and solidarity, he can evoke powerful associations and produce an enormously popular response in Poland.

"The whole Polish nation must live in mutual trust, and this trust is based on truth," said the pope, his voice rising on top of a swell of applause from an audience. "Indeed, it the nation must regain this trust in the widest circle of its social existence. This is a most fundamental problem. I will not hesitate to say that precisely on this--first and foremost on this--the future of our homeland depends."

The Polish government has by and large reserved comment on what the pope has been preaching, presumably waiting until the pontiff departs before mounting any major counterpropaganda campaign. But, in perhaps a first sign of the Warsaw regime's ideological counteroffensive against the pope, an interview with Deputy Premier Mieczyslaw Rakowski was published in major Polish papers today.

Without naming John Paul II, the interview appeared to be an indirect attack on the pontiff's statements Saturday that Poland's youth is going through suffering and difficulty, lacks prospects for the future and feels a sense of injustice. Rakowski said: "Unrighteous is a teacher who, while teaching the youth patriotic and social attitudes, supports the lament about 'the lack of prospectives' for the young generation of Poles."

In other developments today, a spokesman for Lech Walesa said that the former Solidarity chairman has received permission to take a formal leave of absence this week from his job in Gdansk's Lenin Shipyard and expects to see the pope in Krakow on Thursday, a day that John Paul II has reserved for private meetings.

In this industrial city, scene of major pro-Solidarity rallies during the past year, the pope cautiously avoided explicit mention of the now-outlawed independent trade union but dropped the word solidarity into his remarks twice, drawing enthusiastic ovations.

"To all of you who carry out the creator's command, 'subdue the earth,' I bring my solidarity and that of the church," the pope said. At another point he defined the Polish spirit as stemming from three sources: from "a sense of dignity for human work, from love of homeland, and from solidarity, that is to say from a sense of the common good."

Making no effort this time to choke off applause from a crowd, which seemed to be keeping well in line, the pope paid tribute to "all those who have lost their lives in the events of recent years"--a reference to those killed in antistate demonstrations.

The pontiff flew by helicopter from the Wroclaw racetrack, where the morning mass took place, to the city's cathedral. A papal motorcade through the city, which the church initially had asked for, was rejected by Communist officials, who claimed not to have enough police to ensure security on the proposed seven-mile route.

A group of several hundred persons toting Solidarity signs tried to march from the racetrack to the cathedral early this afternoon. They were dispersed by a charging unit of helmeted police backed up by a water cannon near the Hotel Wroclaw, where many reporters were staying.

As police jumped from their vehicles, people watching from apartment windows above shouted, "Gestapo, Gestapo" and whistled derisively. Later the city appeared calm.

In Washington, Metromedia News announced that a three-man television film crew was detained by Polish authorities in Wroclaw today while photographing street scenes. Police apparently confiscated the videotape cassette the crew was using, the network said. Metromedia News identified the three as Barry Cunningham, senior correspondent based in London, cameraman Graham Tawse, a Briton, also based in London and a third member, whom the network only identified as Mr. Bolton, also a British national.

Later, stopping on the panoramic crest of St. Anna's Mountain, site of an ill-fated 1921 Silesian uprising against the Germans, the pope called on several hundred thousand pilgrims there to seek reconciliation not only with God but also "with people, near and far, present in this land and outside it."

The reference to people outside Poland was taken to mean West Germans, relations with whom constituted a central theme of the pope's homilies today.

The government had sought to present the pontiff's visit to Wroclaw--formerly Breslau--as a stamp of papal approval for Poland's post-World War II western frontier along the Oder and Neisse rivers.

Since early this year, Polish authorities have orchestrated a rise in anti-German propaganda based on statements from the right wing of West German Chancellor Helmut Kohl's coalition questioning the permanence of the Polish-German border. The Bonn government has not endorsed those remarks.

John Paul II confirmed the return of Silesia to Poland after nearly seven centuries, but also appealed for "mutual understanding and reconciliation" between Germany and Poland. He underscored a sense of unity between the two once-warring enemies by recalling St. Hedwig, the Bavarian princess who married the Polish Duke Henry the Bearded at the start of the 13th century.

Wroclaw Archbishop Henryk Gulbinowicz, one of Poland's most outspoken ranking church officials, publicly praised the pope for championing human rights, which, he said, had "so often been violated or brutally neglected."