Following the French invasion in 1798, Glarus became the capital of the Canton of Linth in the Helvetic Republic. The administration of the Canton moved into Glarus. However, the new administrators had difficulties in establishing and enforcing any new regulations. In August 1802 the administrators of the new Canton left Glarus for Rapperswil due to the difficulties they had faced in Glarus. In 1803, with the Act of Mediation, the Canton of Linth was dissolved and Glarus became the capital of the smaller Canton of Glarus.