 Arch Linux and Arch Linux-based distributions are very popular these days. So many of our popular desktop Linux distributions are Arch Linux-based these days. And as such, most of you guys are probably familiar with a lot of these Arch distributions. Most of you guys are probably familiar with the AUR, which is this third-party repository of software that has thousands, tens of thousands of packages that people like you and me, just regular people, people that are not part of the official Arch Linux team. They can go put things in the AUR, you know, programs that normally you'd have to jump through some hoops to go get, but that's the beauty of Arch Linux. As a matter of fact, the AUR is probably why Arch Linux has gained such a large following here in the last few years. Now let's talk about how to install these AUR packages, because most of you guys are probably familiar with AUR helpers like Yeh, and Paru, and Aura, and Trizen, and several others that are out there. But did you know that you can actually install AUR packages without the need of installing one of these AUR helpers? And that's what we're going to talk about today. Now let me switch over to my desktop, and I'm going to go ahead and open a terminal emulator, and I'm going to zoom way in. Now if you just installed Arch Linux using the command line installation process, right, you installed Arch Linux the Arch Linux way, you can't just automatically start installing things from the AUR, because the AUR does have some dependencies that have to be installed. And even though it's not required for you to install this package when you're installing Arch Linux, for me, every time I install Arch Linux, I know to actually install this package here. It's a meta package, base-develop. And this includes a lot of build tools such as make, and those kinds of items that are really needed to build packages and to compile software. So go ahead and make sure if you're running Arch Linux or an Arch Linux-based distribution, most of the Arch-based distributions probably already have base-develop installed because they're already expecting you to install things from the AUR, but just check, make sure it's there if it's not installed that package. Now one other thing you could do before you start installing things from the AUR, this is kind of advanced, and I would say 99% of you guys probably don't need to go play with this file, but with sudo privileges, open up the slash etsy slash makepackage.com file. I'm going to use Vim in my case here. And what this is, this is a config file for the make package program. Make package is the command line tool that actually builds Arch packages. You'll see that in action here in just a second, but these are some settings that you could play with for the make package command. The only one that I would say most people might have a need to go play with, let me scroll up toward the top of the file, you have these compiler flags. There is this line here, make flags equals, and make flags equals, you see mine is set to dash j 25. Now what this needs to be, it needs to be dash j and then a number. The number needs to be the number of threads for your CPU plus one. So I have a 24 thread thread rubber. So that's why my make packages variable here is set to dash j 25. If you had a four core CPU, four thread CPU, it'd be dash j 5, right? So that's the only variable that you might need to play with. If you install Arch based distributions, they typically set all of this up for you. So you typically don't have to go and do anything here. Other than that, most of this stuff is really advanced stuff for people that are actually developers, like if they're building their own Arch Linux packages, maintaining their own repositories and doing some unique stuff that really veers from how Arch Linux does things. For example, you could change some of the compression defaults, these commands here, you could change the extensions for building the packages. By default, we're going to use ZST, that particular compression, Z compression. But if you wanted to, you could change the extension defaults to whatever. Let me quit out of that. Again, most people are not going to need to play with that file. Next, you need to get the URL of a AUR package that's currently hosted over on the AUR. I'm going to open up a web browser and I've got a quick link here to the Arch AUR because I use it all the time. And I could search for something that I know isn't the AUR like brave, the brave browser, brave dash bin, right? And if I clicked on that, let me zoom in here, the font for this page. By default, it's a little small, right? And there's a lot going on. But you can see the very first link here, get clone URL. So I could grab that and I could get clone this URL. And it would download the package build file. The package build file is what we need to actually build the package. So if I wanted to build brave, for example, I could grab that. Or if you already knew the name of the package, you don't even have to come to the web browser half the time when I'm installing things from the AUR. I already know the name of the program. So for example, I could just do a get clone. And then if I knew the package name, for example, here's one I often get because it's my own package that's hosted in the AUR. DM scripts dash get and the format for these URLs are always HTTBS colon slash slash AUR.archlinux.org slash nameofpackage.get, right? So if I get rid of this, it would just be package name, right? So that's the always the format. So since I already know my package is called dmscripts dash get, I could just do a get clone. And now if I cd into this dmscripts dash get directory that it just cloned, right? And do a LS, there is a package build file. Now, the package build, before you actually install any AUR package, it is highly recommended that you read the package build just to make sure it's not going to install anything weird, just to make sure that it's not going to do anything damaging your computer, like deleting important directories and things like that. So to be responsible with your favorite text editor, or you could use the less command, if for example, if you're in a TTY or whatever you want to use. But open that file and make sure to actually read it. Now, all Archlinux package builds kind of followed the same format. They all have the same variables assigned for the most part. I've done videos in the past explaining how to create your own package builds. But essentially it is a bash script. All of this stuff at the top are variables that you give certain values. For example, package name is a variable for the name of the package. In my case, dmscripts dash get is the name I chose for this package. Package version, for example, there's the version, the license that I license it under the GPL3, et cetera, the depends or the dependencies. And then once you get past all these variables that you assign, you have three or four, maybe five different functions that you could include. For me, I include a function here called PKGVER for package version. This automatically updates the version of the package for this particular program here. And then build is a function to obviously build the package so it doesn't make. And then the package function here actually does the make install. So it actually installs the package. I also have a post install function that does a man DB, because I do include a man page with dmscripts. So that is a package build. Most of them are going to look very similar. The one thing I would suggest checking in the package build, check the dependencies, right, make sure it's not going to install a whole bunch of stuff, maybe that you don't want. Also check the conflicts. So these are packages that it will conflict with and make sure that it's not going to remove some packages that maybe you didn't, you weren't prepared for it to uninstall as well. And then check these kinds of functions here, these bash functions and make sure it's not doing anything weird like doing a RM-RF, your root directory or your home directory or something like that, right? So make sure everything looks normal. And then once you've read the package build, inside the directory where the package build lives, this has to be run inside the directory where that package build is at. Do a make PKG, make package, and you could give it a variety of flags, but typically you want to do dash s for sync dependencies. So this will automatically resolve and install any dependencies that the package may need. And these are dependencies found in the standard arch repository. If there's dependencies on other AUR packages, it's your responsibility to go install those first. But this will install all the dependencies that are just standard arch packages. And then give it the I flag as well for install the package after we make it. And I don't have to specify package build or anything like that. It knows make package works inside a directory that includes a file called package build, so just make package space dash si. And if I do that, it's going to build the package for us. Now I already have DM scripts installed on my system, but there's no harm in me installing it again. So I'm going to go ahead and let it build the package and then install the package. And there you go. And just to verify that DM scripts work, if I do a super P H for the DM hub, right there is that. So it does work. Now inside this directory that we just installed the package from, if I do it LS, it's still left this here, this pkg.tar.zst file. That is the actual binary package. Now we told make package to go ahead and install that package for us since we did make package dash si. But if you do make package without any other arguments in the directory, all that's going to do is make this file for you, that binary package. And then after that, you would then separately install the package with Pacman. So just like any other Arch package, you install it with Pacman. That's up, you do sudo pacman-u and then you would give it the path to DM scripts, you know, the rest of the package name there. And matter of fact, just to verify that works, I'll go ahead and reinstall and you can see it reinstalled the package. So let me clear the screen. I'm going to CD back into my home directory. Let's talk about how do you update AUR packages manually? How do you do that? Well, here's the thing. You're not using a AUR helper. And again, the AUR is not officially supported by the Arch Linux team. It is your responsibility to actually go and manually install updated AUR packages. So if the AUR package has been updated, you need to figure out that there's a new version available, right? And then you need to install the new version. So it's a little bit of a hassle. Now most Arch Linux users aren't going to have a ton of stuff installed from the AUR like me. I have a million programs installed on my machine. I probably got like 2200 packages installed on my workstation here at the office because I install so much stuff. I probably don't have more than about 15 AUR packages installed in this machine, right? So it's not hard to manually manage your AUR packages if you don't have that many of them installed. So what you need to do to update a program, you would need to CD into the directory you cloned before. So what you need to do is you actually need to keep all your cloned AUR package directories, right? So keep a special directory for nothing but AUR packages. And then keep all of those get clone name of program directories in that directory. And then what you need to do now that you're in that directory, remember we get cloned it, right? So you can always do a get pool. Get pool will get any updates. And you can see in this case there hasn't been an update already up to date. But if there was update to the package build, for example, there's a new package build because the version number changed or something changed. It will pull that down. And then all you need to do is do make package dash SI again to actually build the package and then to install it. So it's really simple. It's not complicated to manage your AUR packages without something like Yay or Paru. Now, having said all of that, do I manage my own AUR packages manually or do I use a AUR helper? I use a AUR helper, right? I use Paru typically. I also have Aura installed on my machines as well, both fantastic AUR helpers. And even though you can manage your AUR packages manually, it's not hard. But you do save a few minutes probably every month by having a AUR helper do some of this for you. For example, the get clone and then the get pools to occasionally check for updates, you know, these AUR packages have all of that streamlined and they just make it a breeze, right? They just tell you when your packages need to update. I don't have to, well, let me do a get pool occasionally and see if there's a new package build. No, no, no, no, I don't have that kind of time. Most of you guys probably don't have that kind of time either. So AUR helpers are nice, but it is a good idea to know how to build these packages yourself with make package, especially if you're going to build your own packages eventually for Arch Linux or an Arch Linux based distribution. Like I maintain my own repository of software. So I need to know how make package works because for my own repository software, my own packages, I have to build them myself using make package, right? I can't use par or yay or anything to build those packages for me. So it is a good idea if you're Arch Linux power user and somebody that may get into packaging packages for Arch, it is a good idea to know how make package works. Now, before I go, I need to think a few special people. I need to think the producers of this episode. Gabe James Maxim, homies to bald, Matt Mimic, Mitchell Paul, Royal West, Armored Dragon, Bash Potato Chuck Commander, Ingrid George Lee, Marsdrom, Methods Nate, Erion, Paul, P.S. Archimador, Polytech Realities for Less Red Profit, Roland Touls, Devler Williams, and a bit these guys. They're my highest tiered patrons. Over on Patreon without these guys. This episode about installing AUR packages manually, it wouldn't have been possible. The show is also brought to you by each and every one of these fine ladies and gentlemen. All these names you're seeing on the screen right now. These are all my supporters. Over on Patreon, I don't have any corporate sponsors. I'm sponsored by you guys, the community. If you like my work and want to see more videos about Linux and free and open source software, subscribe to DistroTube over on Patreon. Peace. And of course, Pamac can install things from the AUR so can Octopi.