How to use a local Ubuntu repository

In my country, most of us do not have internet access, so we do not have access to online repositories. This forces us to load the repository in a external hard drive or in our own internal HDD.

For example, on my external HDD I have the ArchLinux repo for 64bits (more than 30GB), as well as the Debian Wheezy 32bits (more than 40GB).

By default the distros once installed, try to update the packages, install new packages and others from repositories on the internet, we must tell our distro not to search the internet for the repository, we must tell it to use the repository that we have.

Image taken from Deviantart

Configure the repository in sources.list

The following steps require administrative permissions. If they use Ubuntu (for example) they should put "sudo" in front of every command line they type

1. We must open a terminal (console, bash, shell, etc). In this we will write:

nano /etc/apt/sources.list

2. A text file will open, let's delete everything it has and put this:

deb file: /// media / hdd / repo precise main universe multiverse restricted deb file: /// media / hdd / repo precise-updates main universe multiverse restricted deb file: /// media / hdd / repo precise-security main universe multiverse restricted deb file: /// media / hdd / repo precise-backports main universe multiverse restricted deb file: /// media / hdd / repo precise-proposed main universe multiverse restricted

Here I will stop. This is the path to the Ubuntu Precise repository that in theory I have on my external HDD, / media / hdd / is the folder where the HDD is mounted, then the repository (that is, the folder that contains dists, pool and others) is called repo, the version of Ubuntu that I am using is precise that is why the first line is the same name of the distro need (12.04), then the next lines will be other branches of the repo (updates, security, etc), finally I specify the areas of the repo, main universe multiverse restricted

3. Let's save the file with Ctrl + O and exit the editor with Ctrl + X

4. In that same terminal, let's write the following and you will see how the local repository indexes begin to be read:

apt-get update

Now to clarify, where 90% of people make mistakes is when it comes to putting the path / address of the repository, it is extremely important to read well and copy this part well.

Let's say we copy the repo to an external HDD, which is located in "/ media / external", we copy it to the root with the name "repository-ubuntu", within this folder (repository-ubuntu) are the folders belonging to the repository (dists, pool, etc).

If so then the path would be:

deb file: /// media / external / repository-ubuntu lucid main universe multiverse restricted etc etc etc

It is also valid to clarify that there are programs that make us a mini-repository, in this way it is not necessary to carry that ton of GBs, applications such as aptonCD, RepoMan o PSC.

Well, nothing more to add, I know that for many it is not a necessity to have the repository on the HDD but ... those who need it, already have more information about it.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   serfravirs said

    Hello, how are you? One question: and how do I update that repository? I guess I have to find somewhere to connect. And another question that has just arisen, how long does it take to update all that bunch of applications? The article is interesting to me because it is possible that for a while I have no connection, the bad thing is that I use Arch and Antergos.

    1.    cris said

      It would be interesting for them to do a post narrating how are the specific conditions of technology in Cuba, how do you have access to the internet even if it is little, and if it is because of work, what is the purpose of that work? It would be a good read to learn about the socio-technological conditions of that beautiful country.

      Greetings from Bogotá.

      1.    dwarf said

        Hello, sorry but what you ask cannot be given to you.

        It is a subject with too many political connotations and extremely delicate, especially considering that within the community there are many people with ... so to speak complex and difficult to understand.

        We do not talk about politics (unless it is about government decisions on the subject we are dealing with, and always from a practical point of view) or anything like that.

        1.    cris said

          ok 😉

      2.    Oktoberfest said

        You can learn more about what you are asking in this comment 😉 I hope it clarifies your doubts 😉

        https://blog.desdelinux.net/flisol-2014-en-cuba/#comment-115547

        Salu2.

    2.    dragnell said

      We usually do it with debmirror for the .DEB distro and rsync for all the others from somewhere that has updated repositories in .cu in our case, the delay time is proportional to your bandwidth and time without updating those repos. Cheers

  2.   kevinjhon said

    You forget debmirror to download them

  3.   eliotime3000 said

    Excellent recommendation, as it would also work for Debian (both use APT and the truth is that it is also worth updating the version to disk end).

  4.   dayani said

    I need help for fis…. How can I download from an intranet and copy the ubuntu repo to a disk ... from a windows machine? 😀

  5.   gopro said

    Can I update the repository without having an Internet connection? with a usb or something like that, because my problem is that I can't configure the drivers without downloading them from the repository.