 So in this video, I want to give an introductory but also pretty comprehensive view of Pac-Man, the Arch Linux package manager That's where the name comes from, which of course is not just used for Arch, but Manjaro and Terrogos, you know, Parabola, all the other Arch-based distros. It has a couple main commands and a lot of sub commands that are very elegantly expressed, but they can be a little confusing to introductory users. But we'll go ahead and get into it. So I'll go ahead and say Pac-Man commands are sort of divided into general categories, like for example, there's capital S, S stands for sync, usually has to do with either installing or updating programs, or really just keeping them synced with remote repositories, or capital R, or capital Q, R is removing programs, Q is searching locally for programs, and so generally, Pac-Man commands come in the form of a capital letter and then sometimes a lot of lowercase letters that have different options. So that's generally what you want to keep in mind. Now, if you know anything about Pac-Man, you probably know that to install something, you run the following command Pac-Man, capital S, and then whatever you want to install. So if I want to install Emacs, and of course, you do have to run this as root, but if you want to install Emacs, you just say Pseudo Pac-Man S Emacs. Of course, I don't actually want to install Emacs, but that's how you would do it if you actually wanted to. So this is capital S by itself, but you can also give it a whole lot of sub-options. For example, if the one other most basic Arch command that you might be running relatively often is Pac-Man SYU. Now, this means basically update all my programs if there are new editions of them on whatever mirror I'm looking at. But you might ask, why specifically do we have capital S, Y, and U? Now, capital S, that again is just sync. That's just a general, you know, sort of command of which Y and U are sort of sub-commands. But Y specifically means if you just run it by itself, that will synchronize your package database, not updating anything at all. It'll just look at your remote repositories, look at those mirrors you're looking at, and it will try and update. Actually, I don't have a good internet connection here, but that's what it would do if I did. So if you run Pac-Man Y, that's what it's going to do. Now, Pac-Man SU, on the other hand, is update those programs that are already detected. If you've already run Pac-Man Y, you can run Pac-Man U to update them. But you really should run them all at once. Arch Linux is by default, it only is compatible, or it's only made to be compatible with full updates. So it's best to always run these at the same time. Hence, why, if you've ever read on some form, you really should you really should run them Pac-Man SU. Now, of course, there are other options with this. For example, by default, if you just run Pac-Man Y, that is going to sync databases if you haven't synced them recently. But if you definitely want to retry, you know, let's say, I'm not quite sure what the time horizon is, but I think, you know, Pac-Man SU, this won't check if you just checked the remote repositories a couple of minutes ago. But if you run it with two Ys, it will. It'll force it to double check. Another thing that I often have it run is W. W, I have a command run in the background. And what W does is it actually goes, it doesn't install the programs, but it actually downloads them. So you can choose to manually install them in install them later. So that's something that I I sometimes do in the background. I'll have a script run that and then I'll choose to manually update them myself. Now, if you're coming over from Debian or Ubuntu, you're familiar with the commands sudo apt get update and sudo apt get upgrade. Now these are equivalent to Pac, so this command here, this is Pac-Man capital S Y, and this is Pac-Man capital SU. But of course, on Arch, you can just run these as one thing like this. That's, so if you're coming over and you're a little confused what the equivalents are, that's what they are. Okay. Now, if you want to look for a program, you know, let's say we want to look for just anything Emacs related, I can run Pac-Man capital S and then lowercase for search. And I can just say Emacs and it's going to print out all of the programs found that have Emacs either in the title or in the description. And you could also search specifically for a reg X, you know, let's say something that starts with Emacs or something. So you can get things a little more specific if you want. But in general, these are the main capital S commands you're going to be running. Now the main, if you, so that's installing programs and updating programs. If you want to get rid of programs, if you want to uninstall programs, that's relatively easy as well. Now the basic way to do it, let's say I have a program VI-DEAR on my computer. Let's say I want to get rid of that. The default way is just to run Pac-Man capital R for remove and VI-DEAR. But I don't recommend you actually run this. You sort of want to run it with some extra options. Now by default, well, let's say a lot of times when you install programs, they actually pull a bunch of dependencies. So if maybe VI-DEAR pulled a bunch of other files simultaneously when I installed it. So you actually want to get rid of those as well. If you're getting rid of VI-DEAR, you don't need the rest of those either. So you might as well get rid of them. So you can also add in the S for dependencies as well. You of course need to run sudo. And in this case, VI-DEAR didn't have any dependencies. But if it did, this command would be prompting me to remove them as well. So I recommend always use lowercase S when you're removing a program. And another sort of mainstay is lowercase and that is sometimes there are system config files that will be installed with the program. These aren't like .files. They're not in your home directory, but system config files. And a lot of times you don't really, I mean, if you're uninstalling a program unless you're dealing specifically with the system config files, which you're usually not, you're usually changing your own .files, you usually want these removed as well when you uninstall a program. So the best way to uninstall a program on Arch Linux is to run pacman capital R in S and then whatever program it is. But that's an explanation of what it's actually doing. So we've talked about capital S, talked about capital R. The other one that I think is useful is capital Q. Now I'm not telling you everything about pacman, but one other one that I've used pretty often is capital Q. Now if you just run that by default, that's going to list out every single package you have installed on your computer. Now at the same, you know, let's say for example, I actually use this command a lot with, you know, other scripts and stuff if I need to look for something. Or for example, let's say I want to count up all the programs I have installed, I can just take that output and pipe it into word count counting lines and find that I have seven seven hundred and eighty one program. That's actually a lot. I usually have way less than that. But oh, I guess I have LaTeX installed. That's probably it. So you can run just Q to show you all the programs. But I find it, you know, a lot of these programs you don't install yourself. For example, you know, I, you know, I didn't install this XCB utl cursor. I'm not really sure what that is. I can probably guess based on its name. But if you want to see only the programs you've explicitly installed, include a lowercase e in that. And what this is going to show you is, you know, far fewer programs. You'll see this is less than 200. But these are programs that I are explicitly installed by you or by some other program or something else like that. And the nice thing about this is it's a little more intuitive when you're looking at, sometimes you don't care about those dependencies that are automatically pulled. You just want to see you just sometimes just want to list of the programs that you have by default on your computer. So you can keep track of, you know, if you want to reinstall your system on something else, it's nice to know what you have. You can also, I don't think I mentioned it before when I was talking about sync, but a general option you can give pretty much any Pacman command is lowercase Q. And what that does is gets rid of it only provides the program name, not the number or any other fancy details about it. So if you don't want that, you know, let's say you want to take this output and put it into a script or something like that, it might be better to include the Q so you don't have, you know, the version name or something else like that. Now, additionally, you can specify, for example, Pacman Q in this is all the programs that are installed from main repositories. If you include lowercase in or lowercase M, on the other hand, is all the programs installed from the AUR if you have any of those installed. So sometimes you might want to keep those a little separate just so you know that they're both there. And another common command is that sometimes a little useful is this one here. Now, what this is, is basically unneeded dependencies, dependencies that aren't needed anymore. So if you run this, you'll see I have two programs here gconf and go. Now, what this command is doing is it's really showing your orphans, the programs that were, let's say, installed on your machine as a build dependency or something else, and whatever required them no longer requires them. So if you run this command, you're basically going to get a list of programs that you don't necessarily need most of the time. I'm definitely going to keep go sometimes I use that I just the reason it's here is because go was installed I didn't explicitly install this, but it was originally pulled as a dependency for a program probably for building a program. And I no longer need it. So anyway, that's a basic look at the command line options you can give to Pacman I'm not quite done yet. But again, just as a rehearsal so s usually has to do with syncing things up installing programs or updating or something like that. Removing programs I recommend using capital R in s that's sort of the canonical way so you can get rid of all the dependencies that you don't need anymore. It doesn't get rid of dependencies that you do need from other programs just the ones you don't need anymore. And Q has a lot of sub options you can look into it yourself, but it involves usually you know, looking for things on the local repository. Oh, and I mentioned, so you can use capital SS to search for search the remote repository for something, you know, again, Emax, you can search capital. You can say capital Q s to search for Emax on the local repository. There's nothing on my computer Emax related. So anyway, so in addition to that, I also want to talk about some of the options you can add to what is it Pacman etsy slash pacman.conf. So this is the Pacman configuration file. And there are a couple things you might want to contemplate or at least look at you might want to, you know, change. Now, of course, you can change basic stuff like, you know, where you have the cache and log. I don't recommend doing that. And I don't really do any of that myself. But there are a couple things. First off, you probably already noticed that, you know, whenever I run a command, again, let's, you know, search for Emax or something like that, you'll notice that I have a bunch of color in the output of Pacman. That is not default by default, it's actually just all white, but I really prefer having color. So you can actually just put the word color in your pacman.conf file. And that will generate either bold text or call, you know, different kind of color, it makes it a little more readable. So you can see what's going on I just prefer it. So I definitely have that. Additionally, additionally check space, this let's see if I run pseudo pacman. Well, if I update or something like that. It will, or I think maybe it's on this output, but it will provide you checks to see that there is enough disk space on your computer, stuff like that. You can also change other things. So notice the output of this, where it lists out all the different packages in one big list. Another thing you can do, let's say I uncomment verbose package lists. I'm going to say no here. And then I'm going to rerun this command. And what this is going to do, it actually, instead of listing those out in one big paragraph, it gives me this bigger thing showing the old version, new version, the change in each one. You might want this, I think it's a little much, but it is one potential option if you want it. And also this right here, I love candy. If you put it in your pacman, it's sort of a Easter egg. It will change the loading bar to a literal pacman that's eating stuff on your screen. So that's a nice little thing if you want. Aside from that, I think that's pretty much it. You can add, of course, your own repositories in here, or if you want to activate community testing or testing generally, you can do them here. But that's pretty much it. Aside from that, I suppose you already know, but you can change if you haven't already, you might want to at least change your mirror list in Etsy slash pacman D slash mirror list. And this, of course, is the sequence of mirrors that pacman is reading whenever you update. You probably know this already. If you don't, you should definitely look into it. Because the order of servers in this file will determine which server you are looking for when you're updating. And you're definitely going to, so I'm in the United States, I want to have United States servers at the very top, obviously, I don't want to have servers, you know, in Ukraine or something like that. So I definitely, if you haven't done it already, they have some utility for sorting mirrors. I think it's sort of silly, I just prefer going in here and moving up servers that are probably close to me manually to the top, and I find it better. And if you have the kind of error every once in a while, you'll get an error where like, you're updating your packages and it says, Oh, could not connect to blah, blah, blah server, or something like that or no response. That could be as a server problem, where like, you know, let's say this server for whatever reason is down. In that case, you should just comment it out or something every once in a while that happens. That's sort of, you know, a problem on their end, wherever they are. So anyway, hopefully, this is pretty much all you need to know for Pacman. But of course, check the Pacman manual at man Pacman or check the arch wiki. But I hope that this has been a good enough introduction for all of you guys. But anyway, I will see you guys next time. Actually, one more thing, it's pretty important. I just it slipped my mind before, but it is something you might want to think about. And that is eventually whenever, well, whenever you update, whenever you get new packages, you are downloading the new version of the package and that's on your machine. But the old versions are still there. Now, gradually, what is going to happen is you are going to fill up your disk space with a bunch of old packages that you're never going to install again. Now, depending on how many gigs you have in your root directory, it might not matter that much or, you know, you're eventually going to reinstall or something and it's not going to matter. I mean, you can see here I have 13 gigabytes used of my 30 gigabyte root partition. But eventually, you want to clear out all of those old installations of, you know, obsolete package repositories. Now to do that, it is super simple. It is Pacman capital S lowercase C. And if you run that, it is going to ask you, do you want to remove all other packages from the cache? I will say, well, actually, maybe I shouldn't say, well, yeah, I'll say yes. There was something I was doing earlier today, but it doesn't matter for the video. I will remove it. And you'll notice it will take a little bit of time. But once that's done, so again, we have 13 gigabytes used. That's what it was a second ago. Now that we've gotten rid of that, we have 12 gigabytes used. So all of that was just like packages that it, you know, were on my machine that, you know, from earlier installations. And if you have my root partition is 30 gigs, but if you have, for whatever reason, if you had like eight gigs or something every once in a while, someone will install an install with that, you're definitely going to want to run Pacman capital S lowercase C to clean everything out. You might in fact want to have that as a cron job. So anyway, now that's, if you want to know anything else, check the arch wiki or check the manual. But I think that's enough for this video. I will see you guys next time.