You do not have Internet? Learn how to take your repositories home

Image taken from Deviantart

When I had a computer at home, I used GNU / Linux without any problem even without having internet to use the repositories.

What I did was take a copy of the packages installed on my work computer and install / update them at home. There are several applications and variants to do this, I will show you some.

aptOnCD

Ideal for users of Ubuntu. With APTOnCD we will take all the packages that we have in the cache APT in a . Iso without any complications. To install it:

$ sudo aptitude install aptoncd

To use it, we simply run the application and do what it tells us step by step. Nothing complicated.

Advantages:

  • You can take your repository in an .iso (or several, depending on the size) Wherever you want you to go You can create iso in CD y DVD.
  • You can unzip the .iso and copy everything inside to a folder, and update from there.
  • APTOnCD detects when you have new packages and adds them discarding the old ones.

Disadvantages:

  • If you do not have CD-RW o DVD-RW you will have a waste of money if you are one of those who likes to update daily, although you can have as an alternative point 2 of the advantages.
  • If you use apt pinning with several branches (Testing, Sid, Experimental), it may give you some errors when installing dependencies.

apt-move:

This alternative is ideal for debian-squeeze. In Debian Testing I had some problems because I did not copy the packages to the destination folder.

To install it:

$ sudo aptitude install apt-move

Configuration:

All options apt-move can be consulted in its manual (man apt-move). Its configuration is in /etc/apt-move.conf and we must modify some things in it, for this we open our favorite editor that file:

$ sudo nano /etc/apt-move.conf

And we must take into account the following lines, which are the only ones that we must modify:

# Establecemos la carpeta donde se creará el mirror que nos llevaremos a casa.
LOCALDIR=/home/usuario/carpeta_mirror

# Ponemos la distribución que usamos para nuestro mirror
DIST=squeeze

# Si lo ponemos en Yes, borrará los paquetes antiguos que se bajan a la caché
DELETE=no

# Si lo ponemos en NO, moverá los paquetes a nuestra carpeta mirror y los elimina de la caché
COPYONLY=yes

This is more than enough in the settings.

Use:

As simple as running:

$ sudo aptitude update && aptitude upgrade && apt-move update

This will copy us, for the folder we have chosen, all the packages from our cache

Advantages:

  • Create the exact structure of a mirror with the packages we have in cache.
  • It groups the Main and Contrib branches only in Main, so when adding the address to the source.list, we only have to put main non-free.
  • If we have apt-pinning, we can download each branch independently.

Disadvantages:

  • So far I have not found any.

Using dpkg-scanpackages

Note: This is something like using APTOnCD

The function of this tool is to create a mini repo that you can easily transport and include in the sources.list, from the downloaded files or those that you include on your own.

The operating mode is as follows: First install dpkg-dev

$ sudo apt-get install dpkg-dev

Copy the files from the apt cache to the folder that you find selected to work, suppose it is called repo and is located in / home / user / repo /.

cp /var/cache/apt/archives/*.deb /home/usuario/repo/

You can also include the .deb what you wish.

Now we go to our folder: repo (in this case).

cd /home/usuario/repo

and we execute:

dpkg-scanpackages repo /dev/null | gzip > repo/Packages.gz

What we are doing here is reading all the packages that are in / home / user / repo / and the file is created packages.gz with this information; Depending on the number of packages, it will be the time to finish the process.

To start working with the new mini-repo created, the next step would be to add it to the sources.list, this is achieved by following these steps:

With our text editor (this case nano):

nano /etc/apt/sources.list

We add the following line:

deb file:/home/usuario repo/

It is important to highlight, to take into account, that after file, the colon (:) and then a single slash (/) are put in it, also that after the last folder, in this case Desktop, there is no slash, it takes a space and then the mini-repo folder (repo) with a slash at the end.

With these steps, we have created a mini-repo ready to transport.


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.   Manuel said

    Something but for distributions that use RPM?

    1.    KZKG ^ Gaara <"Linux said

      Maybe YumonCD:
      https://bitbucket.org/a_atalla/yumoncd/downloads/

      I've never tried it, but it's an idea / clue where to start looking.

    2.    elav <° Linux said

      Unfortunately, we do not have much experience with this type of package, but surely there is a variant somewhere.

    3.    scaamanho said

      There is the createrepro tool to create repositories from a directory where the libraries are located.
      Take a look at http://blog.kagesenshi.org/2007/01/howto-creating-your-own-yum-rpm.html there they detail the process quite well explained.

  2.   hypersayan_x said

    Another possibility is to use keryx, you can download the packages desde Linux or Windows, and then install it on your computer without internet. It works only for Debian and Ubuntu.
    I also did some time ago A program to download packages for linux without internet, but I had to leave U_U to start another project much more screwed up, which I will surely present before the end of the year 😀

    1.    elav <° Linux said

      You were the creator of sushi-huh? : -O Wow, great. I used it on several occasions. It is true that there are other graphical tools, I will have to gather more information about it.

  3.   night said

    I think the easiest thing for me has always been to rescue the packages from / var / cache / apt and pass them to a memory or whatever. I get home, open my console, go to the folder where the packages are and install everything by typing sudo dpkg -i * .deb

    regards

  4.   zOdiaK said

    Good solutions, ALL, including Drnocho's, excellent blog, I am very happy when I find active blogs about free software, and even more when it is about our beloved Debian.

    1.    elav <° Linux said

      Debian Rulez !!!

    2.    KZKG ^ Gaara <"Linux said

      Thanks friend, it is a pleasure to help and give back a little all that knowledge that the community has given us 🙂
      regards

  5.   zOdiaK said

    I don't know if it will be a correction but, if we use apt-move the line in the terminal would look like this:

    sudo aptitude update && sudo aptitude upgrade && sudo apt-move update

    Although it sounds redundant or obvious, but, there are always people who do not realize that little detail hahaha.

    regards!

    1.    elav <° Linux said

      Welcome zOdiaK:
      Thanks for the information ... 😀

  6.   Leo said

    Is there something more like Synaptic? For me it is the best

  7.   Constantine said

    thanks for the information, but a question arises aptoncd generates an iso with the programs downloaded on the pc with internet but on the pc without internet it would have to have aptoncd installed but its installation is done with a pc with internet then, how to restore the iso generated without aptoncd on pc without internet.

  8.   Nelson said

    The post is good ... Is there any type of these tools but focused on .rpm packages?

  9.   Anthony A. said

    Hi. What do you advise me. I have a partitioned toshiba computer with windows 7 and Debian Linux 7 using GRUB. As it is Graphics ATI x1200 series, I am left with a bug and it only has a tty screen. When setting sudo, mark command was not found. I have tried to download repositories with Suhsi huh and camicri cube, it has not been possible. Is there any way that you can recommend me.
    Thank you.