LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-06-2017, 08:38 AM   #1
abd_bela
Member
 
Registered: Dec 2002
Location: algeria
Distribution: redhat 7.3, debian lenny
Posts: 622

Rep: Reputation: 31
to fix some apt-mirror problem, i wrote scripts


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
Attached Files
File Type: txt mirror.txt (5.3 KB, 50 views)
 
Old 07-09-2017, 09:34 PM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Building a Debian Wheezy/Ubuntu Precise Mirror using apt-mirror bennetfox Linux - Server 16 02-23-2013 03:56 PM
[SOLVED] Problems with Debootstrap and apt-mirror-based Debian mirror lil_drummaboy Debian 3 06-22-2010 06:12 PM
LXer: How To Create A Local Debian/Ubuntu Mirror With apt-mirror LXer Syndicated Linux News 0 01-04-2007 05:33 PM
MIRROR target for tcp attacks......i wrote something like this loboautoma Linux - Security 4 02-19-2005 09:37 AM
rh9 xd2 apt apt-get problem fix and solution transeunt Red Hat 0 12-16-2003 10:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 06:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration