Files
hpr-knowledge-base/hpr_transcripts/hpr0378.txt

129 lines
9.4 KiB
Plaintext
Raw Normal View History

Episode: 378
Title: HPR0378: apt-move
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr0378/hpr0378.mp3
Transcribed: 2025-10-07 19:23:58
---
.
.
Hello everybody, welcome to today's episode of Packer Public Radio.
Today I want to introduce you to a package called AppToMove.
AppToMove is a package for people who use Debian packages on their system,
so that's Debian or Debian-derived distributions.
Now what AppToMove does is AppToMove creates a local Debian package mirror
of all the programs that you have installed on your system.
So why would you want to do this? You might ask.
Well the reason you would want to do this was because with AppToMove
you can create a local repository of a customized system.
In other words if you install packages X, Y, and Z and of course their dependencies
would be automatically installed.
You can use AppToMove Sync, which is one of the subcommands of AppToMove,
to create a directory which has all the packages you've installed,
all the dependencies, but you can do as we can create a directory that has a file hierarchy tree
of all the packages you installed on all the dependencies,
as well as the proper and appropriate release file,
which when installing other systems you can simply copy with any method you liked
copy files with, so that on that second system you can clone your system without
borrowing to access a Debian repository over the internet.
So this tool would be really good for people who have to maintain multiple computers
and would want to have an identical or near identical setup on over several computers.
The main computer that you would connect to you to a standard Debian repository
over the internet would serve as a template and you would install a
super set of packages on that machine.
Then you would cruise the tool to create a copy of the repository and then you can say
copy that repository to a USB drive, copy that repository to a compact disk,
and then when you install all the systems you install that repository and you
point app to get to that instead of a repository over the internet.
Then when you install you don't have to put around with accessing a repository
of the internet, it goes at the standard speed of reading files off of a hard disk.
Much better means you only have to access the repository from one machine once
for all the machines that you use.
Configuration is easy.
What you do is you first create a directory where you're going to be keeping this stuff.
I like to use create a directory in my root directory called slash devs.
And then within that slash devs directory I like to create another directory called the name of the distribution.
I mean the name of the current stable version of dev you may be using.
So for me it's slash dev slash Lenny.
Now I suppose if you use Ubuntu it would be one of the Ubuntu names like slash dev,
slash vice default or that or whatever or whatever they use,
whatever the current one you happen to be using is.
The beautiful thing about having this locally in this way is that when you upgrade
to another version you can just change a few configuration files,
create a whole new distribution and you'll have all the files there.
If at any point in time in the future you need to access a program that you've
used in the past and is no longer being used on your distribution,
you'll be able to go back to the debut need and all the dependencies and enhance your ability
to recover data written under that application.
And I think that's invaluable.
As a matter of fact, perhaps some of you remember that I did an episode on a backup
program called foe backup, Friedrichsburg Austria University backup,
that creates a directory for every date that it backs up.
Not to abuse the size of the file system.
Well, if you apply a backup program that can keep versions like that for every day
it backs up to this directory, you will have a snapshot in time of every single date
you've used the computer with what the repository would look like then.
And you could actually set up a retro box in the future and if you needed to,
if the need existed.
So the first step I would say would be to create the directory you're going to put this in.
The second step should go without saying but I'm going to break it down for you
is to do an apt-get install apt-move.
All right, that will install the package.
Now, what you do the first step before you do anything else is you log in as root
or as you in or as you do in to nano or whatever your text data may be
and edit the configuration file for apt-move.
Because you don't want to want something like this to not be configured
to match your local system.
So the configuration file is located in your Etsy directory.
So it will be slash Etsy slash apt-move.co and F.
And you're going to find a highly annotated and well commented out configuration file.
The things you have to make sure you do is this one called apt sites
and the comment reads the sites and Etsy apt-sources.list that you wish to mirror.
I set this to all so if I add a repository to my sources.list and my apt configuration
it automatically mirrors the packages from that area into my local mirror repository.
So what this means as a real life example is I happen to use the Debian multimedia repository
so I can get all kinds of unusual codecs and have full multimedia and full access
to multimedia applications, regardless of codec.
It makes my system a lot more compatible with things like YouTube and stuff like that.
So it is an unofficial Debian repository, one of the many.
However, it is run by an active Debian maintainer who is well entrusted in the Debian community.
So now I have one repository that includes mainstream packages, the official packages,
as well as the things that this fellow puts into the multimedia repository that
merges them into one seamless unified Debian repository that I can use for other machines.
Then there is a local door variable, like I said, I step slash dev slash Lenny.
So you would set this up to be whatever you set your door if you want to change that.
It would be fine.
And the other thing you may want to check off is there is an option to delete obsolete packages
from your local mirror.
I like to set that to no because I want to retain the maximum amount of devs in this mirror possible.
So I don't want automatically deleting so I set this to be no.
That in short is the kind of configuration changes have to make for apt move itself.
The only other thing is since we are going to be synchronizing against another mirror that we want to do is
we need to tell apt get what we are doing.
And the way we do this is we change the add a first, a new first line to the etsy apt sources.list file.
And what we are going to do is we are going to add our newly generated apt dash move repository back into our sources.list for apt get.
And to do this all you have to do is create a file uniform your eye as your first line that points to it.
So if you have never opened up the sources.list on the slash etsy slash apt before you would see that there is a bunch of lines
and they kind of look like this they say dev space.
Then there is http colon slash slash and then there is you know like minus so and so dot edu slash devian slash which is a URL over the internet to a devian repository.
And then there is a space this is the name of the stable branch in my case Lenny.
Then there is another space and then there is all my sub repositories.
For me it is main space contribute space non free.
So to do this for your local file you really only have to change that http colon slash slash to a file colon slash.
So in the example I am giving you you add a line to your first line that says dev space file colon slash dev slash Lenny that is the directory that apt move is going to use.
Then it is space stable because that is what I am calling it the stable distribution space main space contribute space non dash free.
And then all you have to do is initialize that directory by doing an apt dash move space get and that will generate the master files from your local case of things that you downloaded last.
The last time you used apt get then you type in apt dash move space sink.
And then what apt move will do is will copy all the things that are lying around your local case of dev devian files the devs the software files and move that to this and copy that to this new directory.
Then it will look at what you have installed on your local system that you don't have in your case.
It will contact your mirrors over the internet and make fresh copies, fresh downloads of those devian packages and move those into the directory you have created.
And then it is done with those two steps. It will examine its directory and build a fresh sources file and that will make it that will create in total a devian repository.
And then the next time you do apt get update apt get upgrade those files are going to be included in this.
Then when you step a new system you would do a similar situation only would copy all the files from let's say let's say you are using a USB drive into that directory.
And then you could comment out all the devian repositories over the internet you would do on the new system apt get update apt get upgrade and your new system would have all the devs and only the devs available to you that you've used on your master system.
And then you could clone your new system that way.
So it's something to check out it might take you an evening or two to get going get speed on it but I can highly recommend to you.
I hope you've enjoyed this short episode of Hacker Public Radio and I'll be seeing you around. Thank you.
Thank you.
Thank you.