LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-29-2012, 02:00 AM   #1
depam
Member
 
Registered: Sep 2005
Posts: 855

Rep: Reputation: 30
creating your own mirror for debian repo


I want to have my own mirror so I can install packages offline and not connecting to the internet. Is there an easier way to do this? Thanks.
 
Old 12-29-2012, 03:58 AM   #2
k3lt01
Senior Member
 
Registered: Feb 2011
Location: Australia
Distribution: Debian Wheezy, Jessie, Sid/Experimental, playing with LFS.
Posts: 2,900

Rep: Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637
Yes there are a few ways to do this.

You can use something like Debmirror as explained in this tutorial written by a friend of mine called BobSongs.

Or you could use one of the tools listed in this Debian wiki article.

I like the Debmirror method and I also have experience using the reprepro method.
 
Old 12-29-2012, 05:07 AM   #3
k3lt01
Senior Member
 
Registered: Feb 2011
Location: Australia
Distribution: Debian Wheezy, Jessie, Sid/Experimental, playing with LFS.
Posts: 2,900

Rep: Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637
If you use the debmirror method all you need to install at first is debmirror so

Code:
apt-get install debmirror
Then create a location for your, rather, large download to go into. When you have done that open a terminal, cd into your new folder (if you don't cd into it you could very well over-write your entire /home folder so be very careful, and put this command in
Code:
debmirror --nosource -m --passive --host=ftp.debian.org --root=debian/ --method=http --progress --dist=squeeze,squeeze-updates,squeeze-proposed-updates, --section=main,contrib,non-free --arch=amd64 ~/DebianRepos --ignore-missing-release --ignore-release-gpg --diff-none
A couple of things to note, this downloads from the main Debian server, it may well be faster for you to download from your countries server so where we have
Code:
ftp.debian.org
replace that with
Code:
ftp.your country code.debian.org
mine is
Code:
ftp.au.debian.org
Next the dists is simply for squeeze and all that will download with this simple command above.

If you want security updates you will need to change the script to
Code:
debmirror --nosource -m --passive --host=security.debian.org --root=/ --method=http --progress --dist=squeeze/updates --section=main,contrib,non-free --arch=amd64 ~/DebianSecurity --ignore-missing-release --ignore-release-gpg --diff=none
Next the architectures you want can easily be chosen simply by adjusting
Code:
--arch=amd64
to
Code:
--arch=amd64,i386
If you want to download the source files remove
Code:
--nosource
from the code.

I would suggest you read the thread linked to above, or at least the first post, and take note of the section called "Pointing apt locally". Also read the man page for debmirror. I would suggest you also install the package dwww because that is the debian documentation browser and you can read all man, and other, pages that are on your PC in that.

When you are happy with the code you choose to use save it to a txt file in the folder you created, make it executable, and when you need to update your repository just click on it and it will start working for you. Oh and if you have more than one script make sure you change the name of the download folder in the script otherwise you will over-write the contents in that folder with new contents and it will delete things it does not find in the repository lists. Soooooooooo, make sure your security folder is named differently and shown as different in your script.

Last but not least you can also have squeeze,wheezy,Sid,experimental (or stable,testing,unstable,experimental) listed in the same script but it will make the download much bigger and more complicated.

Last edited by k3lt01; 12-29-2012 at 05:16 AM.
 
  


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
Yum repo change results in mirror path errors yoda987 Linux - Newbie 3 03-24-2011 05:07 PM
Setting up local YUM repo - rhel4 mirror? jaredk51 Linux - Enterprise 1 02-19-2010 04:49 PM
[SOLVED] How much Disk space is needed to setup a local repo mirror? worm5252 Linux - Newbie 3 01-31-2010 08:51 PM
LXer: How To Create A Local Debian/Ubuntu Mirror With apt-mirror LXer Syndicated Linux News 0 01-04-2007 06:33 PM
adding mirror to yum.repo.d/<any-repo> ashwin_cse Fedora 1 03-10-2005 04:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:22 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
Open Source Consulting | Domain Registration