Jump to content

create your own apt-get repository

Recommended Posts

I got a request in #fedora on how do you create your own apt-get mirror. Well its actually very easy. This will just go over how to do the updates branch for fedora core1. I also use rsync since almost every offical mirror secrectly runs an rsync server. I use this so I can keep my 120+ servers here at work updated without using all the bandwidth during updates.I can download an update once then its on the lan and updates are quick.


This is my mirror.sh script i run in crontab nightly.


cd /mirror/apt/fedora/RPMS.updates/
rsync -az --delete  --exclude=*src.rpm rsync://mirror.hiwaay.net/fedora-linux-core-updates/1/i386/*.rpm ./
genbasedir --bloat --bz2only /mirror/apt/fedora updates


so i cd into the directory i want to store all the updates. You'll notice its called RPMS.updates this is just how apt works. If you look at your sources.list you'll see an entry like this


rpm http://ayo.freshrpms.net redhat/9/i386 os updates


so the os means RPMS.os and updates is RPM.updates


you can name them whatever you want.


Then the genbasedir is creating what is on the server so apt knows the the server has for it to download and such.


From there you can link it to your ftp or web site. Like mine is at http://www.domain.com/mirror/apt/fedora


so i have a symlink that looks like /var/www/html/apt -> /mirror/apt/


then my sources file looks like


rpm http://www.domain.com mirror/apt/fedora os updates


as you can see i also did the os. So I made a RPMS.os and ran the genbasedir on that. You only need to do that once. Those are the rpms off the normal fedora core 1 cds

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...