 At this point, it's basically become cliche that everyone and their brother just absolutely despises snaps, at least in the YouTube Linux community. I'm sure there are many people out there that actually enjoy using snaps, and that's their prerogative. There's absolutely nothing wrong with enjoying something, even if that thing is flawed. Anyone who's watched the channel for any amount of time will know that I'm actually on the side of the people who hate snaps. I can't stand them. I'm never going to use a snap unless I absolutely have to. But my qualms against snaps aren't necessarily the same as everyone else's. I share some of those things in common, but for the most part, the biggest reason why I can't stand snaps is because they're slow. They're just really slow to load. And this is just a fact, and it bothers me because snaps aren't a new thing, right? They have been around for a long time. At this point, you would think that there was something that they could do to get those speeds up just a little bit. And if they could increase the speed by 10% across the board, I think that the complaints against snaps being slow would probably taper off just a little. But that's really beside the point. One of the things I would do if I was absolutely forced to use Ubuntu would be to uninstall snaps from my system. And one of the greatest things about the Linux community is someone has actually gone through and done just that. So you may be familiar with someone called Alan Pope. Now, he used to work for Canonical, and he used to be on the snap team. So a lot of the Linux publications were all like up in arms about a former snap guy creating a script that will uninstall snaps and install flat packs. I don't think there's anything really going on there. I think he just wanted to create a script that installed flat packs instead of snaps. And that's probably the end of the story. I don't think there's anything political going on there. But even whether there is or not, it's not that big of a deal either way for me because I'm more interested in the script itself. So today we're going to be taking a look at a script called unsnap. Now you should know going in that unsnap is very early days in terms of development. And it's not exactly foolproof. If there's not a flat pack of the snap you're trying to install some things may go wrong. And even on the GitHub page it's basically saying that it has only really been tested on his computer. So this is not widely tested and it might break things. But there is a backup situation going on so you can do that. And it's not automatic. It actually requires a lot of user input and intervention in order for this to actually work. So let's go ahead and run this thing and see how it actually fares in terms of replacing snaps with flat packs on Ubuntu. So here we are in a fresh install of Ubuntu 21.10. This is the koala one. I don't actually know what the name of the Ubuntu was. They always have some weird names. But anyways the point is this is the GitHub page for unsnap. And in order to install this thing it's actually quite simple. So we're going to open up a terminal. So Ctrl T will open up a terminal and I'll zoom in here so you can actually see. And then we'll do some tiling here so we can actually see all this stuff. So the first thing we're going to want to do is install Git. So this is something that is actually not on the GitHub page. But we're downloading a Git repo so we actually have to install Git. So sudo apt install Git like this enter your password and it will install Git real quick. Once it's done we can clear that. Now what we want to do is take this line right here copy it. Ctrl shift Vita paste hit enter it will clone that repo and then we'll CD into the repo which is just unsnap and we'll do an alice here. So what we need to do first is do dot slash unsnap like this and it will give you a warning say care has been taken to ensure the script is safe. The generated scripts will remove applications and data. Please ensure you have backups in case you need to recover data. Also note significant disk space may be required to migrate while both snaps and equivalent flat packs are installed. Basically what this is saying is first you're dealing with removing stuff so there's chance that some things might break. So if there's an application that relies on a snap that you are using that is possibly running in the background you may have some problems or if you get interrupted between running the scripts that this generates it's possible that some data is corrupted or some data that is being relied on by some programs might not be there anymore whatever. Make sure you have a backup. The second part of this is basically saying that at one point during the process of doing this you're going to have both flat packs and snaps installed and you'll have versions of your snaps and flat packs both installed at the same time so that's going to take up a significant amount of space you'll not want to do this on a system that has just a puny hard drive or something there's a chance that you might actually run out if you have a ton of snaps now this VM that I'm running in right now has 25 gigabytes and I've already run this once on a different VM it worked fine so on a base version of Ubuntu you're probably not gonna have a big deal but if you have a ton of snaps that's something to keep in mind so just go ahead enter to continue and that's all it's going to do now it's going to have going to have some warnings here for the snap store because of course there's not a corresponding flat pack for the snap store that'd be silly if you have snaps that you've installed yourself that didn't come with Ubuntu there's a chance that there's no equivalent flat pack to install to replace it in that case you'll see warnings here and you'll know that you need to make some choices coming up on whether or not to keep snaps installed or not so let's go ahead and see what happens now because right now we've done absolutely nothing we've just created some scripts so that the base unsnap script just actually generates more bash scripts that's all it does so if we clear this and then we can actually close this here and we do an ls now we'll see that there's now a directory called log dash whatever it's log dash the date and time that the unsnap script has run so what we need to do is cd into log whatever and then we can do another ls here now what you'll see here is several different scripts that the unsnap script created so the first one is a backup script so what that will do is it will back up the data that it's going to delete i'm not actually sure the specific data that it does back up but it will at least perform some type of backup of the data you're about to delete so in order to run that you do dot slash zero zero backup do that and it will save the data of the some of the snaps that it's going to delete again it's not all of them but it'll be some of them i'm actually unsure of where it actually saves that backup but i'm sure it's locatable if you absolutely need it so once you've done that you'll want to go through these in order so the first one you'll want to do is installs flat pack so dot slash zero one and then enter it will install flat pack now you'll want to reboot your computer at this point because flat pack will not add the the directories where flat packs are stored into the path until the system has been rebooted so just do a pseudo reboot like so it'll reboot the system real quick and once you've booted back into the system cd back into unsnap and then the log for directory we'll do that ls again so we've done zero zero we've done zero one the next one is zero two so dot slash zero two and what this will do is it will enable flat hub so basically what this does is flat pack itself is just the package manager similar to what you'd get with apt and just like with apt it doesn't have access to every repo that's available to it out of the box you actually have to enable some of those repositories using ppa's or whatever in the case of flat pack you'll need to enable flat hub which is basically just a repository so that's what this script does so dot slash zero two enable flat hub enter for that it'll ask you for password do this and you're done so that one's a real quick script there should be no output other than asking for your password so the next one is going to be where we're going to start the process of moving to flat packs for the snaps that we had installed so we'll run dot slash zero three and this will install all the flat packs that was able to find equivalents to of the snaps we had installed if that makes sense so we'll enter it will install the flat packs now this will take a little while and the more snaps you've had installed and the more equivalents that it found the longer this will take so for sure in my case it's going to find a icon pack it's going to find firefox it's going to find a couple other things as well so it will take a few minutes okay once that's done now we get to the process of actually removing snaps so there are two scripts that do this so the first one removes the snaps themselves the second one removes snap d so this is where you're going to want to be a little cautious because if you are in a situation where there were not equivalents flat packs for the snaps you have installed you may not want to do this step because you may have programs that you absolutely need in order to do your daily work or whatever and if you remove the snaps or snap d those programs would go away so what you would do instead was just remove the snaps that you had equivalents for and leave the rest you wouldn't do the 99 one at all for everyone else if unsnap found equivalent flat packs for the snaps that you had installed and you're happy with that the next thing you want to do is dot slash zero four and this is going to remove the snaps that you have installed so we'll do this it will be all in one line it will just take a couple minutes and then the last thing you'll want to do is run that last script and what this will do is it will completely remove snap d from your system so you do dot slash 99 like this do this and it will remove snaps I'll ask you if you want to if you're sure you hit why it will do this and then it's done so now if we tried to do snap list you can see the command snap is not found what can be installed with sudo apt install snapd so snaps are gone but where's all of our programs right so we know install flat packs so if we do flat pack list we'll see that we have firefox the yaru gtk theme and a couple other things that were also snaps at one time but are now flat packs so if we open up firefox like so we'll see like this and it's right there it came underneath it because that's the boon too for you but that is firefox and that's no longer snap it's now flat pack so that is unsnap now one thing you should know again like I said before is that this is alpha software it may not work for you especially if you've made a lot of installations of snaps on your system so if you've installed a lot of snaps the more snaps you've installed on your system the more likely it is that unsnap won't be able to find equivalent flat packs to install for you because the repositories of snaps and flat packs they're not one to one not everything that's in flat pack isn't also in in snaps I should say flat hop not flat pack but you get the point so just keep that in mind is that this may not work for you it's still in the early stages I know they're still working on it and the only reason I'm really covering this is because I think it's really cool and for me personally I think flat packs are where it's at now they definitely have their own problems the installation syntax that you use in the terminal is not great even though there is an alternative for it but the the syntax that they promote is not fantastic especially in flat hub if you scroll down on a on an app page on flat hub you'll see this like flat pack install com dot whatever that's not great so that's definitely a problem and it does have some of the speed issues that snaps has so we don't want to say that they're the that flat pack is the most perfect thing ever it definitely can be slow on occasion but it's definitely not as slow as snaps so I think that flat packs are kind of the way to go and this script makes it quite easy as you saw to move from snaps to flat packs on a boom too which is probably still one of the most widely used distributions out there so if you have comments about this you can leave those comments in the comment section below you can follow me on twitter at the linux cast you can support me on patreon at patreon.com slash linux cast I'd like to thank my current patrons Robert Sid, Devon, Patrick, Fred, Kramer, Maiglin, Jackson, I'm cool, Steve A, Sebrega Linux, Gary, Samuel, KB, TGV, Heath, Andy P, Mitchell, J-Dog, Carpenter, Dated, Jamie, Sean, Odin, Martin, Ross, Eduardo, Arch, Center, Merritt, Cam, Joshua, Lee, Peter, A, Crucible, Dark, Benefic, Times, and PM. Thanks everybody for watching, I'll see you next time.