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.
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.
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.
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?
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.
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.
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.
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.
Thanks for the tutorial but I canāt get it to work. Somebody on another forum pointed out that having the FQDN in the middle of the path wonāt resolve and after spending hours troubleshooting the problem, I believe him.
Hereās the path of the local repository I created: ārepo/ubuntu/mirror/archive.ubuntu.com/ubuntu/ā
I ran your sed commands but that didnāt help. Perhaps I overlooked something. Your assistance will be greatly appreciated!
Having the FQDN in the middle of the path wouldnāt really matter as long as the path is valid and published, and your repository serverās name can be resolved by the clients.
Are you trying to reach your mirror from one of your clients? Can you show us some error messages?
Thanks for the reply I agree with you about the FQDN but just in case, I created a symlink named
ubuntu-archive that hides the FQDN. It doesnāt work on the repository host or clients. Hereās a line from my sources.list file.
deb [arch=amd64 trusted=yes] repo/ubuntu-archive/ focal main restricted
The link resolves to 192.168.46.130/ubuntu/mirror/archive.ubuntu.com/ubuntu/
Here are some of the errors (I left out 85 lines but can include them if you wish). NOTE: one thing
thatās wrong is with one of the files named icons-64x64@2.tar because it doesnāt exist at that location.
I am able to browse the repository and the structure looks correct. And Iām able to pull files with wget.
Ign:85 repo/ubuntu-archive focal-security/main amd64 c-n-f Metadata
Ign:86 repo/ubuntu-archive focal-security/restricted amd64 c-n-f Metadata
Ign:91 repo/ubuntu-archive focal-security/universe DEP-11 64x64@2 Icons
Ign:92 repo/ubuntu-archive focal-security/universe amd64 c-n-f Metadata
Fetched 582 kB in 1s (748 kB/s)
Reading package listsā¦ Done
E: Failed to fetch repo/uubuntu-archive/dists/focal-security/multiverse/binary-amd64/Packages 404 Not Found [IP: 192.168.46.130 80]
E: Failed to fetch repo/ubuntu-archive/dists/focal/main/dep11/icons-64x64@2.tar 404 Not Found [IP: 192.168.46.130 80]
E: Failed to fetch repo/ubuntu-archive/dists/focal-updates/main/dep11/icons-64x64@2.tar 404 Not Found [IP: 192.168.46.130 80]
E: Failed to fetch repo/ubuntu-archive/dists/focal-backports/main/cnf/Commands-amd64 404 Not Found [IP: 192.168.46.130 80]
E: Failed to fetch repo/ubuntu-archive/dists/focal-security/main/dep11/icons-64x64@2.tar 404 Not Found [IP: 192.168.46.130 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.