Heelpbook.altervista.org



Date: 03/07/2013Procedure: Create your own Ubuntu or Linux local repository and publish it to your usersSource: LINKPermalink: LINKCreated by: HeelpBook StaffDocument Version: 1.0-684564-678009Create your own Ubuntu or Linux local repository and publish it to your usersThere are several reasons you may want to create a local repository.? The first is that you want to save on bandwidth if you have multiple?Ubuntu?machines to update.For example if you had?25 Ubuntu machines?that all needed updating at least once a week, you would?significantly save bandwidth because you could do all but the repository locally.? Most? organizations have decent bandwidth for their network gateways but this bandwidth is a precious commodity that needs to be used wisely.Many organizations still have routers with?10MB?(Ethernet) or?100MB?(Fast-Ethernet) limits at the?gatewaybut?1 GB?(Gigabit) network connections internally so bandwidth could be better used internally.?The second reason for creating your own repository is that you can?control what applications are loaded on your internal Ubuntu machines.You can remove any applications your organization does not want to use on the local network from the repository that updates the machines.?Even better, you can create a test box and test applications and versions before you allow them to roll out into your network assuring security and stability.apt-get install apt-mirror/etc/apt/mirror.list############# config #################### set base_path??? /var/spool/apt-mirror## if you change the base path you must create the directories below with write privileges## set mirror_path? $base_path/mirror# set skel_path??? $base_path/skel# set var_path???? $base_path/var# set cleanscript $var_path/clean.sh# set defaultarch? <running host architecture># set postmirror_script $var_path/postmirror.shset run_postmirror 0set nthreads???? 20set _tilde 0############## end config ##############deb karmic main restricted universe multiversedeb karmic-security main restricted universe multiversedeb karmic-updates main restricted universe multiverse#deb karmic-proposed main restricted universe multiverse#deb karmic-backports main restricted universe multiversedeb-src karmic main restricted universe multiversedeb-src karmic-security main restricted universe multiversedeb-src karmic-updates main restricted universe multiverse#deb-src karmic-proposed main restricted universe multiverse#deb-src karmic-backports main restricted universe multiverseclean in apt-mirrorThe main configuration file is /etc/apt/mirror.list which contains a list of files that you should be aware of in case you have any issues./etc/cron.d/apt-mirrorThis is the? cron configuration template which you can modify.? The example which is not active as it is commented out, starts a?cron job at 4 AM each day?and sends the activity into the log as listed.? Some administrators may want to only update once a week and others will prefer twice a day to be up to date.<## Regular cron jobs for the apt-mirror package##0 4??? * * *?? apt-mirror????? /usr/bin/apt-mirror > /var/spool/apt-mirror/var/cron.log/var/spool/apt-mirror/mirrorThis is the location of the mirrors that you create.? Be aware, that the?/var?directory can fill up and these mirrors will take?15-20 GB?each so verify you have the space to set them up./var/spool/apt-mirror/skelThe location for the indexes which will list the applications that are available./var/spool/apt-mirror/varThe log files, MD5 sums, URLS and clean.sh are placed here as you can see below.ALL???????????? archive-log.15? archive-log.5??? archive-urls.11? archive-urls.19? archive-urls.9? index-log.6?? MD5archive-log.0?? archive-log.16? archive-log.6??? archive-urls.12? archive-urls.2?? clean.sh??????? index-urls.0? NEWarchive-log.1?? archive-log.17? archive-log.7??? archive-urls.13? archive-urls.3?? index-log.0???? index-urls.1? postmirror.sharchive-log.10? archive-log.18? archive-log.8??? archive-urls.14? archive-urls.4?? index-log.1???? index-urls.2archive-log.11? archive-log.19? archive-log.9??? archive-urls.15? archive-urls.5?? index-log.2???? index-urls.3archive-log.12? archive-log.2?? archive-urls.0?? archive-urls.16? archive-urls.6?? index-log.3???? index-urls.4archive-log.13? archive-log.3?? archive-urls.1?? archive-urls.17? archive-urls.7?? index-log.4???? index-urls.5archive-log.14? archive-log.4?? archive-urls.10? archive-urls.18? archive-urls.8?? index-log.5???? index-urls.6Download RepositoriesOnce you have your set up apt-mirror you can start your download of the repository with this command.apt-mirror /etc/apt/mirror.listDownloading 7 index files using 7 threads…Begin time: Tue Jan 19 20:21:07 2010[7]… [6]… [5]… [4]… [3]… [2]… [1]… [0]…End time: Tue Jan 19 20:23:17 2010Proceed indexes: [P]6.6 GiB will be downloaded into archive.Downloading 6612 archive files using 20 threads…Begin time: Tue Jan 19 20:23:19 2010The?apt-mirror?provides multithreaded downloads and allows for multiple architectures for your repositories. As the download progresses you will see applications saved and space being used.ls mirror/archive.ubuntu/pool/main/a? b? d? f? g? h? k? l? libc? libm? libx? m? o? p? r? t? uLink Repository to Web InterfaceBecause apt-mirror saves everything in /var/spool/apt-mirror you need to create a link to make it available to users as the /var/spool is not available to the public. The first link created provides a link to the Packages.gz which lists the available packages in the repository.? This is the line you will place in the /etc/apt/sources.list for the client to access this list.sudo ln -s /var/spool/apt-mirror/skel/archive.ubuntu/ /var/www/ubuntuThe additional symlinks provide access to the public to individual applications to download.? Of course the symlinks are representative of the repositories you will use.sudo ln -s /var/spool/apt-mirror/mirror/archive. /var/www/archive-ubuntusudo ln -s /var/spool/apt-mirror/mirror/archive. /var/www/archive-canonicalsudo ln -s /var/spool/apt-mirror/mirror/security. /var/www/security-ubuntuLock File ProblemThere is a bug in apt-mirror so that it runs fine the first time but then it does not remove the lock file so it will not run the second time, telling you it is already running.? If you see that remove the lock file and it will work fine.sudo rm /var/spool/apt-mirror/var/apt-mirror.lockClient Set Up for aptYou will need to modify the?/etc/apt/sources.list?file in order to have the client connect only to your local repository.deb karmic mainNote that the example above has only the main repository installed so as to provide an evaluation of the set up.? Remember, this takes a lot of space for these repositories. Now you can update and then use?apt-get?to install programs.sudo apt-get updateGet:1 karmic Release.gpg [189B]Ign karmic/main Translation-en_USGet:2 karmic Release [65.9kB]Get:3 karmic/main Packages [1,353kB]Fetched 1,419kB in 1s (1,322kB/s)Reading package lists… DoneHere is an example of a website address set up for a local repository. your own Ubuntu or Linux local repository and publish it to your usersIf you want to download manual individual packages you can use this URL (obviously your local URL): your own Ubuntu or Linux local repository and publish it to your users ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download