LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   to fix some apt-mirror problem, i wrote scripts (https://www.linuxquestions.org/questions/debian-26/to-fix-some-apt-mirror-problem-i-wrote-scripts-4175609304/)

abd_bela 07-06-2017 08:38 AM

to fix some apt-mirror problem, i wrote scripts
 
1 Attachment(s)
Hi everybody

I create in my local machine a mirror for debian amd64, for my own usage and some collegues.
I seems working correctly, but have problem with some packages. To fix that prblem I wrote scripts, I send them as attached file.


I 've written a bash script and 2 small python files, to fix a problem I found in apt-mirror. I don't know if I don't use correctly apt-mirror.
I give my problem and the script which solve the problem.

before that I don't understand the following error ???:
after : apt-mirror aptMirrordebian this file contain the mirror config

""" BEGIN : aptMirrordebian
set base_path /home/ftp
set mirror_path $base_path
set skel_path $base_path/skel
set var_path $base_path/var
set cleanscript $var_path/clean.sh
set defaultarch amd64
#set postmirror_script $var_path/postmirror.sh
set run_postmirror 0
set nthreads 20
set _tilde 0
############## end config ##############
deb http://ftp.fr.debian.org/debian stable main contrib non-free
""" ENDFILE aptMirrordebian

Use of uninitialized value $config{"options"} in pattern match (m//) at /usr/bin/apt-mirror line 300, <CONFIG> line 17.


The problem: When I run the apt-mirror it gives the size to download to update my local repos

if I run it again it gives the same (or approxiamativl) size to download, so nothing is added to my repos, when I check I found many packages not updated.
Here is the example ( just a part of the output)

--------------BEGIN of USAGE apt-mirror ---------------
5.4 GiB will be downloaded into archive.
Downloading 231 archive files using 20 threads...
Begin time: Thu Jul 6 09:17:29 2017
[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]...
End time: Thu Jul 6 09:20:34 2017

4.5 MiB in 22 files and 0 directories can be freed.

--------------------------------------------

just after that if run a get the same size to download

5.4 GiB will be downloaded into archive.
Downloading 207 archive files using 20 threads...
Begin time: Thu Jul 6 09:36:56 2017
[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]...
End time: Thu Jul 6 09:37:26 2017

4.5 MiB in 22 files and 0 directories can be freed
---------------ENDOF USAGE apt-mirror ---------------

MYSOLUTION: maybe somebody wants to use or improves them
I send in attached file 3 scripts : aptMirrorMod.sh ,
OfficialPackages.py and differences.py
I put them in one file mirror.txt (since upload doesn't accept python extension)
The goal of them scripts is to determine the packages which are different in the local and remote mirror ( the size is different or not installed at all).
It is not necessary to check the checksum since the remote site (official) is supposed correct.



I hope these programs will serve some people

best regrads

AwesomeMachine 07-09-2017 09:34 PM

To make a local mirror, use the script package: ftpsync. https://www.debian.org/mirror/ftpmirror Apt-mirror is to make a mirror of files downloaded by apt-get that are held in the directory: /var/cache/apt/archives.


All times are GMT -5. The time now is 12:06 AM.