PDA

View Full Version : How to Create Local Repository on Hard Disk



asundaresan
March 15th, 2005, 10:30 PM
Hi,

I have installed ubuntu on a machine that does not have internet access. However I'd like to install and update packages. Is there any way I can download the whole repository (or a substantial part of it) from somewhere and copy that to the hard disk. I imagine that I can then set it in /etc/apt/sources.list.

- what do i download?
- where can i download it from?

is there any difference between apt for debian and apt for ubuntu other than the repository?

aravind.

Aurels
March 16th, 2005, 10:08 PM
That's a good question, i'm really interested on using a 'local repository' too.

graabein
March 17th, 2005, 09:29 AM
I also have no internet at home. I've copied the repos from the Warty install CD onto my harddrive and got that to work. I'd like to download the universe... :-k

Here are some links to read up on the basics... I don't know the difference between Debian and Ubuntu packages as I'm rather new to Linux myself. I have in fact not installed an application yet because of package dependencies... If you don't count Neverball data files, hehe.

http://www.debian.org/doc/manuals/repository-howto/repository-howto.html
http://www.debian.org/doc/manuals/apt-howto/index.en.html

oracledarren
March 17th, 2005, 07:45 PM
I asked this question here and I am struggling to find where the answer is.

The basic answer I think you are looking for is once you have installed a machine with all the good stuff you want to want to be able to transfer that in some way so that it can be installed on another previously installed machine.

All of the downloaded files are stored in /var/cache/apt which you can copy to a cd or dvd but there is a file you need to create before doing it called packages.

If you look at the posts I have made and look for the one that says creating a sources cd you will find the answer there.

So I cant be more help just now, but I gotta fly :sad:

izut
March 18th, 2005, 06:39 PM
I'll describe a few steps I made to construct my personal repository. My current setup is:

- Ubuntu 'Warty' installed with Internet access (at work)
- Ubuntu 'Warty' installed without Internet access (at home)

Using the usual Ubuntu repositories, I updated the system and installed some packages I wanted (ruby, apache, mysql, etc). You don't need to install that on the host system, just use the apt-get's download only option. All files downloaded from repositories are in the /var/cache/apt/archives directory in the host system. I did these steps:

1. Created /opt/repo directory (could be the home directory)
2. Created the directory /opt/repo/binary (copied from Debian specs)
3. Copied all debs from my update from /var/cache/apt/archives to /opt/repo/binary
4. Executed dpkg-scanpackages like this:
# pwd
/opt/repo
# dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz
5. Burned a CD with its contents

For use that in my standalone host, I did this:
# apt-cdrom add
...

I think it's all.

Cya.

alex-gurgel
March 18th, 2005, 08:19 PM
Hey !!!! I've looking for this !!!! And only see an answer here !

Very thanks !!!

Aurels
March 20th, 2005, 07:38 PM
OK. Fine!

Maniak
March 27th, 2005, 12:49 AM
OK - here is a slightly different setup to play/help me with. I have a couple of computers on a network at home. I am using dial-up to connect to the net. I don't want to have to download the patches/upgrades/new programs twice (or more) - what do I need to change from the above posts to turn my /var/chache/apt/archives into a local respository for the other computer(s) on the network? Or is there another way to update all computers on the network?

marcolino
March 31st, 2005, 04:17 AM
thanks it works great.

urbandryad
September 30th, 2005, 09:11 PM
Can you do this for a USB flash drive instead of a CD? I don't have a CD burner. :(

Brad wilkinson
October 1st, 2005, 06:48 AM
OK - here is a slightly different setup to play/help me with. I have a couple of computers on a network at home. I am using dial-up to connect to the net. I don't want to have to download the patches/upgrades/new programs twice (or more) - what do I need to change from the above posts to turn my /var/chache/apt/archives into a local respository for the other computer(s) on the network? Or is there another way to update all computers on the network?

You want to read up on a thing called apt-proxy. It allows you to set one of your machines as a proxy (for apt-get) so any of your local machines go through it to get to the repositories on the net. anything that one machine requests is cached for other machines to get localy, instead of using the internet.

IMO if you have two or more machines using Ubuntu/debian and update them often, it is only polite to set up apt-proxy. somone has to pay for the server bandwidth.

bluhound
October 14th, 2005, 11:40 AM
I got this out from http://puggy.symonds.net/~rajesh/localdeb.html.

1. Create a file overridefile (u can give any name to this file) with the contents of the directory (list of deb filenames in that directory)

* cd /var/pkgs/helix
* find . -name "*.deb" > overridefile

Now the 'overridefile' should look something like this :

