Arch Linux Package Management: What you need to know

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
everyone and welcome to my quick video on arch linux package management what you need to know my name is Josh and let's get started so the motivation for this video and topic was I was helping one of my roommates set up his first arch system and going through obviously one of the biggest things to wrap your head around especially those who are newer to Linux in general is exactly what package management is why it matters and how to use it and it reminded me of some of the key things that I had first learned when I started on arch around usage of pac-man usage of the user repository yo're as a tool and we found a lot of good info out there that he could reference but we often found as it would go too deep or would focus too much on one facet of doing package management so I wanted to put them in together they kind of glazed over some of the big important topics where you could leave it and get started with managing packages on your system you'll find this leaves out some key details that some might feel are really important but again this is really just something to get started and get a perspective on the different pieces which you could then dive deeper into so the first thing that we're going to talk about is pac-man which is arches package manager so those of you who are a little bit newer to package management in general keep in mind that these tools are something that handles the downloading installation updating and removing packages on your system in most Linux distributions follow this philosophy where you have a package manager that manages the actual software and you use only the package manager to manage software's you have a consistent interface for interacting with what's installed what needs to be upgraded and so on and you've even found over the years that tools have been built to things like Mac which would be homebrew and some Windows like package managers as well to add those types of supports to both the windows and OS 10 in the bottom here you can see the pacman help option which is probably one of the most key things when you're getting started so we'll pull that open in a terminal right now if I were to go in and say pac-man - - help I'll get some information around the pac-man pieces that I can do or operations I can do of course pac-man gives you the ability to check out the main pages just like any UNIX tool so if you want a more detailed overview of pac-man's you that would be a great way to start but just remembering the health operation to get all these different operations you can add will be key and another thing as well as we dive deeper when you do pacman help and you get these listed out note that if you need more details on a specific operation like let's say sink you can add the help flag to that so essentially I'm saying I want to do a pac-man sink operation something we'll talk about if I'm curious of what options that I would have available to me with sink so by running help these are all of the options that I can add to the sink operation so pretty easy with just using pac-man to get the details you need like most unix-like tools nothing special so again pac-man is our package manager and is what we're going to use throughout this tutorial now before we actually install software on our system it's also important we understand this notion of repositories and this is what kind of screwed me up when I was first learning all the different facets of package management so the official repository is that Arch Linux provides are going to give us places where packages are held that tachyon can access download install and so on an arch effectively has these maintained errs they call them that work in these official repositories and own packages make sure they stay up to date they're accessible and so on via pac-man the repositories again accessible via pac-man and sometimes as you dive deeper and deeper you're going to find some of the packages you're looking for might not exist in the official repository or in an official repository so an example when we were working together my roommate and I you're going through and installing things like go or open SSL or nginx but when we dive a little bit deeper and try to install something like pycharm to do Python development we couldn't get that out of the official repository and that's where we need to talk about some alternative ones as well which I'll get into but first let's start off with the official repository and get some perspective on that so as far as the arch official repository is concerned you can go to Arch Linux org and inside of this website you'll actually be presented with a package search option which can use to search for different packages so as an example if I wanted to come in here and pull up a package for s IP calc which is a calculator for subnet ranges does slider notation and things like that to calculate subnets you can see inside of here it will provide what packages are available for the different architectures 32 and 64-bit or other architectures as well as they're available so being 64-bit I come into the IP calc or si key calc and I can see some information about si P calc I can see us in a repository called community now this is still an official repository it's just think of it kind of like a folder or category I can see who the maintainer is the size and information about the package when it was updated and so on in fact man is also going to do a good job of making sure I've got dependencies so if I didn't already have G Lib C it's going to make sure in the installation of Si T calc that it installs deliberately or any other dependencies that are needed for this specific package so pretty simple now most users are actually going to use pac-man to find these packages rather than the website itself so if we go in and once again do pac-man help if we dive a little bit deeper into the sync operation we'll find that this is a way for us to go out to these remote repositories and bring things down but to get started with sync we need to make sure our local database is synced up with the remote database to make sure we know where all the repositories and packages are if they're available so we can come inside of here and you may need to run this at sudo we can do sudo pac-man dash X and in fact I'll even show you if I do pac-man capital S and just do help real quick in the options there's a y flag that I can add that will refresh my local database with that package database that's remote so essentially going back to that command I was just typing in if I do sudo pac-man - capital s for sync add the white flag in and hit enter it is going to synchronize the package databases and bring those down to my system making sure that all of the updated packages or metadata about them and the repositories and so on or now avail so we know that this was part of the community but let's see if we can still just search for FIP cap so if I do pac-man - app again and ask for help another sink slab that we can use is search which takes a regex argument so if we search for IP calc we should be able to see si T calc inside of here so we'll do another pac-man this one shouldn't require sudo - capital after sink lower case X research and ask for IP calc and two packages pop up there is a I P calc that is a different package maybe has different features and then there's s IP calc the one that I was looking at earlier it's version and some details about it as well now on my system I want s IP calc so if you're doing this with me we would simply do a pseudo pac-man - s for sync and then we would ask for si T calc it will let me know hey I'm going to install this package here's the size we'll hit yes and now si P calc is on our system and that's the great thing about the system is it's a singular way to get software on and installed and maintained so now that si T calc is there we should be able to run si P count on our system and this particular tool you can do things like plug in a slider so if I do a flash 24 it's going to give me details about subnet ranges and information with this tool and now we've got this package installed which is pretty cool now as you dive deeper into working with pac-man you're going to find a lot of more features very helpful to you so another one for example is if I do help again on the sink is the sis upgrade so this is one that will actually go through and upgrade all the packages on your systems rather than going through and trying to figure out which little piece or package you need to upgrade you can do a full system upgrade at once making sure things are up-to-date and secure and so on so effectively if we did a pac-man - at and typically we probably do a Y with this as well just to make sure we've got the newest database info and then a you we can run this and it will make sure everything synchronize now notice this time when it's synced it notice that everything was up to date so no database changes had happened since I last ran the Y command and then it's going to go through and in fact it's even smart enough to let me know hey Josh you were messing around with your system and now you've got some conflicting dependencies you want to remove them for now I'm just going to hit yes to this so actually it end there yes yes yes yes yes and yes possible that you won't even be prompted for these and once I do go through all these conflicting things it will find all the packages that need upgrades and if I do run this update all of these packages will be upgraded of course and that's about it so a nice way to maintain and keep everything up to date cleanly now another thing as well that makes this really nice is rather than trying to figure out where s IP CalPERS IDEs and its dependencies and so on we can very cleanly remove s IP cap from our system so again if we do pac-man health we'll notice that there is a remove command inside of here in the remove command if we do pac-man - our help for remove is going to provide us with some of the remove options in which case we can add in the S flag which is a helpful one to remove unnecessary dependencies so you saw that GC live and some other dependencies could be attached to these packages we install if we uninstall the package we probably don't want all the dependencies to hang around that aren't needed by other pieces of software so we can add that s flag in to ensure that that doesn't take place so once again we'll do sudo pac-man rx we will ask to uninstall si T calc it will let us know how much the removed size is and now that package is no longer part of our system and if we try to run si P calc it's no longer accessible to us because it's been removed very clean easy way to manage these packages now this begs the question when we dive a little bit deeper and we start talking about other software we need what if we're a Python developer and we want to use PyCharm intelligence Python module or ID if you will well once again we can come in here and we could run pac-man search and we could see if there are any pipe PyCharm packages which you'll notice there aren't many now this brings open the question of how exactly do we install these extra packages this is where the arch user repository comes into play Aur is going to be a location where you can find lots of extra packages specifically ones that are maintained by the community now for security reasons and to make sure that you can trust pac-man with only official packages it is something that pac-man does not access directly and you have multiple install methods that you can use to find things on the arch user repository and then install them on your system obviously the big caveat is being maintained by the community there's less of a guarantee that it works it's more on you to make sure that software is safe maintained correctly and so on so let's use PyCharm as an example here if we come in and head to the arch user repository which is aur Arch Linux org we can see a very similar layout where we've got a package search option and if we search for PyCharm inside of the package search we're going to get a bunch of different packages now once again being maintained by the community these votes and popularity counts might be quite relevant to me along with information about the maintainer I want to make sure I'm not putting any type of bad software on my machine now PyCharm community seems to be used quite a bit I'll come inside of PyCharm community and you'll notice the details are a little bit different there's a git clone URL there's an upstream URL there's in this case a larger list of dependencies that's just because it requires a lot more and then you'll also see Commons you can even see where people are having issues in the maintainer potentially fix those issues and so on so a pretty active community now we do need to get PyCharm community on our system and there's a couple ways we can do this we could actually download effectively the package and then tell pac-man to install it directly one approach that I prefer to take is just grabbing the git repository find it quite simple so if we copy the git clone URL right here one thing this approach will require you to do is to have it on your system so if you have um if you effective have get inside of your system already you're good to go or you may need to install get through pac-man which is seeing a official package in the official repository you should be able to install it easily so get on our system I move to my temp directory just so all the skip stuff will get deleted when I restart my system and all we've got to do here is clone down that repository PyCharm - community git and it's going to bring down that git repository which is actually going to just have a pretty simple file inside of it if you look inside of PyCharm community you're going to find a package build file and typically this is the key file that you're going to see inside of these packages if you will if you look inside a package build it's actually going to be a shell like script that defines exactly how the package should be built some of the dependencies and optional dependencies that are needed to install this package some check some information and so on nice thing is the maintainer has put these packages together for you so generally you won't have to message with mess with the package build file itself what you will have to mess with though is the make package command so effectively what make package is going to let you do is go in and make a package based on the package file so inside of here you can see that there is a sync dependencies which basically says when I make the package if I'm missing any dependencies on my system I will download them and once the package has been built I'm going to go ahead and install the package inside of here as well so we'll run the S&I flag together here make package si note that I'm inside of that git repo for pycharm community and now it's effectively going to come in here and start downloading what it needs along with installing once it's built now this process will take longer than a normal pac-man download because there is a build cycle that it's going to go through and so on so once it says complete we'll come back and make sure that PyCharm is able to be launched on our host machine now that the build is complete I'll throw my password in as needed by the package manager and it will prompt me for the install letting me know exactly how much space is going to take up so run the install which is again the quicker or the process building is the longer and once this finishes for the installation it should now be available on my system and able to be ran now this application being GUI based effectively we could start it up from terminal or if you have like some type of app launcher you could do it from there as well so in my case I'm going to go ahead and just launch it from terminal let's start out so I'll run ty charm I'm going to direct all of the output from this app to Devin we'll make sure it doesn't bother my window I'm going to also escape out of it so that my terminal can keep taking commands and it'll just be a PID in the background so I'll run that and boom there's a charm so five charms now installed on my machine I can set up projects work with them and run them and that all came out of the arch user repository that you see in the left here now we could have just gone to IntelliJ website and install pycharm directly but one of the reasons that we did not take that approach is we want pac-man's to manage all of our packages so if I look inside a pacman and check out the query operation we can do a query search with the S option so we'll do a pac-man qsr and ask for the PyCharm and we can just do it fuzzy here PyCharm if we can see on my system that pac-man is aware of pycharm living on my machine which is great which means that I now can manage it uninstall it and so on from this location so hypothetically I am bailing on pycharm I don't need it anymore so I can come inside of here and basically remove pycharm so I'll do pac-man - R and add the essent to make sure all optional dependencies are gone I'm going to do pycharm community since that is the full name of the package and hit yes and now pycharm has been removed from my system so it's no longer on here if I try to run pycharm it is of course not going to launch which is exactly what I want so now you've got this idea of the official repositories and the user repositories one thing that has also come to fruition in the arch community is these notion of aur helpers as the he puts it now it's probably the most common one and basically how it is like a tool that extends pac-man's default functionality so not only can you use it to access the official repository and remove you know add packages just like pac-man but you can use it for the arch user repository as well it's got built-in support you'll find it to be a little bit more interactive with how it gives you options and prompts you again the convenience of mixing both Aur and official repos is quite nice and it's effectively installed like any other package so yeah it's just another package we bring down from the user repository and set up personally I don't use the hour I just strictly use pac-man and then go out to the aur website get the git repo as I showed you to install packages but starting out you might want to give this tool a shot because it can be a really nice convenience if you go out to the arch wiki or just search for our install you'll find the gallery page and it has some basic instructions on how to set up the hour on your system so if you're following along you may just want to pause now and run through these quick commands they should look familiar to you because these are effectively the same commands that I was using previously when I was going in and installing PyCharm on my system so if I come in and make package once again si to grab dependencies and install it's going to have me put in two pieces here right now I'm doing the package query package and in a moment I'll do the actual Y our package itself so come in here and all these are basically going to be junk directories for me but I do need to grab the git repo for each one all right so come in and then CD into yahwah and once the ours is even to make package si again oops make sure I do the I in there as well go through builds prompts me to install pretty simple and now we have this Y our tool on our machine if we start off with make sure I get I here so it doesn't look like I'm running a binary so do Yeller and do help and boom there are our commands just like you would be used to as pac-man plus or minus some so generally you should be able to look things pretty easily inside of here so we used two packages in our example so far si P calc part of the official repo and pie charm which was a user package so let's check this out if we do ya're t' and do the same search command we had done before and asked for si P Cal or we'll just do IP Cal to keep it simple there are the two packages we had seen before plus some extra ones inside of aur so you can see how it kind of mixes these these might be a Python implementation of IP calc or something like that so we get an expanded list inside of here and when we run things like install we'll be prompted for which one we want to use and so on now similarly as you can see from the aur here if we do run the hour and we do a search for pycharm unlike pac-man we actually will get all these aur things we have seen from the website so here's pycharm community that we had set up previously so the installation process through our is identical to what we're used to with pac-man we would just use the sync operation provides a package name and hit enter and effectively we're going to go through a similar process where it's actually going to go out and start the build process for this it'll also let us know that hey this is an unsupported package so make sure you trust it and ask us if we want to edit that package build file descriptor I was showing you earlier generally I don't edit the package build file if I really need to customize something and I will prompt to continue installing pycharm community with Y again this is how it's a little bit more interactive than pac-man giving us some more prompts and things of that nature now I've just got to wait for the actual tarball to download and once that download is incomplete and all of the different build stuff gets set up correctly I should be set to install pycharm and now that the build is completed and cleanup has completed I will hit yes to continue installing provide my password and very similar to what we'd seen before with pac-man it is now looking to install which I'll hit yes and it will install on my system in which PyCharm should officially be accessible to me so now it's installed and will actually go in and I'll do this through an app launcher this so go to a new workspace so again if you have an app launcher like if you're running some type of like unity or if you're using some type of xfce some some type of other GUI with some other app launcher you may have a different approach in this case I'm using a 3 so the i3 launcher will be what I use and if I type in PyCharm up here you can see pi term shows up I can launch that application and now PyCharm is accessible to me and I can begin using it so you our to the tool you may wish to check out again you can kind of mix and match so if I go in with pac-man and do a query search for pycharm you'll see it's aware of pycharm and of course if i go inside of here with yahwah and do the same thing it is also aware of pi charm so depending on if you find the feature set very very helpful you may see yahwah being a big benefit for you nonetheless I hope this video gave you a pretty good idea of what exactly the different facets of package management at least from an interest and point are available to you on arch linux also note that a written version of this content would probably a little bit more context around some of the topics is available at my site octet comm so you'll see kind of a walkthrough with all the different commands if you want to try them yourself and you can also grab me on Twitter as well again hope you found this helpful and best of luck using arch linux
Info
Channel: octetz
Views: 22,912
Rating: undefined out of 5
Keywords: Arch Linux, Linux, package management, pacman, pacman linux, arch linux essentials, linux getting started
Id: SckNg11n3MY
Channel Id: undefined
Length: 23min 23sec (1403 seconds)
Published: Sun Jan 15 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.