{"id":22,"date":"2010-07-18T01:33:17","date_gmt":"2010-07-17T20:03:17","guid":{"rendered":"http:\/\/atuljha.com\/blog\/?p=22"},"modified":"2010-07-18T19:44:24","modified_gmt":"2010-07-18T14:14:24","slug":"setting-up-local-ubuntujaunty-repository-via-apt-mirror","status":"publish","type":"post","link":"https:\/\/atuljha.com\/blog\/2010\/07\/18\/setting-up-local-ubuntujaunty-repository-via-apt-mirror\/","title":{"rendered":"Setting Up Local Ubuntu(Jaunty) Repository via Apt-Mirror."},"content":{"rendered":"<p>The article mentions the method to deploy APT-MIRROR so that you can use a local repository in your intranet insted going to internet again.<br \/>\nI will use the local repository IP to 192.100.100.40<\/p>\n<p>Packages required:&#8211;<br \/>\n1.Apt-Mirror<br \/>\n2.Apache Webserver (to distribute to whole intranet)<br \/>\nSteps :&#8212;<\/p>\n<p>1.Setting up the apt-mirror<\/p>\n<pre lang=\"bash\">\r\n$sudo apt-get install apt-mirror\r\n$sudo nano  \/etc\/apt\/apt-mirror <---- (the configuration file of apt-cache)\r\n\r\n---------------------------XXXXXXXXXXXXXXXXX--------------------\r\n############# config ##################\r\n#\r\n#set base_path    \/var\/spool\/apt-mirror\r\n# if you change the base path you must create the directories below with\r\nwrite privileges\r\n#\r\n# set mirror_path  $base_path\/mirror\r\n# set skel_path    $base_path\/skel\r\n# set var_path     $base_path\/var\r\n# set cleanscript $var_path\/clean.sh\r\nset defaultarch  <running host architecture>\r\nset nthreads     20\r\nset _tilde 0\r\n#\r\n############# end config ##############\r\ndeb-i386 http:\/\/archive.ubuntu.com\/ubuntu jaunty main restricted\r\nuniverse multiverse\r\ndeb-i386 http:\/\/archive.ubuntu.com\/ubuntu jaunty-updates main restricted\r\nuniverse multiverse\r\ndeb-i386 http:\/\/archive.ubuntu.com\/ubuntu jaunty-backports main\r\nrestricted universe multiverse\r\ndeb-i386 http:\/\/archive.ubuntu.com\/ubuntu jaunty-security main\r\nrestricted universe multiverse\r\ndeb-i386 http:\/\/archive.ubuntu.com\/ubuntu jaunty-proposed main\r\nrestricted universe multiverse\r\nclean http:\/\/archive.ubuntu.com\/ubuntu\r\n-------------------------XXXXXXXXXXXXX----------------------------------------\r\n<\/pre>\n<p>I am creating local repo for Jaunty you can replace it with karmic or hardy incase you want a repo of that Disros. In above configuration file what i have done is my source file for<br \/>\ndownloading whole package is \/var\/spool\/apt-mirror. I wanted the repository for the 32 bit system so i mentioned deb-i386. You can  replace\/add deb-amd64 if you want only 32 bit repo or incase<br \/>\nyou want repo for both architecture.<\/p>\n<p>2.Dumping the packages in local repository.<\/p>\n<pre lang=\"bash\">\r\n$sudo apt-mirror\r\n\r\nYou will see something like this on your screen\/terminal\r\n-------------------------XXXXXXXXX---------------------------------------------\r\nt143@t143-desktop:\/var\/log$ sudo apt-mirror\r\nDownloading 90 index files using 20 threads...\r\nBegin time: Thu Feb 11 16:32:14 2010\r\n[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]...\r\n[11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]...\r\n[1]... [0]...\r\nEnd time: Thu Feb 11 16:32:18 2010\r\nProceed indexes: [PPPPPP]\r\n28.0 GiB will be downloaded into archive.\r\nDownloading 29319 archive files using 20 threads...\r\nBegin time: Thu Feb 11 16:32:26 2010\r\n[20]...\r\n--------------------------XXXXXXXXXX--------------------------------\r\n<\/pre>\n<p>This will take some time as 30 GB downloading takes sometime<\/p>\n<p>3.Clean Up The Local Repo<\/p>\n<pre lang=\"bash\">\r\nt143@t143-desktop:$ sudo \/bin\/bash \/var\/spool\/apt-mirror\/var\/clean.sh\r\nRemoving 157 unnecessary files [13316096 bytes]...\r\n[0%]................done.\r\nRemoving 18 unnecessary directories...\r\n[0%]..................done.\r\n<pre lang=\"bash\">\r\n3.Mirroring it for the intranet\r\nIn case you don not have apache installed\r\n<pre lang=\"bash\">\r\n$sudo apt-get install apache2\r\n<\/pre>\n<p>4.Create A Daily Cron Job<\/p>\n<pre lang=\"bash\">\r\nt143@t143-desktop:\/var\/log$ \/etc\/cron.d\/apt-mirror\r\n\r\n#\r\n# Regular cron jobs for the apt-mirror package\r\n#\r\n0 4     * * *   apt-mirror      \/usr\/bin\/apt-mirror >\r\n\/var\/spool\/apt-mirror\/var\/cron.log\r\n<\/pre>\n<p>This will make apt-mirror run at 4.00  each day, and it will log to<br \/>\n\/var\/spool\/apt-mirror\/var\/cron.log.<\/p>\n<p>5. Local Mirrors Accessible Over HTTP<\/p>\n<p>Once apache installed and running<\/p>\n<pre lang=\"bash\">\r\n$cd \/var\/www\r\n$sudo ln -s \/var\/spool\/apt-mirror ubuntu\r\nNow my repo address over intranet will become :--\r\ndeb http:\/\/192.100.100.40\/ubuntu jaunty main restricted universe\r\nmultiverse\r\ndeb http:\/\/192.100.100.40\/ubuntu jaunty-updates main restricted universe\r\nmultiverse\r\ndeb http:\/\/192.100.100.40\/ubuntu jaunty-backports main restricted\r\nuniverse multiverse\r\ndeb http:\/\/192.100.100.40\/ubuntu jaunty-security main restricted\r\nuniverse multiverse\r\ndeb http:\/\/192.100.100.40\/ubuntu jaunty-proposed main restricted\r\nuniverse multiverse\r\n6.Testing our local repository\r\nlets add this to one of the host computer on intranet\r\n$sudo nano \/etc\/apt\/sources.list\r\nLets add our local repo address inside it\r\n\r\ndeb http:\/\/192.100.100.40\/ubuntu jaunty main restricted universe\r\nmultiverse\r\ndeb http:\/\/192.100.100.40\/ubuntu jaunty-updates main restricted universe\r\nmultiverse\r\ndeb http:\/\/192.100.100.40\/ubuntu jaunty-backports main restricted\r\nuniverse multiverse\r\ndeb http:\/\/192.100.100.40\/ubuntu jaunty-security main restricted\r\nuniverse multiverse\r\ndeb http:\/\/192.100.100.40\/ubuntu jaunty-proposed main restricted\r\nuniverse multiverse\r\n\r\n<\/pre>\n<p>$sudo apt-get update<br \/>\nhere we go we have all the packages coming from our local repository.<br \/>\ncheers!!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The article mentions the method to deploy APT-MIRROR so that you can use a local repository in your intranet insted going to internet again. I will use the local repository IP to 192.100.100.40 Packages required:&#8211; 1.Apt-Mirror 2.Apache Webserver (to distribute to whole intranet) Steps :&#8212; 1.Setting up the apt-mirror $sudo apt-get install apt-mirror $sudo nano &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/atuljha.com\/blog\/2010\/07\/18\/setting-up-local-ubuntujaunty-repository-via-apt-mirror\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Setting Up Local Ubuntu(Jaunty) Repository via Apt-Mirror.&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5],"tags":[206],"_links":{"self":[{"href":"https:\/\/atuljha.com\/blog\/wp-json\/wp\/v2\/posts\/22"}],"collection":[{"href":"https:\/\/atuljha.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atuljha.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atuljha.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atuljha.com\/blog\/wp-json\/wp\/v2\/comments?post=22"}],"version-history":[{"count":8,"href":"https:\/\/atuljha.com\/blog\/wp-json\/wp\/v2\/posts\/22\/revisions"}],"predecessor-version":[{"id":50,"href":"https:\/\/atuljha.com\/blog\/wp-json\/wp\/v2\/posts\/22\/revisions\/50"}],"wp:attachment":[{"href":"https:\/\/atuljha.com\/blog\/wp-json\/wp\/v2\/media?parent=22"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atuljha.com\/blog\/wp-json\/wp\/v2\/categories?post=22"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atuljha.com\/blog\/wp-json\/wp\/v2\/tags?post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}