 One of the great features of Linux is package management. One of the challenges some people have is getting all the packages installed on a new system they set up. People have asked me about, well, don't you just clone the system to make full image backups similar to the Windows world? And in some cases, yeah, it's very convenient when you have things virtualized to create snapshots so you can quickly restore. But if you just want to set up a new system with the same packages, and for example your desktop or maybe a server that you have and you want to configure it differently, but make sure it has at least the same level of packages on there, apt clone is an easy way to do this. This works in both a Debian-based distributions and Ubuntu. No Ubuntu is Debian-based, but I just want to mention that is in both repositories of there. So you can use this with Debian-based or Ubuntu-based servers or desktops and it should work perfectly fine. I have not trusted on every distribution, but any system that uses apt, this should work. I will note that if you try to use this across different distributions, I did play with this a bit. It definitely gives some errors and has some problems. So if you load a Debian and then try to use the same apt clone on a machine that's running Ubuntu, you're probably going to have problems. But if you're trying to duplicate essentially the same machine based on the same load, that seems to work perfectly fine. And so far, that's the testing I'm done. And let's go ahead and jump into this. So here is my Debian apt clone demo and here's my Debian lab server. Now, my lab server has, well, everything set up the way I want. And I have things like Htop, which we'll go up here to the top to the lab, and we'll type in Htop. See, Htop runs fine. I have Tmux, which I'm using to split the screens right here. And this is just so you know, this is the one here. And I can do IPA, I also have IF config in here. So sometimes I'm used to using it, so I've got a lot of little packages that I can't quite remember the name of all of them. And but when I set a system up, I do like to load all those same packages. That way, as I have things or utilities that I want to run, it doesn't have to stop and install all of them. So we go apt-get install, apt, oops, apt clone. It's already installed, but it's the latest version. And like it's over here, we have Htop is missing. So nothing in there, no such file or directory. Let's see, what else are we missing? Well, most everything, because if we look at this system, it's a brand new fresh install, which I did absolutely the most basic with the exception of installing SSH. So SSH is in here, and that's pretty much it. And I configured SSH to allow it to run as root and have me log it. Well, not run as root, but log in as root from this other server, so I can install apt clone. So we're going to make sure this is apt-get install, which by the way, I'm tabbing a couple of times. Bash completion is not installed either, which is obviously super annoying. So apt-get install apt clone. We'll go ahead and throw that on here real quick. Then over here, we already have it installed. So we will apt clone, and the term is clone, and it'll be dublab. And dublab is the destination I'm giving it. So it'll run for a second here, and it'll clone it into here. Now, what it's going to clone is the entire package list. It's not going to clone a couple things you're going to see that have been added on, for example, the Zen tools. So this will run for a second here. Now, the two things it did not install, not installable, Zen guest utilities, and front access suite. The reason those aren't installed is because I added them separate. So Zen guest utilities and front access suite are two add-ons. So I'm going to up arrow here, dublab, and we'll complete because I want to go ahead and install these packages. And this is kind of interesting because instead of just the packages, and maybe that's all you want with dash dpkg repack, what this actually does is grabs and repackages and creates the installers for those again. So now, if I want the front access suite and the Zen guest utilities copied over to the other machine, we can do that. So we're going to go ahead and apt clone, dub complete with dpackage repacked. So it's going to grab those. Now, it also will grab other packages you may have added like other repositories. It's going to set all those up as well. So this is a really great system in doing it, but let's show you what it does with the whole complete. All right, so now it rebuilt packages for the front access suite and Zen guest utilities, two things I like to have in my lab. So we'll clear this, there's nothing in here. The IP address is 192.1683.106. So we're going to go ahead and install the full one, but it does the same thing whether you install the full or that. I just want those utilities over on my deblab complete over on this server. And it completes it. So we only call it deblab complete and it adds.aptclone.tar.gz. And if you open up the file, it's got all the different repository information in there. It's completely human readable per se. It copies things into SC and sets up the different utilities that it needs for apt clone. So scp root at 192.168.3.106. All right, file copied over. By the way, including all the repackaged, it's only 106 meg file. But if you don't have the repackage include, it's, how far is it, 55 kilobytes. It's literally just a big text file essentially with listing all the packages. And this is a really nice feature of this. You're not dealing with some large file. Matter of fact, I'll show you next after we show how to do the server one here. I'll show you how you do this in popOS. So now what we're gonna do is apt clone, restore, deblab complete, enter. It's gonna go ahead and get some updates and it's now loading everything and setting everything up. Okay, now all the packages are installed and the last thing I like to do is change to prompt. So people always ask how to do this and this is on my GitHub. So I'll just pull it up over here. And this is dot files. We'll go ahead and clone or download. There's a link to this down below. You can just copy that. And it's a git clone ncd dot files. I'm gonna fix the install real quick because if you install this and you don't have sudo, and I know I didn't install sudo on this because I don't have it on this particular lab server, it'll just give an error about that. So we'll go ahead and do this real quick. All right, and we'll restart it because there's a lot of updates and just make sure they're all on there. So we'll go ahead and restart those real quick. Watch it reboot here. But she boots up really fast. There are a few things that want to install it's a couple of package questions it had. You know, is it okay to restart? So you still have to go through those. Like I said, this is not copying configuration only installing all the same package lists between these. So it's booted up. Yeah, there we go. And away we go. It's ready to go. It has a Htop bash completion app to get installed and you know, whatever package management I want on here to show all the possibilities. Whoops. So that's all you have to do to get these cloned. Now you can even on a particular system. So let's go and show what it looks like. For example, in PopOS, let's close all this down. So here I have PopOS 1910 running in virtual box and just easy way to demo this. So we're gonna go ahead and create a clone of the system. It's installed with the packages and show you how it works in here. So we can do apt clone and we'll call it pop clone. Whoops, I forgot to add the clone after it. So it's apt clone clone, which feels weird to me, but clone, pop clone. And it's gonna go ahead and create this file called pop clone. It finds a couple uninstalled packages I'm not really worried about. We can do the repackage again but it's not necessary for what we're doing here. There's our pop clone all of 53 kilobytes to get all the packages on here. Now let's give an example. So Htop is currently installed. So if we went ahead and sudo apt get remove Htop, Htop's no longer installed. And what if we goofed up and removed a lot of different things? This is a quick way to get those things back. We can go sudo because you have to run sudo when you're doing an apt clone restore because it needs to be able to access the repository. So we'll go apt clone restore pop clone. It's gonna figure out what was missing. Found Htop missing. So now Htop is installed again. Pretty simple. You can also, if you're, let's go to apt clone. It's got a couple different options so we can go info pop clone. Let's you know which distribution, some of the data about it. You can also, so we'll remove Htop again, sudo apt get install. Actually is get installed, I think so. Yeah, it gets already installed. Get so clear. I don't like all the stuff on the screen. sudo apt get remove and we'll move Htop on there. So we know we've got a difference between the two files. Then we can go apt clone. I think it's show dash D. And the only thing it finds different is installed in the clone file but not in the system as Htop. So we could also add something else like sudo apt get cow say. I don't think cow say is installed by default. It's not. If you're not familiar with cow say, it has a little cow that says something. So now we can show the diff now. Installed on the system but not in the clone file cow say. So let's go ahead and apt, whoops. sudo apt clone restore. Restore this. And I wanna point out it didn't remove cow say. Whoops. Yeah, he was the cow something to say. So it will restore packages but I will note it doesn't remove existing packages. It just creates a differential to say, are these things installed on here? Which now if we show it, there's it knows cow say has been installed but please note it didn't remove extras. It only installed the missing packages but leaves the existing ones installed. Now from there you set the copy or configuration files or any personal preferences you have for how you want things configured. But in terms of just getting the packages set up quickly, which is frequently what I wanna do when I'm setting up a Debbie inbox. I'll quickly get that list of packages, grab that package, just throw it on there. And these are all the little utilities I have and all the utilities I want installed. And of course, even on my own system here, when I make a bunch of changes to the system over time, you just run app clone, I create the little config file. It's not any security risk with it's just a list of packages. And now you know what packages are installed. And if I am curious I can do the info to see what the differences are. But I guess it's a great way to keep your system kind of in place so you know where things are in terms of all the packages and quickly get it set back up when it has to be reload. And it keeps me from having to worry about a full image. So in the event that my computer dies, something happens. The data is always backed up in real time with Sync Thing. I've talked about that before. And then the package management is just installed to packages, save some config files that I care about like my SSH keys, which those are obviously highly secure. So I only backed those up on a external device that's offline and kept locked and encrypted. But that's it, you can restore fairly quickly from there. All right, hopefully this was helpful. And like I said, sudo apt-get-clone works on all the Debian distributions and Ubuntu once as well, thanks. And thank you for making it to the end of the video. If you like this video, please give it a thumbs up. If you'd like to see more content from the channel, hit the subscribe button and hit the bell icon if you'd like YouTube to notify you when new videos come out. If you'd like to hire us, head over to laurancesystems.com fill out our contact page and let us know what we can help you with and what projects you'd like us to work together on. If you wanna carry on the discussion, head over to forums.laurancesystems.com where we can carry on the discussion about this video, other videos or other tech topics in general. Even suggestions for new videos, they're accepted right there on our forums, which are free. Also, if you'd like to help the channel in other ways, head over to our affiliate page. We have a lot of great tech offers for you. And once again, thanks for watching and see you next time.