From local ubuntu mirror, removing all packages of 20.04 only

151 Views Asked by At

I currently have local repo installed using apt-mirror as was described in linuxtechi website. It has deb-amd64 data of 2 versions of Ubuntu, namely, 20.04 and 22.04. Now I would like to support only 22.04 and remove 20.04. Is there a smart way to do this? I do not mind downloading the entire data again, if necessary, but do not wish to do the set up again. And if that isn't possible, what is the best way to recreate the site as I find apt-mirror being a little difficult to maintain (but the current setup seems to be stable now).

I am considering removal of directories dists and pool from /home/ubuntu/mirror/archive.ubuntu.com/ubuntu and the entries corresponding to 20.04 in /etc/apt/mirror.list. This will lead to removal of all mirrored files but the automated download script should get all the necessary data again. Inefficient, but I do not know how to remove only the files of 20.04. There are only a few thousand files with the tag -0ubuntu0.20.04 so file names are not very useful.

Thanks in advance for any feedback and help.

PS: I posted this question on serverfault but received no response in 2 days.

0

There are 0 best solutions below