Using Pacman on Arch Linux: Everything you need to know

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so in this video I want to give an introductory but also pretty comprehensive view of pacman the Arch Linux package manager that's where the name comes from which of course is not just used for arch but Manjaro and tear goes you know parabola all the other arch base distres it has a bunch 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 is sort of pac-man commands are sort of divided into general categories like for example there's capital s S stands for sinc usually has to do with either installing your updating programs or really just keep you keeping them synched 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 route but if you want to install Emacs you just say sudo 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 that you can also give it a whole lot of sub options for example if the if the the one other most basic arch command that you might be running relatively often is pac-man s why you now this means basically update all my programs if there are new additions of them on whatever mirror I'm looking at but you might ask why specifically do we have capital S why in you now capital S that again is just sync that's just a general you know sort of command of which Y and you are sort of sub commands but why specifically means if you just run it by itself that will synchronize your package database no updating in 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 why that's what it's gonna do now pac-man su on the other hand is update those programs that are already detected in if you've already run pac-man why you can run pac-man you to update them but you really should run them all at once at 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 forum you really should you really should run them pac-man sy you 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 how pac-man su this won't check if you just checked your remote the remote repositories a couple minutes ago but if you run it with two y's it will it'll force it to 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 and install them later so that's something that I I sometimes do in the background I'll have a script to 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 can the commands sudo apt-get update and sudo apt-get upgrade now these are equivalent to packet so this command here this is pac-man capital sy 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 you're near a little confuse what the equivalent or 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 s for search and I can just say Emacs and it's gonna print out all of the all of the programs found that have Emacs either in the title or in the description and you could also fall you know search specifically for a reg X you know let's say something that starts with Emacs or something so you you can get things a little more specific you if you want but in general these are the main capital S commands you're gonna be roaming 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 D 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 want 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 D are 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 Eid or you don't need the rest of those either so you might as well you know get rid of them so you can also add in the s4 dependencies as well you of course need to run sudo and in this case the idea 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 in and that is sometimes there are system config files that will be installed with the program these aren't like dot files you know 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 an if you're uninstalling a program unless you're dealing specifically with the system config files which are usually not you're usually change your own dog 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 pac-man capital R in s and then whatever program it is so but though 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 pac-man but one other one that I've used pretty often is capital Q now if you just run that by default that's gonna 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 law Tech 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 X CB util 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 gonna show you is you know far fewer programs you 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 or that are automatically pulled you just want to see you just sometimes just want a 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 of 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 pac-man 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 keys so you don't have you know the the version name or something else like that now additionally you can specify for example pac-man cue in this is all the programs that are installed from main repositories if you include lowercase in or lowercase M on the other hand 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 there's some time a little 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 G conf 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 dependent I build the pendency or something else and whatever require required them no longer requires them so if you run this command you're basically gonna get a list of programs that you don't necessarily need most of the time I'm definitely gonna keep go sometimes I'll use that I just um the reason it's here right 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 that's a basic look at the command-line options you can give to pac-man 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 you know get rid of dependencies that you do 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 Emacs you can search capital you can say capital Q s to search for Emacs on the local repository there's nothing on my computer Emacs related so anyone so in addition to that I also want to talk about some of the options you can add to what is it pac-man yeah Etsy slash pac-man Kampf so this is the pac-man 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 cash 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 Emacs or something like that you'll notice that I have a bunch of color in the output of pac-man 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.com 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 um let's see if I run sudo pac-man well if I update or something like that it will or I think maybe it's not in this output but it will provide you checks to see that there is enough dicks disk space on your computer stuff like that you can also change other things so notice the output of this where I 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 gonna say no here and then I'm gonna rerun this command and what this is gonna do it actually instead of listing those out in one big paragraph it 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 you know it is one potential option if you if you want it and also this right here I love candy if you put it in your pac-man coffee it's sort of a I guess Easter Egg it will change the I guess the loading bar to like a literal pac-man that's like eating stuff on your screen so you know 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 pac-man D slash mirror list and this of course is the sequence of mirrors that pac-man 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'm gonna 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 preferred 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 were like you're updating your packages and it says oh could not connect to a blahblah 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 pac-man but of course check the pac-man menu manual at man pac-man or check the arch wiki 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 you 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 gonna happen is you are gonna fill up your disk space with a bunch of old packages that you're never gonna 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 gonna 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 up the obsolete package repositories now to do that it is super simple it is pac-man 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 had you know we're 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 8 gigs or something every once in a while someone will install and install with that you're definitely gonna wanna want to run pac-man capital s capital case 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
Info
Channel: Luke Smith
Views: 128,238
Rating: undefined out of 5
Keywords: gnu, linux, tutorial, introduction, unix, philosophy, minimal, minimalism, minimalst, computer, programming, program, i3, i3-gaps, vim, emacs, vi, tex, latex, markdown, git, github, groff, arch, gentoo, distro, distribution, distrobution, ubuntu, fedora, thinkpad, floss, free, open, source, foss, software, pacman, install, sync, repositories, multilib, pacman.conf, aur, user, root, uninstall, remove, -Syyu, -Sc, -Syu, -Su, search, query, list, packages, upgrade, update, apu, helper, cli, apustaja, pepe
Id: -dEuXTMzRKs
Channel Id: undefined
Length: 17min 43sec (1063 seconds)
Published: Tue Mar 05 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.