./aalib1_1.2-helix1_i386.deb
./abiword_0.7.10-helix1_i386.deb
./bonobo_0.23-helix4_i386.deb
./codecommander_0.9.7-helix1_i386.deb
./eog_0.5-helix1_i386.deb

There are other options which u can specify in the override file
which I don't need. man dpkg-scanpackages for further details on this.


2. dpkg-scanpackages . overridefile > Packages

3. Add the following in /etc/apt/sources.list

deb file:/var/pkgs/helix ./

4. apt-get update

Now you can do apt-get install < any package from that directory > :-)

chrisblack
October 24th, 2005, 10:03 AM
I've a similar issue - pc at home no internet connection (winmodem!!!) but internet connection at work

However I've no ubuntu at work, and no chance of installing it, so is there anyway I can download and burn the repositories to CD, so I can add the CD at home?

Or perhpas the unofficial 5.04 add-on cd is what I need??

Thanks

Chris

khirsha
October 24th, 2005, 12:04 PM
I've some PC with kubuntu installed on, that are not connected to the net, that i like to mantain updated.
I use the program "debmirror" (you find it in the official repositories) to mantain a copy of the repositories of i386 acrhitecture without source package in a external HD.

"debmirror -v --host=archive.ubuntu.com --method=http --root=ubuntu --arch=i386 --dist=hoary,hoary-updates,hoary-security --section=main,multiverse,restricted,universe --nosource --passive hoary
"
It works very well, i've just some problem with the signature of the release file of the security section so i've to append the option --ignore-release-gpg

It takes about 9,9 GB of disc space.

UbuWu
October 24th, 2005, 12:19 PM
However I've no ubuntu at work, and no chance of installing it, so is there anyway I can download and burn the repositories to CD, so I can add the CD at home?


If you have a dvd burner at work, burn the dvd's from this page and you will have the whole repositories on dvd (main, universe and multiverse):
http://cargol.net/~ramon/ubuntu-dvd-en

chrisblack
October 24th, 2005, 12:44 PM
If you have a dvd burner at work, burn the dvd's from this page and you will have the whole repositories on dvd (main, universe and multiverse):
http://cargol.net/~ramon/ubuntu-dvd-en

Thanks

Thats pretty cool - however, I've no dvd drive (only cdrom) on my pc at home... any other suggestions??

No_Code
October 27th, 2005, 03:27 PM
One thing you may want to try in the absence of a DVD burner is to download the ISO images and mount them over the loopback. Note, you do NOT necessarily need to burn them to make it work on your system. The following steps will allow you to use an ISO image without burning it to a physical disk and inserting that disk:

sudo modprobe loop
sudo mkdir /mnt/mountpoint
sudo mount -o loop diskimage.iso /mnt/mountpoint

Of course, substitute in the proper information for mountpoint and diskimage.iso, and you should be in business!

libertyaikido
November 22nd, 2005, 11:35 PM
"debmirror -v --host=archive.ubuntu.com --method=http --root=ubuntu --arch=i386 --dist=hoary,hoary-updates,hoary-security --section=main,multiverse,restricted,universe --nosource --passive hoary
"
It works very well, i've just some problem with the signature of the release file of the security section so i've to append the option --ignore-release-gpg

It takes about 9,9 GB of disc space.

Have you found a resolution to the gpg signature problem? It would be nice to have a complete (feature-wise) mirror.

