In 1818 Ritchie was sent with George Francis Lyon by Sir John Barrow to find the course of the River Niger and the location of Timbuktu. The expedition was underfunded, lacked support and because of the ideas of Barrow departed from Tripoli and thus had to cross the Sahara as part of their journey. A year later, due to much officialdom they had only got as far as Murzuk, the capital of Fezzan, where they both fell ill. Ritchie never recovered and died there.
James Richardson, British traveller in the Sahara and anti-slavery campaigner, mentions in his 'Travels in the Great Desert of Sahara in the Years of 1845 and 1846' (ch XXV) that he visited the grave of Mr Ritchie at Mourzuk. 'Mr Gagliuffi had never visited the grave before my arrival, which I proposed to him as a sacred duty that we owed to our predecessors in African travel and discovery. The Consul promises now to have the grave repaired and whitewashed....If there were a thorough and bona fide Geographical Society in England, this little attention to the memory of that distinguished man of science would have been performed long ago. But our societies are instituted to pay their officers and secretaries, and not to promote the objects for which they are ostensibly supported by the public. The Moorish cemetery close by is a most melancholy, nay, frightfully grotesque picture.'