How to create a Ubuntu repository server -

This guide will show how to configure a local repository server based on Ubuntu Bionic, but it can be adapted to a previous version of Ubuntu or even to any distribution using Aptitude as the main package management system, like Debian or Mint. You might typically want to setup a local repository to save Internet bandwidth.

This is a companion discussion topic for the original entry at

HI, excellent guide. I’m having trouble with what web page to go to after all is installed. Apache is up and running but I can’t locate what the web address should be to get to the packages that have been downloaded. I’ve tried using the one have (changed the IP of course) but I’m getting a 404 error. Do i need to edit an Apache file?
Thanks in advance.

Hi Pcpaulh,

Welcome to our forums.

If you followed the guide, you only have to change the following in your sources.list:



You can also use DNS name if you have name resolution set up. In this case you don’t need to change the webserver’s configuration. The above changes are only needed on the actual repositories you mirrored.


“In case you don’t have much space on disk you can choose to not mirror src packages”

What are the implications of that? What is the downside?


Another question… The partition my mirror is configured on is full. I have mounted a new partition, but I don’t see a way to configure mirror.list to use both partitions. I am mirroring multiple repositories, and I’d like to “move” one to the new partition. Is that possible?

Hi Adam_Moericke,

Welcome to our forums.

The downside of not mirroring the src packages is that you will not be able to install the sources from your mirror, only the compiled packages that are meant for installation.

About more partitions under the mirror: the simplest way would be to symlink directories from your new partition to paths on the original one, which would hold the repositories you plan to store on the 2nd partition.

Thanks so much for your suggestion, the symlink did the trick!

1 Like


first, thank you very much for the detailed document.

I have fallow the document and created the repo server locally but when I am trying to do security updates, I am not getting any results, Could you please suggest me on this, below are screenshot

I tried to run Unattended-Upgrade But I am not getting the proper result.


Hi Mahesh_Cherukuru,

Welcome to our forums.

You may want to test your local repository with apt which will provide some output by default. Or you could add the -v (verbose) switch to unattended-upgrade to get some output about the upgrade process. From there it is much easier to determine the cause of the issue.

I follow this guide, but could not get the clients to update.
I receive the following message:

E: The repository ‘http:///ubuntu focal Release’ does not have a Release file.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

What is the problem?

Hi Hugo_Lia,

The error message indicates an invalid http URL. The can be no white spaces in an URL, and also there is no host in it (if your repository server doesn’t called “ubuntu”, that is). Most likely your sed command did mess up the client’s soures.list file. Restore it from backup, and double-check you execute the command with the right values. You can also post it here for us to see, if the address is not an Internet-facing one.

Typo in

sudo cp /etc/atp/mirror.list /etc/apt/


1 Like

Thank you. This typo will be updated shortly.