How can I set up a local package repository?

You can create a scheduled a task (cron job) which uses the setup utility to manage a local package repository. See this article, for the details.