lotusleaf
November 23rd, 2005, 04:40 AM
"HOWTO: Custom repo (local or remote)" (http://www.ubuntuforums.org/showthread.php?t=42862)

libertyaikido
November 23rd, 2005, 07:32 AM
"HOWTO: Custom repo (local or remote)" (http://www.ubuntuforums.org/showthread.php?t=42862)

I'm not sure I understand how that link provided a resolution to the signature problem.

The signature problem occurs when trying to mirror a remote Ubuntu repository to a local directory using debmirror. The thread provided doesn't deal with mirroring Ubuntu repositories. It only deals with creating a local repository of whatever .debs you may have lying around.

I need a complete (including digital signatures) mirror of a remote Ubuntu i386 repository sitting on my hard drive for network installs. Any idea how to resolve the signature problem?

lotusleaf
November 25th, 2005, 05:49 AM
I'm not sure I understand how that link provided a resolution to the signature problem.

I was responding to the original post and directly addressing the topic of this thread, not later posts in this thread. A number of people have missed the howto I linked to because when searching the forums they would search for "respository" rather than "repo". I've posted this link to the howto to duplicate threads of the initial topic of this thread.

I hope you find a solution for what you're looking for, sorry but I hadn't followed the entire flow of discussion, and the branching out to other issues.

vavoem
May 9th, 2006, 11:19 AM
](*,) screwed up sorry

popey
October 30th, 2006, 10:04 AM
Just in case anyone finds this thread I thought I'd post this here:-

http://popey.com/Creating_an_Ubuntu_repository_mirror_with_apt-mirror

67comet
October 31st, 2006, 01:51 AM
I'm also reading around trying to see how to add /media/IAUDIO_A2/binary/ to my apt on a networkless box ..

Hear to the grind stone,
Justin

speeddemon8803
April 14th, 2007, 02:57 AM
Can you do this for a USB flash drive instead of a CD? I don't have a CD burner. :(

mmhmm..your computer can boot from a flash drive right?

if so..extract the iso image...to the usb flash drive...restart...set bios to boot from flash drive..bam!

I actually found this out by mistake! heh!

goats_not_bombs
July 30th, 2007, 12:51 AM
For USB, and all other media besides CD, here is a workaround that I came up with:

// Get the packages:
// How I did this was download the server CD as ISO and mounted it but other options are previously posted.
// First thing that I do is copy the files that I want on to the hard drive, but this is not manditory.

mkdir (the directories that you want to mount to: most likely in the /media directory)

// Mounts the filesystem
cd to the directory that you want to mount from
sudo modprobe loop
sudo mount [ubuntu-7.04-server-i386.iso] [/media/iso/] -t iso9660 -o loop

// Changes the logical link for cdrom that apt-cdrom uses
// Change the cdrom pointer to the mounted directory that you want to get the package info
// remember ln (link making utility) is backwards in usage.
cd to /
ls -l
you should see => lrwxrwxrwx 1 root root 11 2007-07-27 04:48 cdrom -> media/cdrom
sudo rm -f cdrom
sudo ln -s /media/iso cdrom

// use apt-cdrom as the installer
// *note: if you don't use sudo with this command, you will have to remount
sudo apt-cdrom add -d /media/iso

// Run your package manager
apt-get update // at the command prompt
System -> Administration -> Synaptics Package Manager // for the GUI


#####################

// *** I don't think that this step needs to happen but here it is just in case
cd to /dev
ls -l | less
// you should see => rwxrwxrwx 1 root root 4 2007-07-29 08:02 cdrom -> scd0
sudo rm -f cdrom
ln -s -i /media/iso cdrom

Angus77
May 8th, 2008, 01:55 AM
I love living in Japan:


21.1 GiB will be downloaded into archive.
Downloading 25096 archive files using 20 threads...
Begin time: Thu May 8 09:38:52 2008
[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]...
End time: Thu May 8 09:43:43 2008

21.1 GiB in 15 minutes! WOOHOO!

arun.in
October 22nd, 2008, 11:52 AM
Check
http://odzangba.wordpress.com/2006/10/13/how-to-build-local-apt-repositories/

mardangga
June 3rd, 2009, 04:39 PM
For USB, and all other media besides CD, here is a workaround that I came up with:

// Get the packages:
// How I did this was download the server CD as ISO and mounted it but other options are previously posted.
// First thing that I do is copy the files that I want on to the hard drive, but this is not manditory.

mkdir (the directories that you want to mount to: most likely in the /media directory)

// Mounts the filesystem
cd to the directory that you want to mount from
sudo modprobe loop
sudo mount [ubuntu-7.04-server-i386.iso] [/media/iso/] -t iso9660 -o loop

// Changes the logical link for cdrom that apt-cdrom uses
// Change the cdrom pointer to the mounted directory that you want to get the package info
// remember ln (link making utility) is backwards in usage.
cd to /
ls -l
you should see => lrwxrwxrwx 1 root root 11 2007-07-27 04:48 cdrom -> media/cdrom
sudo rm -f cdrom
sudo ln -s /media/iso cdrom

// use apt-cdrom as the installer
// *note: if you don't use sudo with this command, you will have to remount
sudo apt-cdrom add -d /media/iso

// Run your package manager
apt-get update // at the command prompt
System -> Administration -> Synaptics Package Manager // for the GUI


#####################

// *** I don't think that this step needs to happen but here it is just in case
cd to /dev
ls -l | less
// you should see => rwxrwxrwx 1 root root 4 2007-07-29 08:02 cdrom -> scd0
sudo rm -f cdrom
ln -s -i /media/iso cdrom

Gee.... Thanks goats_not_bombs.
This is what I'm looking for. B4 I read this thread, I've already set everything like what's you write on this thread, except change the symbolic link for cdrom. I'm don't know how to change the default cdrom to directory that I want (like /mnt/cdrom). And now, I know the problem. I've never expect the problem just the symbolic link (God, Jesus!!).
Btw, really thx for this thread. N sorry 4 my poor english. You're really helpful.