 Okay, welcome back everyone. So this video is going to be on what exactly you're supposed to do after you install a minimal distribution of Linux. So what I mean by that is a lot of distributions, most famously probably Arch and Gintu, but other distros as well, Parabola or some things based on Arch or just other distributions in general. When you install them you get a nice black command prompt with nothing installed. And a lot of people are often a little confused after you go through the whole rigmarole of installing the actual system. What are you supposed to do to actually get everything set up, get a graphical environment and stuff like that. So in this video we're actually going to be talking about this. So I did an Arch Linux install video just I guess a month or so ago. And so this is partially a follow up to that. I'm going to be focusing on Arch Linux. I'm going to be giving you Pacman commands and stuff like that. But in essence this isn't going to be very different for any Linux distribution, even those that are not based on Arch. Just because even though you're going to be using a different program to install stuff, it's still the same principles, it's still dealing with the same idea. So anyway, I'll get into it, but we're actually going to cover a couple different things. First off, user setup, setting up users and groups because I didn't cover that in my Arch Linux install video. Usually, depending on what you're doing on your install, you might want a different kind of user configuration. Most people watching I assume just want to have, I mean if you have a personal laptop or something like that, at the beginning you're pretty much just going to want one normal root user that can run commands as a root if they need to. So we're going to talk about that. We're also going to talk about graphical desktops, display managers or how to live without a display manager, which lots of people including myself do. And basics of system D, which you probably actually already know but it's worth at least talking about it in the context just in case you're totally new to Linux or something. So first off, users and groups. So users, you pretty much know what a user is. There are also groups in Unix based operating systems. If you want to have settings for a whole bunch of different users at the same time, you can assign them to different groups. So usually if you just want to add a user, you use the user add command. So what is this going on about? So user add of course, you have a lot of different options. So this command will create a user named Luke and it will put it in the group wheel. And so this M option here, this creates the home directory for the user. G is group as you would expect. You can also set the shell with S or something like that. You can check man user add for all the details. But usually for most systems, people will just add their own user, create the directory and usually add it to the user or excuse me, the wheel group. We'll talk about that in a second. That's sort of convention, but it's also already sort of built into the sudoers file, but we'll touch on that in a second. And once you create your user, you are going to want to have a password. So if you're running as root or anything else, you can just type in password and then your username and that'll prompt you to add a new password. And you know, it'll give you two tries. So nice and simple. And that's really all you have to do to add a user. It's not all you need to do to like get the permissions in sync. But that's, you know, all you need for that. So just so you know, in case you make some kind of error, if you misspell the user's name, if you want to add a new group, if you want to change group settings, you can check out the manuals for user add, user del, group add, group del. There are a couple other ones that you can, you know, look at in these manuals. But just know if you want to do something more complicated than just having a basic user that can run sudo commands, you might want to check these entries out. Now, after you've created your user, your user doesn't actually have the ability to run root commands. So you can't do something like, you know, sudo shutdown now or something like that. It will chide you for even using sudo. So I will say just so you know, you do need to have sudo installed. If you installed Arch Linux with the, I think the base devel group, if you install base devel when you installed Arch, that should have installed sudo as well. But you may need to install that manually if you haven't already. But anyway, to give your user sudo access, all you have to do is edit the etsy sudoers file. Now, I'm going to open that up in my computer here. So I'm going to type in, and of course my user right now, but I'm going to open up etsy sudoers. So this file basically just lists out all the different permissions that you give to different users and groups. Now, I'm going to scroll down here. Mine is going to look different than yours at an initial startup. This line will be uncommented. But you also have the choice of which line, what privileges you actually want to give your users. Now, as I said, we added that user to the wheel group. Now, I've uncommented this line. Now, as the comments above it say, if you uncomment this, it will allow you to run any command without a password. That happens to be what I want on my computer. Like if I type sudo and a command, I don't necessarily want to be prompted for the password just because I've already logged on. That's my mentality. But you don't want to do this on a less secure computer. You may want to uncomment this, which will, you have to basically ask for the password each time. So instead of just, you know, the way I have it set up, you'll never have, with this line uncommented, I never have to type in my password. But that isn't necessarily secure. Now, another option is if you have, if generally you want, let's say, you want people to put in passwords for most everything. But there are some commands like shut down, reboot, whatever, that you don't want to have to put in a password for. In that case, what you want to do is, actually, let me just do it here. I'm going to re-comment these. What you're going to want to do for that situation is you want to uncomment this line, which of course will allow you to run things as sudo with a password. And you can add a line that looks something like this. This is a, this isn't actually in here by default, but it's something that I've added in. And what this says is if you're part of the wheel group, you can run these following commands without a password. So for example, shut down, reboot, mount, unmount. These are the kind of things. So in my, in my larb's configuration, the default is usually you have to put in a password. But for these commands, I don't really care if you have a password or not. You can just run sudo and that's it. So that's one option. You can manually add in all these commands that you want to have users able to run without a kind of password. Additionally, one thing that I really like, it annoys me if I don't have, but this is a little less secure as well, is this line here, which should be in the sudoers file by default. I've uncommented, so it's active. But basically what this line says is if I've already used my password to activate sudo on another terminal window or something like that. And if I open up a new terminal window, I don't have to put in my password another time. Now for my setup right here, it doesn't actually matter because I'm not putting in a password anyway. But if you had one of those setups where you do have to put up in your, put up your password multiple times, or I mean whenever you run a sudo command, this enables it so I can, for example, start a window, put in my password, then start a new window and then not have to put it in when I run a sudo command. So that's another option you might want to keep in mind. So you can also check the other lines in here or check the man for it, but in general that's all you need to know. So once you've uncommented one of these lines, you'll be able to run a sudo command as any user in the wheel group. And of course you can add other commands for different groups and stuff like that, or settings for different groups. But that's pretty much all we need to deal with here. So I'm gonna go ahead and go back. So anyway, once you've done that, you will have a user. You can log out as root and log back in as your user and you can comfortably run sudo commands with, you know, freedom to pretty much do what you want. So when it comes to graphical environments, there are really two options. In fact, the lines between these options are sometimes a little bit vague. There are desktop environments and there are window managers. So desktop environments usually are fully featured. They come with file managers, they come with browsers, they come with everything you need. Window managers on the other hand, that's the stuff that I use. I3 is a window manager. And the idea is a window manager is just literally what it says. It manages windows. And if you want to install the other stuff, you can. And you'll have to do that manually. But the desktop environments usually want to give you sort of a setup where you don't have to worry about like installing everything from scratch or something. So anyway, in order to have a graphical environment generally, you're going to want to install an Xorg server. So there are two packages you're going to want to install. Of course, this is an arch command on different distros. You're going to have a slightly different command or possibly different packages. But you're going to want Xorg server and Xorg exonit. So this of course is the server. And this of course is the command that will allow you to run it and read exonit rc, which we'll talk about in a second. So this of course is really the setup for all the different desktop environments and window managers you're going to need. Now sometimes I think some desktop environments will automatically pull these, but let's say we want to install a window manager just so we know how to do it, just because it's more complicated. So we might as well figure that one out first. So I'll just say the principles of Xorg or X, you know, and excuse me, exonit, is once you've installed these, when you type in exonit or start X, this will start the server and it's going to read this file exonit rc to know what to start. So this is going to be where you put what you want it, what desktop environment or what window manager you want it to start up. So that's what that's about. So again, let's install a window manager or something like that. So for the window manager that I use, which of course is i3 gaps, you're going to want to install i3 gaps itself, that package. You also might want i3 status, that's the status bar that they have by default. Now most people end up replacing it, but it's nice to have it at the beginning. You're also going to want to install any kind of terminal emulator. It doesn't matter. Most people use your RxVT Unicode for i3, i use st, but that's not, you have to do that manually. And you might also want to install dmenu because that is the run prompt by default in i3. In addition to those files, now keep in mind this is more complicated since it's a window manager and not a desktop environment because desktop environments are going to do this stuff automatically, window managers aren't. But in addition to that, you might also want to install something like a in immaplet, which is this is a network manager. It's a little thing that usually appears in the corner of your screen and it allows you to choose what wifi to connect to or something like that. So usually people want something like that, so you might want to go ahead and install that. Additionally, when you're running a window manager at least, when you're installing a window manager on a bare system, it's probably not going to install fonts. Now there are some programs like for example Firefox, which when you install Firefox it's going to automatically install fonts because it needs them. But window managers don't necessarily pull those, even though you're basically going to need fonts. I'll just say that the ones I use, people always ask, so I'll go ahead and tell you, the ones I use are TTF Linux Libertine and TTF Inconsolata. This is, so Inconsolata is the font I use for my terminals and this package here gives me the other fonts like the Sarah fonts, the sans-sara fonts et cetera that I use in the rest of my system. Now there are also, you can check out the fonts entry on the ArchWiki page and that will give you a list of not just fonts but font packages. So one common one that people use is Notofonts and this is like, I think it's a bunch of free fonts compiled by Google and that'll install a whole bunch of different stuff. You basically don't need, if you have this you don't need to worry about a lot of different fonts, but I like having my own, the ones that I happen to like, so I just install these. Now there's a possibility, one of the things about Linux that's a little unfortunate is sometimes fonts don't work the way they should be working in the sense that font config sometimes has some problems. So every once in a while you'll start up your machine and it might be trying to read a Sarah font as a sans-sara font or a monospace font as a Sarah font or something like that. It'll get confused for some reason and that can different from install to install. Like when I first installed Arch Linux I had this problem all the time. Nowadays I don't just, I don't get it anymore, but if you have those problems once you install your fonts you might want to go into editing your config slash font slash fonts.com file. Now this is an XML file, I'll go ahead and show you what mine looks like, but this is a file where you just manually can set all the fonts that you're using as this user. So I want in Consolata to be my monospace font, or something like that. So you can check mine out on my github if you have so many problems, but usually this isn't necessarily an issue. I'll just say that I had it, as I said, I had it a whole lot when I first started running Arch Linux, but usually once you install a big font package font config is usually smart enough to determine what's what. Every once in a while you might need to install something else or edit this file. So anyway that's a very long winded way of saying all the stuff you need to install manually for a window manager. But once you've done all that all you need to do is put this one little line exec i3 in your xinit config if you're running i3 or if you're running some other you know if you're running awesome window manager you replace it with I think what is it awesome w... I don't even know exactly what their command is, but depending on whatever window manager you're using you can just look up look up in the manual or on the arch wiki what command you need to run for i3 it's just exec i3. And so what happens is once I run startx it's going to start the x server and it's going to start i3 and that's going to be that. And it'll boot me into you know this nice blank screen. I mean in i3 you have some windows windows that pop up that you know you press enter to but then you can start pulling up windows and operating and configuring it however you want. So that's of course a window manager that's the harder aspect that's the thing you you could just do something like a desktop environment and I feel like a lot of people maybe not most of my subscribers but maybe a lot of the people watching this video want to just have a desktop environment and that's a whole lot easier. Here is xfce this is what it looks like at the beginning so we have our nice browser and file manager and terminal all of this stuff is installed automatically. So instead of doing all that stuff installing fonts and all that stuff usually to install a desktop environment all you have to do is say install xfce4 all right so again this is xfce4 all you and that packet well this isn't a package this is a package group I guess and it pull it doesn't just install xfce it installs all that you know installs the file manager and the browser that it wants and whatever fonts that it wants and basically everything all at once and again the division between desktop environments and window managers is desktop environments are for people who just want a cohesive experiment experience they want everything installed automatically whereas window managers are for people who want to configure things more anally and sort of have more control over the system now of course you still can change things in a desktop environment but you know that's that's another issue altogether. So anyway to install xfce just run exec or add exec excuse me a tongue twister just add exec xfce session to your xnet rc instead of exec i3 or something like that and that once you run startx it's going to boot you into this environment so there are other ones as well there are other desktop environments as well there's gnome there's kde there's a whole bunch of stuff you can check the arch wiki the arch wiki lists out all basically all the de's and wms and all the special requirements they have you can check out their entries they there i mean there are literally dozens of different choices that you can play around with and you can just install all of them frankly and play with them one by one if you want just by editing your xnet rc here are the window managers here's just the tiling window managers there are non tile there you know overlaying windows window managers as well so you can pretty much play around with that and get whatever you want so some general problems you may have just in general now if the x server doesn't start if you type in startx and something you get some unambiguous error sometimes you have to install some other kind of package one common one is xf86 video intel that's for a lot of devices that have intel drivers you might have to install an extra package you can usually check the arch wiki for that um and i will say just because a lot of newb linux users don't know about this at any time if something totally messes up in your graphical environment or just the terminal generally you can type you can hold down control alt and type in like f2 f3 f4 and that'll take you to another tty another one of the blank screens where you can log in and let's say you know i3 totally messed up and you're trying to figure out what went wrong well you can log in to you can press control alt f4 and you'll go to tty4 you can log in there you can type in kill all i3 and that'll you know end i3 and you can do whatever you need so you don't a lot of sort of new users sometimes have the idea that oh something messed up i have to totally reboot and go through all that you don't have to do that just get into another tty and when you're in one you can hold down alt and move left and right to go to different tty's that's just uh this is just a general note that i know some people don't know and it's it's just an important thing uh just to be able to do that if everything else goes wrong um so anyway here are the login options now we already talked about this first one and that is you boot up you go to the tty and we've set up xorg and xinit so that we can type in startx and it's going to run whatever window manager desktop environment we want but there's another option and that is what's called a display manager um so display managers you can probably more intuitively think of display managers as it's just being like login screens and there are a lot of different options for this now most distros will install something like a login disk uh well most distros that have graphical environments will install one of these login screens these display managers by default now most people i think who use arch that i know about at least or or other minimalist distros usually go without this they just like logging into the tty and pressing and typing in startx or something like that but you might want to have one of these login screens especially if you have multiple users or if this is a computer that um you know you and your family are going to be using uh it makes a lot more sense to have one of these now this is i think is lxte uh or excuse me lxtm uh which is the desktop display manager for lxte um anyway let's install one just so you know how to do it one of them is light dm this is you know relatively light on resources one um and to install it all you have to do is install light dm and also a gtk greeter um and pretty much once you do that you don't have to change any config for files or stuff you can if you want a different you know appearance or background screen but all you need to do is type in sudo system ctl enable light dm service right so this is just a system d command that tells system d to start light dm when you log in so what's going to happen is instead of instead of you booting into the tty and getting a blank terminal screen you're going to get light dm light dm is going to pop up um and you can log in from there and the nice thing about um display managers is as opposed to x and at rc or something like that where you have to manually change what you're booting into um here you can pretty you can manually select when you're at the login screen it's going to automatically detect if you have i3 gnome um lx de de installed it's going to automatically detect what window managers or just split or um excuse me desktop environments you have and it's going to give you a a choice of those different choices or it's going to allow you to select one and just automatically boot into that so that's what you're doing here and just as a reminder um this of course is this command here um a lot of times you have to remember that when you're installing a linux distribution from scratch everything you want to start up at the beginning you want it you have to overtly tell linux to start this program or do this um so one thing that you've probably seen from managing other distributions is um if you want to start a program at startup you have to say sudo system ctl enable and then the service name um or if you want to start a service right now not necessarily boot it you haven't started boot up but if you want to start it right now uh just replace enable with start um just i mean a lot of times people email with me with questions like oh i installed this ways and it's starting usually you just have to run system ctl enable and start that and that that's really the basics of what you need to know now of course you can also run commands like restart or something like that check the system ctl manual for that um but anyway so those are for system specific programs what if you want to have something specific to your user let's say you're booting in with x and rc and you want to have some extra settings set or you want to have you know extra things running at the beginning when you boot into your machine or boot into your account whatever you're running now one thing that people usually do is have a separate bash profile or profile now these programs are read whenever you log in so it's nice to be able to add some extra settings there or extra commands there let me show you for example what my um profile file looks like so if i open up profile um here here's what i have here so let me and these are just settings that whenever i log in um these settings are going to be read and run or you can put in any kind of arbitrary command here so up here this is just if i have bash rc run bash rc so i get all the settings from that um i also do something like change my path variable so if you don't know um this is something important to know if you're in sort of a newbie linux user or unix user i guess there is this variable called path gotta put in the uh there's this variable called path and path is just a list of all the different folders that your computer is looking to for commands at any given time um so when you uh right here i just change path to add in my own scripts folder um i also set some so well effectively what this does is i have a bunch of scripts in that folder and i can automatically you know start typing one up so i have a screencast command which is actually running right now but i can automatically just type that in anywhere and it's going to run um other things i set is i set my editor to vim my browser to firefox my terminal to st and this is just because a lot of different programs will look to those variables for something to read like some some programs they don't want to force you to use vim they want to use your editor variable so if you use vim or emacs or something else if or nano uh it wants to know what to actually run um or if i want to change my settings instead of changing them in a bunch of different programs i can just say okay i don't want to use firefox as a default fault browser i'm going to use q browser now or something like that and last but not least another thing that a lot of people want to have uh is let's say i don't want to use a display manager but let's say i want to log into the tty and i want uh i3 to automatically start i don't want to type start x or something like that this is what this command does this is what i have on my computer whenever i log in this command just says uh when remember this is running when i first log in to any kind of terminal and it says if the tty i'm in is tty one which is the default one you start on um then start art start x basically so it's gonna automatically start the x server and of course this is just uh if i'm not running i3 already that's what that's for but anyway the idea i'm getting at here is you can add stuff to your profile file and have you have those settings automatically run across different window managers or stuff like that um so that that's just a little addendum for those of you who are using um start x or something like that um and well that that's actually about it we covered a whole lot of stuff um so there are specific questions you can have about uh different display managers different window managers but honestly the best i can tell you at this point is once you understand what i what we've talked about here uh how to have an x x server how it actually starts how you know how to change what it starts how to you know add stuff to start up um the only thing you really need to work out is the details of what specific window manager or a desktop environment you want to use so i refer you again to the arch wiki all the different options they have there all the all the different programs they have and that basically is it it's honestly that easy i mean for those of you who run desktop who want to run desktop environments it's as simple as just installing that and you know pseudo system ctl enable that and that's basically it um so if you have any other questions or things you want to see if there are any things that are still anything that's still confusing be sure to say so and if there's enough outcry i can do videos on specific stuff about this but this is just throwing this out here so people understand the basics of how you actually install a graphical environment on any kind of minimal install of linux so anyway that's about it so i'll see you guys next time and i hope you uh hope you learn something