translated

This commit is contained in:
geekpi 2015-08-01 11:49:49 +08:00
parent dba1249da1
commit 5b0ae3268b
2 changed files with 129 additions and 129 deletions

View File

@ -1,129 +0,0 @@
Translating---geekpi
How to Update Linux Kernel for Improved System Performance
================================================================================
![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/update-linux-kernel-644x373.jpg?2c3c1f)
The rate of development for [the Linux kernel][1] is unprecedented, with a new major release approximately every two to three months. Each release offers several new features and improvements that a lot of people could take advantage of to make their computing experience faster, more efficient, or better in other ways.
The problem, however, is that you usually cant take advantage of these new kernel releases as soon as they come out — you have to wait until your distribution comes out with a new release that packs a newer kernel with it. Weve previously laid out [the benefits for regularly updating your kernel][2], and you dont have to wait to get your hands on them. Well show you how.
> Disclaimer: As some of our literature may have mentioned before, updating your kernel does carry a (small) risk of breaking your system. If this is the case, its usually easy to pick an older kernel at boot time that works, but something may always go wrong. Therefore, were not responsible for any damage to your system — use at your own risk!
### Prep Work ###
![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/linux_kernel_arch.jpg?2c3c1f)
To update your kernel, youll first need to determine whether youre using a 32-bit or 64-bit system. Open up a terminal window and run
uname -a
Then check to see if the output says x86_64 or i686. If its x86_64, then youre running the 64-bit version; otherwise, youre running the 32-bit version. Remember this, because it will be important.
![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/kernel_latest_version.jpg?2c3c1f)
Next, visit the [official Linux kernel website][3]. This will tell you what the current stable version of the kernel is. You can try out release candidates if youd like, but they are a lot less tested than the stable releases. Stick with the stable kernel unless you are certain you need a release candidate version.
### Ubuntu Instructions ###
Its quite easy for Ubuntu and Ubuntu-derivative users to update their kernel, thanks to the Ubuntu Mainline Kernel PPA. Although its officially called a PPA, you cannot use it like other PPAs by adding them to your software sources list and expecting it to automatically update the kernel for you. Instead, its simply a webpage you navigate through to download the kernel you want.
![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/ubuntu_new_kernels.jpg?2c3c1f)
Now, visit the [kernel PPA webpage][4] and scroll all the way to the bottom. The absolute bottom of the list will probably contain some release candidate versions (which you can see by the “rc” in the name), but just above them should be the latest stable kernel (to make this easier to explain, at the time of writing the stable version was 4.1.2). Click on that, and youll be presented with several options. Youll need to grab three files and save them in their own folder (within the Downloads folder if youd like) so that theyre isolated from all other files:
- The “generic” header file for your architecture (in my case, 64-bit or “amd64″)
- The header file in the middle that has “all” towards the end of the filename
- The “generic” kernel file for your architecture (again, I would pick “amd64″ but if you use 32-bit youll need “i686″)
Youll notice that there are also “lowlatency” files available to download, but its fine to ignore this. These files are relatively unstable and are only made available for people who need their low-latency benefits if the general files dont suffice for tasks such as audio recording. Again, the recommendation is to always use generic first and only try lowlatency if your performance isnt good enough for certain tasks. No, gaming or Internet browsing arent excuses to try lowlatency.
![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/ubuntu_install_kernel.jpg?2c3c1f)
You put these files into their own folder, right? Now open up the Terminal, use the
cd
command to go to your newly-created folder, such as
cd /home/user/Downloads/Kernel
and then run:
sudo dpkg -i *.deb
This command marks all .deb files within the folder as “to be installed” and then performs the installation. This is the recommended way to install these files because otherwise its easy to pick one file to install and itll complain about dependency issues. This approach avoids that problem. If youre not sure what cd or sudo are, get a quick crash course on [essential Linux commands][5].
Once the installation is complete, **Restart** your system and you should be running the just-installed kernel! You can check this by running uname -a in the Terminal and checking the output.
### Fedora Instructions ###
If you use Fedora or one of its derivatives, the process is very similar to Ubuntu. Theres just a different location to grab different files, and a different command to install them.
![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/fedora_new_kernels.jpg?2c3c1f)
VIew the list of the most [recent kernel builds for Fedora][6]. Pick the latest stable version out of the list, and then scroll down to either the i686 or x86_64 section, depending on your systems architecture. In this section, youll need to grab the following files and save them in their own folder (such as “Kernel” within your Downloads folder, as an example):
- kernel
- kernel-core
- kernel-headers
- kernel-modules
- kernel-modules-extra
- kernel-tools
- perf and python-perf (optional)
If your system is i686 (32-bit) and you have 4GB of RAM or more, youll need to grab the PAE version of all of these files where available. PAE is an address extension technique used for 32-bit system to allow them to use more than 3GB of RAM.
Now, use the
cd
command to go to that folder, such as
cd /home/user/Downloads/Kernel
and then run the following command to install all the files:
yum --nogpgcheck localinstall *.rpm
Finally **Restart** your computer and you should be running a new kernel!
### Using Rawhide ###
Alternatively, Fedora users can also simply [switch to Rawhide][7] and itll automatically update every package to the latest version, including the kernel. However, Rawhide is known to break quite often (especially early on in the development cycle) and should **not** be used on a system that you need to rely on.
### Arch Instructions ###
[Arch users][8] should always have the latest and greatest stable kernel available (or one pretty close to it). If you want to get even closer to the latest-released stable kernel, you can enable the testing repo which will give you access to major new releases roughly two to four weeks early.
To do this, open the file located at
/etc/pacman.conf
with sudo permissions in [your favorite terminal text editor][9], and then uncomment (delete the pound symbols from the front of each line) the three lines associated with testing. If you have the multilib repository enabled, then do the same for the multilib-testing repository. See [this Arch Linux wiki page][10] if you need more information.
Upgrading your kernel isnt easy (done so intentionally), but it can give you a lot of benefits. So long as your new kernel didnt break anything, you can now enjoy improved performance, better efficiency, support for more hardware, and potential new features. Especially if youre running relatively new hardware, upgrading the kernel can really help out.
**How has upgraded the kernel helped you? Do you think your favorite distributions policy on kernel releases is what it should be?** Let us know in the comments!
--------------------------------------------------------------------------------
via: http://www.makeuseof.com/tag/update-linux-kernel-improved-system-performance/
作者:[Danny Stieben][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.makeuseof.com/tag/author/danny/
[1]:http://www.makeuseof.com/tag/linux-kernel-explanation-laymans-terms/
[2]:http://www.makeuseof.com/tag/5-reasons-update-kernel-linux/
[3]:http://www.kernel.org/
[4]:http://kernel.ubuntu.com/~kernel-ppa/mainline/
[5]:http://www.makeuseof.com/tag/an-a-z-of-linux-40-essential-commands-you-should-know/
[6]:http://koji.fedoraproject.org/koji/packageinfo?packageID=8
[7]:http://www.makeuseof.com/tag/bleeding-edge-linux-fedora-rawhide/
[8]:http://www.makeuseof.com/tag/arch-linux-letting-you-build-your-linux-system-from-scratch/
[9]:http://www.makeuseof.com/tag/nano-vs-vim-terminal-text-editors-compared/
[10]:https://wiki.archlinux.org/index.php/Pacman#Repositories

View File

@ -0,0 +1,129 @@
如何更新Linux内核提升系统性能
================================================================================
![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/update-linux-kernel-644x373.jpg?2c3c1f)
[Linux内核][1]内核的开发速度目前是空前大概每2到3个月就会有一个主要的版本发布。每个发布都带来让很多人的计算更加快、更加有效率、或者更好的功能和提升。
问题是你不能在这些内核发布的时候就用它们-你要等到你的发行版带来新内核的发布。我们先前发布了[定期更新内核的好处][2],你不必等到那时。我们会向你展示该怎么做。
> 免责声明: 我们先前的一些文章已经提到过,升级内核会带来(很小的)破坏你系统的风险。在这种情况下,通常可以通过旧内核来使系统工作,但是有时还是不行。因此我们对系统的任何损坏都不负责-你自己承担风险!
### 预备工作 ###
![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/linux_kernel_arch.jpg?2c3c1f)
要更新你的内核你首先要确定你使用的是32位还是64位的系统。打开终端并运行
uname -a
检查一下输出的是x86_64还是i686。如果是x86_64你就运行64位的版本否则就运行32位的版本。记住这个因为这个很重要。
![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/kernel_latest_version.jpg?2c3c1f)
接下来,访问[官方Linux内核网站][3],它会告诉你目前稳定内核的版本。如果你喜欢你可以尝试发布预选版,但是这比稳定版少了很多测试。除非你确定想要用发布预选版否则就用稳定内核。
### Ubuntu指导 ###
对Ubuntu及其衍生版的用户而言升级内核非常简单这要感谢Ubuntu主线内核PPA。虽然官方称为一个PPA。但是你不能像其他PPA一样用来添加它到你软件源列表中并指望它自动升级你的内核。而它只是一个简单的网页你可以下载到你想要的内核。
![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/ubuntu_new_kernels.jpg?2c3c1f)
现在,访问[内核PPA网页][4]并滚到底部。列表的最下面会含有最新发布的预选版本你可以在名字中看到“rc”字样但是这上面就可以看到最新的稳定版为了更容易地解释这个这时最新的稳定版是4.1.2。点击它你会看到几个选项。你需要下载3个文件并保存到各自的文件夹中如果你喜欢的话可以在下载文件夹中这样就可以将它们相互隔离了:
- 针对架构的含“generic”的头文件我这里是64位或者“amd64”
- 中间的头文件在文件名末尾有“all”
- 针对架构的含“generic”内核文件再说一次我会用“amd64”但是你如果用32位的你需要使用“i686”
你会看到还有含有“lowlatency”的文件可以下面。但最好忽略它们。这些文件相对不稳定并且只为那些通用文件不能满足像录音这类任务想要低延迟的人准备的。再说一次首选通用版除非你特定的任务需求不能很好地满足。一般的游戏和网络浏览不是使用低延时版的借口。
![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/ubuntu_install_kernel.jpg?2c3c1f)
你把它们放在各自的文件夹下,对么?现在打开终端,使用
cd
命令到新创建的文件夹下,像
cd /home/user/Downloads/Kernel
接着运行:
sudo dpkg -i *.deb
这个命令会标记所有文件夹的“.deb”文件为“待安装”接着执行安装。这是推荐的安装放大因为除非可以很简单地选择一个文件安装它总会报出依赖问题。这个方法可以避免这个问题。如果你不清楚cd和sudo是什么。快速地看一下[Linux基本命令][5]这篇文章。
安装完成后,**重启**你的系统这时应该就会运行刚安装的内核了你可以在命令行中使用uname -a来检查输出。
### Fedora指导 ###
如果你使用的是Fedora或者它的衍生版过程跟Ubuntu很类似。不同的是文件获取的位置不同安装的命令也不同。
![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/fedora_new_kernels.jpg?2c3c1f)
查看[Fedora最新内核编译][6]列表。选取列表中最新的稳定版并滚到下面选择i686或者x86_64版。这依赖于你的系统架构。这时你需要下载下面这些文件并保存到它们对应的目录下比如“Kernel”到下载目录下
- kernel
- kernel-core
- kernel-headers
- kernel-modules
- kernel-modules-extra
- kernel-tools
- perf and python-perf (optional)
如果你的系统是i68632位同时你有4GB或者更大的内存你需要下载所有这些文件的PAE版本。PAE是用于32位的地址扩展技术上它允许你使用3GB的内存。
现在使用
cd
命令进入文件夹,像这样
cd /home/user/Downloads/Kernel
and then run the following command to install all the files:
接着运行下面的命令来安装所有的文件
yum --nogpgcheck localinstall *.rpm
最后**重启**你的系统,这样你就可以运行新的内核了!
### 使用 Rawhide ###
另外一个方案是Fedora用户也可以[切换到Rawhide][7]它会自动更新所有的包到最新版本包括内核。然而Rawhide经常会破坏系统尤其是在早期的开发版中它**不应该**在你日常使用的系统中用。
### Arch指导 ###
[Arch][8]应该总是使用的是最新和最棒的稳定版或者相当接近的版本。如果你想要更接近最新发布的稳定版你可以启用测试库提前2到3周获取到主要的更新。
要这么做,用[你喜欢的编辑器][9]以sudo权限打开下面的文件
/etc/pacman.conf
接着取消注释带有testing的三行删除行前面的井号。如果你想要启用multilib仓库就把multilib-testing也做相同的事情。如果想要了解更多参考[这个Arch的wiki界面][10]。
升级内核并不简单(有意这么做),但是这会给你带来很多好处。只要你的新内核不会破坏任何东西,你可以享受它带来的性能提升,更好的效率,支持更多的硬件和潜在的新特性。尤其是你正在使用相对更新的硬件,升级内核可以帮助到它。
**怎么升级内核这篇文章帮助到你了么?你认为你所喜欢的发行版对内核的发布策略应该是怎样的?**。在评论栏让我们知道!
--------------------------------------------------------------------------------
via: http://www.makeuseof.com/tag/update-linux-kernel-improved-system-performance/
作者:[Danny Stieben][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.makeuseof.com/tag/author/danny/
[1]:http://www.makeuseof.com/tag/linux-kernel-explanation-laymans-terms/
[2]:http://www.makeuseof.com/tag/5-reasons-update-kernel-linux/
[3]:http://www.kernel.org/
[4]:http://kernel.ubuntu.com/~kernel-ppa/mainline/
[5]:http://www.makeuseof.com/tag/an-a-z-of-linux-40-essential-commands-you-should-know/
[6]:http://koji.fedoraproject.org/koji/packageinfo?packageID=8
[7]:http://www.makeuseof.com/tag/bleeding-edge-linux-fedora-rawhide/
[8]:http://www.makeuseof.com/tag/arch-linux-letting-you-build-your-linux-system-from-scratch/
[9]:http://www.makeuseof.com/tag/nano-vs-vim-terminal-text-editors-compared/
[10]:https://wiki.archlinux.org/index.php/Pacman#Repositories