Friday, May 28, 2010

How to Install Local Repository In Ubuntu 9.10

One that I like about Linux especially Ubuntu is that after we install Ubuntu we won't be bothered finding another program for processing documents, play songs or movies, edit pictures or anything else. By installing Ubuntu you've got it all.

Some packages are automatically installed when you install Ubuntu. Some we have to install manually. For example if we want to play music with the mp3 format then we must install resticted packages. If we connect to the internet, then Ubuntu will automatically download it from the ubuntu server, but if we are not connected to the internet or our internet connection is poor, then we can install it with DVD repository. Repository is a collection of programs or the linux package. We can get it by downloading from the Ubuntu server or local miror servers. If you have trouble to get it, you can contact me to get one for FREE (excluding the cost of burning to DVD and postage). Ubuntu 9.10 DVD Repository contains seven DVDs.

Sometimes a package requires other packages or programs (dependencies), so if we install from the DVD repo, then we should put some DVDs in turn. Depending on the package that we install, we sometimes have to insert and remove the DVD dozens of times, an exhausting work.

If you dont want to do that, then we can set up a local repository on hard disk, so Ubuntu will instantly retrieve files from your hard drive so the installation runs much faster. To install a local repository, we need repository DVDs for copying to hard disk.

Step 1: Create the ISO file from the Ubuntu Repository DVDs

Create a new folder where we will put a repo file for example in "/home/repo/"
we can do that by typing this command in terminal:
sudo mkdir /home/repo
If password requested, enter your password.
Insert the DVD repo number 1 into the DVD rom, then type this command in Terminal:
sudo dd if=/dev/cdrom of=/home/repo/karmic-repo1.iso
This command means copying contents of the DVD to the folder /home/repo and named it karmic-repo1.iso (iso image file format).
Wait until the process is completed and the DVD ejected out of the DVD rom.
Repeat with six other DVDs, do not forget to change the file name.

Step 2: Make a folder in /mnt, as many as number of ISO files repository

type the following command in a terminal:
sudo mkdir /mnt/repo1
sudo mkdir /mnt/repo2
sudo mkdir /mnt/repo3
sudo mkdir /mnt/repo4
sudo mkdir /mnt/repo5
sudo mkdir /mnt/repo6
sudo mkdir /mnt/repo7

Step 3: Now it is time to mount all the ISO files automatically in the folder /home/repo to /mnt.

open the file /etc/fstab by typing this in terminal
sudo gedit /etc/fstab
Add the following lines at end of file
# Repository
/home/repo/karmic-repo1.iso/ mnt/repo1 iso9660 loop, defaults 0 0
/home/repo/karmic-repo2.iso/ mnt/repo2 iso9660 loop, defaults 0 0
/home/repo/karmic-repo3.iso/ mnt/repo3 iso9660 loop, defaults 0 0
/home/repo/karmic-repo4.iso/ mnt/repo4 iso9660 loop, defaults 0 0
/home/repo/karmic-repo5.iso/ mnt/repo5 iso9660 loop, defaults 0 0
/home/repo/karmic-repo6.iso/ mnt/repo6 iso9660 loop, defaults 0 0
/home/repo/karmic-repo7.iso/ mnt/repo7 iso9660 loop, defaults 0 0
save the file /etc/fstab and exit from gedit.
Restart ubuntu to mount file we created earlier automatically.
To determine whether the files have been mounted, you can view it by opening the System Monitor (Sysem> Administration> System Monitor) in the File Systems tab.

Step 4:Conect Software Sources to the repo file.

Open Software Sources (Sysem> Administration> Software Sources).
Open the Other Software tab and click the Add... button and type in
deb file:/mnt/repo1/ karmic main (without quotes) in the apt-line box.
Repeat the steps above for the six other file:

deb file:/mnt/repo2/ karmic main multiverse restricted
deb file:/mnt/repo3/ karmic universe multiverse
deb file:/mnt/repo4/ karmic universe
deb file:/mnt/repo5/ karmic universe
deb file:/mnt/repo6/ karmic universe
deb file:/mnt/repo7/ karmic universe

Restart Ubuntu.

Repo file is now ready. You can add a package of programs in several ways, through the terminal with apt-get, through the Ubuntu Synaptic Package Manager and through Software Center.

Thanks to:


Anonymous said...

mantab mas

Unknown said...

thanx bro, sorry jarang tak kunjungi

michan hersan said...

bagus info nya mas.. :D

Post a Comment