How To Create A Local Debian/Ubuntu Mirror With apt-mirror

Discussion in 'HOWTO-Related Questions' started by cyberalleyguy, Jun 29, 2007.

  1. cyberalleyguy

    cyberalleyguy New Member

    I did the install on a Ubuntu 7.04 amd64 and all works great fro getting the updates but does not work for a new network install. I get an error on the mirror. But if I continue the install using another mirror (us) then I can do the updates via the local mirror. One error I have gotten concerns a Release file.
     
  2. falko

    falko Super Moderator Howtoforge Staff

    So it's working if you use a specific mirror, but not, when you use another one?
     
  3. heymrdj

    heymrdj Member

    I am currently setting up one of these mirrors for the Debian Etch systems on my network.

    What he's saying falko, is that once he has a fulling running Debian system, he can update from his local mirror without any trouble. However if he attempts to use his local mirror to make a new Debian installation, it fails because it sounds like his local mirror is lacking the Release file. If he uses another mirror (an online one) it installs fine, seeing as it can get the Release file. So what he needs to know/do is get the updated Release files on his local mirror like it's getting everything else.

    I too would love to hear an answer on this as well.
     
  4. cyberalleyguy

    cyberalleyguy New Member

    Correct, the mirror works for updates only. It does not work for a new install. I have to us the us.archive.ubuntu/com/ubuntu feisty archive. heymrdj has my problem stated just right.
     
  5. falko

    falko Super Moderator Howtoforge Staff

    I'm not sure why this happens. It worked for me when I wrote the tutorial... :confused:
     
  6. heymrdj

    heymrdj Member

    I'm trying to get it done, but not much luck. Falko, is there a way to make the download resumable? Or a way to use a download manager to download the initial set (with resume capability), then FTP it to my linux server, then just update it as needed. My connection goes on and off, and I can only attain like the first 400MB before the DSL connection disconnects and reconnects.
     
  7. heymrdj

    heymrdj Member

    Haven't had the time to try it yet, but try adding this line to your /etc/apt/mirror.list

    Code:
    deb http://ftp.fi.debian.org/debian sarge main/debian-installer
    That should download the release and other files you need to run a new debian installation.

    Remember to change your distribution to what you have. That code it for sarge, I use etch. Change to your needs.

    By the way cyber, if you use Debian 4.0 etch, I would love to see your ect/apt/mirror.list file to compare it with mine :).
     
    Last edited: Jul 8, 2007
  8. cyberalleyguy

    cyberalleyguy New Member


    I will try and see if a line for the Ubuntu/Feisty Debian-Installer will work.

    Sorry heymrdj, but only Ubuntu 7.04 here. I just used what I already had installed by the install and changed where the file locations are to the local mirror. I did not mirror security and backports.
     
  9. heymrdj

    heymrdj Member

    I think I got it working last night. It's currently downloading the 26.5GB of Debian and Debian sources. I don't know if I'll keep the sources, but I'm getting them for now. I typically ahve to use alot of sources...but I may skip out on them anyways. I'll only need a fewm MB's of them anyways. I'm also downloading the installer package I related to in my last post, so we'll see if that works.

    @falko: Do you think you could edit your howto to include into about the nthreads option. I found out whenever I started it, it would crash my router because it would run 20 threads. I finally figured out how to change that (and remember to actually uncomment that line :eek: ) to get it to one thread that wouldn't crash my router :p.

    Anyways Cyber, I'll let you know how everything comes out. It downloaded 5.2GB last night. So it should be done in 3 more days or so. Let's please keep comparing notes. I'm not a linux guru so this has been really helpful for me :D .

    Oh that reminds me, I wanna mirror fiesty too. Cause I love a fluxbox or KDE fiesty as my XP Desktop replacement. So I am constantly uninstallling/reinstalling and finding that perfect match. Could you send me your code for fiesty? Just so I could start building it into mine the way I need it. Thanks alot :)
     
  10. falko

    falko Super Moderator Howtoforge Staff

    What exactly did you do with the nthreads option?
     
  11. heymrdj

    heymrdj Member

    I uncommented it and changed its value. My current mirror.list:

    Code:
    # apt-mirror configuration file
    
    ##
    ## The default configuration options (uncomment and change to override)
    ##
    #
    # set base_path           /var/spool/apt-mirror
    # set mirror_path  $base_path/mirror
    # set skel_path           $base_path/skel
    # set var_path     $base_path/var
    #
     set defaultarch    i386  
     set nthreads       1
    #
    
    
    ##
    ## Example sources
    ##
    
    # Etch's section
    deb http://debian.lcs.mit.edu/debian etch main contrib non-free
    deb-src http://debian.lcs.mit.edu/debian etch main contrib non-free
    
    deb http://debian.lcs.mit.edu/debian etch main/debian-installer
    
    ##
    ## Cleaner configuration example
    ##
    #
    # set cleanscript $var_path/clean.sh
    #
    
    # Cleaning section
    clean http://security.debian.org/
    clean http://ftp.fi.debian.org/
    
    
    skip-clean http://ftp.fi.debian.org/doc/
    skip-clean http://ftp.fi.debian.org/tools/
    skip-clean http://ftp.fi.debian.org/debian-cd/
    skip-clean http://ftp.fi.debian.org/debian-minicd/
    skip-clean http://ftp.fi.debian.org/debian/dists/sarge/main/installer-i386/
    skip-clean http://ftp.fi.debian.org/debian/dists/sid/main/installer-i386/
    skip-clean http://ftp.fi.debian.org/debian/doc/
    skip-clean http://ftp.fi.debian.org/debian/tools/
    skip-clean http://ftp.fi.debian.org/debian/project/
    skip-clean http://ftp.fi.debian.org/debian-non-US/project/
    
    Only thing special I did was uncomment the architecture and the threads and set the architecture to only download the i386 and only to use one thread. Download size on this config is 26.5GiB. Currently its done 15GB.
     
    Last edited: Jul 10, 2007
  12. vip32

    vip32 New Member

    has anyone had any joy with this.

    At first I thought i was just something stupid I was doing. but as I can see there more more then just me having this problem.

    i tried making sure the files were correct by manually downloading the release files from the online mirror. I also noticed when I was attempting to do a debootstrap it added the "ftp." in front of the DNS name so I also added this to the DNS enteries but still no joy. I think I will try and set the system up over FTP instead of HTTP and see if they will help the situation any.

    if i get any further I will let you know. other wise if anyone else has any solutions it would be grate
     
  13. vip32

    vip32 New Member

    GOT IT. I think.

    I was on the right track the last time.

    I got to install over my network but it seems although you need a DNS name for it and it needs to start with "ftp.". My last attempt failed as I forgot to add the ServerAlias on the apache server to accept the "ftp." DNS name. but that was just me being forgetfully

    The server on my LAN that hosts the mirror is debian.vip32.net and that was what I was attempting to use before but once I corrected the Apache config to point in the correct place when I typed in ftp.debian.vip32.net on a setup on a virtual machine on a different system it worked.

    If this doesn't work for anyone else I don't know what I have done. I will need to test this on more systems to be totally sure it works fine. I have it working under Debian Etch

    Vip32
     
  14. oblivian

    oblivian New Member

    Hi,

    Just a short question... Can I mirror more than one Ubuntu distro? I.e. Hardy and Gutsy? And i386 and AMD64, etc?

    Please advice,

    Obi
     
  15. heymrdj

    heymrdj Member

    Yes you can mirror multiple distros.

    Look in my above post where I have placed #Etch's Section. These are distro zones. You can just as easily put in all the zones you want. I used to have #Sarge's Section, #etches section, and #hardy's section running on mine. Just make a commented line with whatever name you want to identify the distro with, then place it's links below it.

    As for multiple archs, I know that if you leave defaultarch commented it will download all the arch's. Maybe if you place them in there separated by commas you would have good luck with that? I don't have any way to try it currently or I would for you.

    Good luck. :D
     
  16. vip32

    vip32 New Member

    If you are looking to mirror just i386 and AMD64 as I have done myself, the way I have around this was under defaultarch I put it as i386 so it doesn't get any confusion then the download section you put
    Code:
    #Debian Etch
    
    deb [url]http://ftp.debian.org/debian[/url] etch main contrib non-free     #i386 packages
    deb-amd64 [url]http://ftp.debian.org/debian[/url] etch main contrib non-free     # AMD64 packages
    deb-src [url]http://ftp.debian.org/debian[/url] etch main contrib non-free     #source packages
    
    you will notice that if you have already downloaded all the i386 files you will most likely have a lot less for the AMD64 packages, I assume this is a lot of the i386 packages are used in the AMD64 install also

    hope this helps

    vip32
     
    Last edited: Oct 3, 2008
  17. bkbarros

    bkbarros New Member

    In my case, I mirrored the three last versions of ubuntu.
    apt-mirror has created the pool but did not create the folder /dists... so my local computers are unable to pull from the mirror in sources.list.
    what i did wrong? and how fix that?

    Thanks..and sorry my "google english"!
     

Share This Page