Score:2

Ubuntu 20.04 Wont Connect to my Local REPO

sk flag

Iv setup a local REPO where I have downloaded all the packages from Ubuntu.

root@vm-repo-server:~# ifconfig | grep inet
        inet 10.0.0.4  netmask 255.255.255.0  broadcast 10.0.0.255

root@vm-repo-server:/var/www/html/ubuntu/mirror/azure.archive.ubuntu.com/ubuntu/dists/focal# ll
total 40472
drwxr-xr-x 6 root root      146 Jan 24 12:31 ./
drwxr-xr-x 8 root root      123 Jan 24 12:31 ../
-rw-r--r-- 1 root root 40902952 Apr 23  2020 Contents-amd64.gz
-rw-r--r-- 1 root root   264892 Apr 23  2020 InRelease
-rw-r--r-- 1 root root   263289 Apr 23  2020 Release
-rw-r--r-- 1 root root     1554 Apr 23  2020 Release.gpg
drwxr-xr-x 5 root root       51 Jan 24 12:31 main/
drwxr-xr-x 5 root root       51 Jan 24 12:31 multiverse/
drwxr-xr-x 4 root root       38 Jan 24 12:31 restricted/
drwxr-xr-x 5 root root       51 Jan 24 12:31 universe/
root@vm-repo-server:


602.5 GiB will be downloaded into archive.
Downloading 187125 archive files using 20 threads...
Begin time: Mon Jan 24 10:24:22 2022
[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4].                                                                                                           .. [3]... [2]... [1]... [0]...
End time: Mon Jan 24 12:31:12 2022

I have setup two clients one 18.04 and one 20.04. These clients will now download updates from the REPO server

The 18.04 source list /etc/apt/sources.list contains entries:

root@vm-ubuntu18:~# cat /etc/apt/sources.list | grep allow
deb [allow-insecure=yes] http://10.0.0.4/ubuntu/mirror/azure.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb [allow-insecure=yes]  http://10.0.0.4/ubuntu/mirror/azure.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb [allow-insecure=yes] http://10.0.0.4/ubuntu/mirror/azure.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb [allow-insecure=yes]  http://10.0.0.4/ubuntu/mirror/security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
root@vm-ubuntu18:~#

When running the apt update from the 18.04 server it works fine and connects to my REPO.

root@vm-ubuntu18:~# date && apt update
Mon Jan 24 16:13:40 UTC 2022
Hit:1 http://10.0.0.4/ubuntu/mirror/azure.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://10.0.0.4/ubuntu/mirror/azure.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://10.0.0.4/ubuntu/mirror/azure.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:4 http://10.0.0.4/ubuntu/mirror/security.ubuntu.com/ubuntu bionic-security InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
5 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@vm-ubuntu18:~#

When i try to update the 20.04 LTS from the same REPO i get the below error:

Err:4 http://10.0.0.4/ubuntu/mirror/azure.archive.ubuntu.com/ubuntu focal/main amd64 c-n-f Metadata
  404  Not Found [IP: 10.0.0.4 80]
Ign:11 http://10.0.0.4/ubuntu/mirror/azure.archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata
Ign:12 http://10.0.0.4/ubuntu/mirror/azure.archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata
Ign:13 http://10.0.0.4/ubuntu/mirror/azure.archive.ubuntu.com/ubuntu focal/restricted amd64 c-n-f Metadata
Fetched 265 kB in 0s (867 kB/s)
Reading package lists... Done
E: Failed to fetch http://10.0.0.4/ubuntu/mirror/azure.archive.ubuntu.com/ubuntu/dists/focal/main/cnf/Commands-amd64  404  Not Found [IP: 10.0.0.4 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
root@vm-ubuntu20:~#

What should be in the 20.04 source list file to connect to my local REPO with IP 10.0.0.4 and download the packages without errors ?

Thanks

Score:1
us flag

I ran into this problem when I recently upgraded all my systems from 18.04 to 20.04, including my local mirror.

The problem is with "command not found" files which apparently didn't exist in 18.04 or at least worked differently. I had to add these lines to the script that runs after the mirror downloads to unzip the files.

unxz -fk /[mirror location]/us.archive.ubuntu.com/ubuntu/dists/focal-security/main/cnf/Commands-amd64.xz
unxz -fk /[mirror location]/us.archive.ubuntu.com/ubuntu/dists/focal-security/multiverse/cnf/Commands-amd64.xz
unxz -fk /[mirror location]/us.archive.ubuntu.com/ubuntu/dists/focal-security/restricted/cnf/Commands-amd64.xz
unxz -fk /[mirror location]/us.archive.ubuntu.com/ubuntu/dists/focal-security/universe/cnf/Commands-amd64.xz
#
unxz -fk /[mirror location]/us.archive.ubuntu.com/ubuntu/dists/focal-updates/main/cnf/Commands-amd64.xz
unxz -fk /[mirror location]/us.archive.ubuntu.com/ubuntu/dists/focal-updates/multiverse/cnf/Commands-amd64.xz
unxz -fk /[mirror location]/us.archive.ubuntu.com/ubuntu/dists/focal-updates/restricted/cnf/Commands-amd64.xz
unxz -fk /[mirror location]/us.archive.ubuntu.com/ubuntu/dists/focal-updates/universe/cnf/Commands-amd64.xz

I may have manually unzipped the files for the base distribution, I can't remember. Probably I did but didn't put commands for that in the script, since those files don't change. So that was a one time thing.

I use apt-mirror which sadly is unmaintained and required some other tweaking to get it to work with 20.04 as well - but it seems you don't use that. So what I did may not work for you exactly, but bottom line, you need to extract those c-n-f files so that the sudo apt update check works properly for the clients.

LinuxRsa avatar
sk flag
Could you help me put the Ubuntu 20.04 file **/etc/apt/sources.list** together ? below are my paths on the main repo server with IP 10.0.0.4. Path :/var/www/html/ubuntu/mirror/azure.archive.ubuntu.com/ubuntu/dists/focal$ ls Contents-amd64.gz InRelease Release Release.gpg main multiverse restricted universe azureuser@vm-repo-server:` Path:/var/www/html/ubuntu/mirror/security.ubuntu.com/ubuntu/dists/focal-security$ ls Contents-amd64.gz InRelease Release Release.gpg main multiverse restricted universe azureuser@vm-repo-server:` What would the entry look like ?
Organic Marble avatar
us flag
The sources.list doesn't look any different between 18.04 and 20.04. I just have 3 lines like this `deb [mirror path]/us.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse` One for focal, one for focal-updates, and one for focal-security.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.