 A viewer asks, they want to know how to compile and install a Linux kernel. And there's different ways to go about this. I'm going to show you how to do that on an already running Debian system and install it on a Debian system. And so here we go. It's actually pretty simple. We're not going to make any modifications. We're just going to go with the default stuff, but you'll see how you can modify stuff. The first thing we want to do is we want to go to kernel.oregon right away. You can see you have a bunch of different kernels here. So you can click on that. I'm going to right click and say copy address. I'm going to get this mainline one. There's also a stable one, and there's long terms here. So get whichever one you want and then go into your shell, into a folder. Now you're going to need a decent amount of space. I don't know exactly how much. Just make sure you have a decent amount of space in your hard drive because even though the kernel itself once compiled is small, there's a lot of files that are going to be created and source code that's going to be manipulated, takes up a lot of space. Anyway, what I'm going to say is I'm going to say wget, and I'm going to paste in the URL I just copied straight to the tar.xz file. And I'm going to say the output, I'll just call it linux.tar.xz. So that downloads, and it shouldn't take very long here. Now there's other programs that you need, other packages you need to do the compiling. And again, I'm doing this on a Debian-based system. So this should work on Linux Mint, Ubuntu, or any Debian-based system. So as you can see, the source code here, as it is all tarred up and zipped up, is going to be about 77 megabytes. So again, there's some packages we need. So I'm going to say sudo apt-get or aptitude install. You want to actually, you probably want to do apt-get update first. And then you'll do an apt-get or aptitude install, we'll say kernel-package, a lib. You know what? I have a list over here. I'm just going to copy and paste this to make sure I type everything right, plus to save some time. So there we go. We got our kernel package, our lib, n-curses, 5-development, which over time, this might change to newer versions, anything that has a version number in it like that. If it says it's not available, do a search on this and see if something shows up with a different number. Package called fakeroot, wget, which probably is already installed. But just to be sure, bzin2, vzip2, and build essentials. It'll have to be sudo root to run that. And I already have all that installed, so I'll just do that and blah, blah, blah, pretend like I installed it because it's already installed. Next I'm going to become root because most of this year, well I guess not most of it, but you're going to want to be root in the end anyway. You know what? You don't have to be root. Why am I saying that? Ignore that part of what I just said. Next we're going to say tar-x, capital J, vf, sorry, lowercase f, and our linux tar.gz that will unzip it and we'll give it a moment here to unzip and it's going to unzip it to a folder called linux. And so if I list out here, you can see we have our original file that we downloaded and actually a folder called linux-3.18 because that's the number. So linux 3.18 we'll go into there, clear the screen again, and now that we're in here we're going to want to do a make, clean, and we'll do double ampersand there and that means as long as that's successful, because if not then it won't, we're going to say make mr proper. We'll hit enter and we'll let this run for a second here. So that ran no errors. Next thing we're going to do is we're going to copy the configuration file from your current running system. So you already have a current installed and there are a configuration. We're just going to grab that config file to go off of. Obviously, you can modify this stuff if you need to in the future, but it's in your boot folder, in your root directory, boot folder, we're going to say config so I already have 3.16 as my current running kernel, but so if you don't know and you want to put this into a script what you can do is you can say back tick unname-r and another back tick and that will put in what you need there or you can manually do it, but if you're going to do it from a script you're going to want to take that in. So that's what I like to do just because that's I want to get ahead of that and then we're going to copy that your current configuration to our current folder. In fact, you don't need that backslash there. That mean that forward slash there will just say dot config and so we copy that config file. Now at this point we're going to say make menu config will hit enter and it brings up this configuration menu which allows you to go in and change all your different settings of what you want compiled into your kernel, things you don't want, so you can modify it to your likings. I'm not going to change any of this. I'm going to leave it all as the default and in fact what I'm going to do is I'm going to say I'm going to hit tab a few times and I'm going to go over to load and I'm going to load that dot config it already says it sees it in the folder. That's the config file we just copied over. I'm going to set okay. Then I'm going to go to exit and then I'm going to say it says do you wish to save your new configuration? I'm going to say yes and so it took that config that we have. So we're compiling the new kernel with our current settings basically. Next we're going to say make dash kp kg clean. I am reading notes. This is not something I do regularly. We'll hit enter and right there it's going to make clean here and now we're at our second last step. We're actually at the point we're actually going to start our compiling right now and this is the part that's going to take a long time on my system which is a fairly decent speed system. I haven't actually timed it but I'm sure it takes more than an hour. Basically I'm going to start this and then walk away. Maybe start it before you go to bed at night but we're going to use that fake root package that we installed. We're going to do fake root make dash kp kg dash dash init rd dash dash append dash dash two dash version equals and then I'll say dash custom and you really want to spell stuff right when you're doing this or otherwise it's not going to work. And then we're going to say kernel image kernel underscore headers and at this point we're going to hit enter and it's going to go and it's going to take quite a long time. Again I'm going to stop the video here in a moment but basically what this is going to compile it and again this is doing this on a Debian based system it's going to create two dev packages for you and then you can just install those using your dp kg dash i in those packages or if you're on something like ubuntu or linux mint usually if you double click them inside your fire browser it will ask for your password and if you want to install and it will install them and then you can reboot into them. So that last little part like I said when you're done in the folder that you started in will be the two dev packages and just install those and you're good to go so I don't think I need to show you that because if you don't know how to do that you shouldn't be trying to compile a kernel. So again not that hard few commands I will have a link in the description to my notes on how to do this basically a script that you probably copy and pasted into your shell and will work for you but you'll want to switch out the link to the more current kernel because new kernels come out all the time so be sure to check out the description of this video for the URL to the link to the notes on everything I just did and as always please visit filmsbychris.com that's chris at the K there should be a link in the description to my website and as always I hope that you have a great day okay this is an introduction to filmsbychris.com I'm chris that's chris at the K that's me right there my daughter ember and my wife jennifer we pretty much live in the swamps of florida I'm a firefighter by day as well as by night we work long hours but that's not why you're here you're here about the videos I put up on YouTube these videos are mainly about computers and programming which means most of my videos look something like this and if that's what you're interested in great if not that's all right I do videos on other topics too such as video editing special effects photo editing 3d design and music creation if you are one of my viewers and you enjoy my videos my patreon page is a place we can go to help support my videos so I asked that you take the time to go to my patreon page and look at different levels of rewards you can receive for different levels of backing there should be a link in the description of this video if you're watching it on YouTube otherwise you can visit patreon.com forward slash metal x1000 and I thank you for your time and your support have a great day