Merge pull request #1228 from 213edu/master

Translated:How To Install Linux On A MacBook Pro Retina.md
很好!
This commit is contained in:
Xingyu.Wang 2014-06-21 10:26:48 +08:00
commit d3a6673a84
2 changed files with 141 additions and 144 deletions

View File

@ -1,144 +0,0 @@
Translation in progress [213edu][https://github.com/213edu]
How To Install Linux On A MacBook Pro Retina
================================================================================
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/linux-macbook-pro-retina-840x420.jpg?ec7b17)
MacBook Pros come with some very nice hardware, but some people want more. Some people want Linux.
Whether youd like a more open and customizable operating system or simply need to dual-boot in order to access certain software, you might want Linux on your MacBook. The thing is, MacBook Pros are also pretty closed-down pieces of hardware that make installing other operating systems difficult Linux more so than Windows. Boot Camp wont help you with Linux, even though it doesnt mean its impossible. Heres how to do it.
### Why Install Linux On A MacBook Pro Retina? ###
The reasoning for installing Linux on a MacBook Pro might seem a bit strange at first isnt OS X one of the main reasons to get a Mac? That might be true, but another great reason to get a Mac is the hardware. They offer excellent performance, superb battery life, and long durability. For the ones with a Retina display, youre also wanting a HiDPI experience for ultra-crisp photos and text.
But if you dont like Mac OS X, or simply need to use Linux, you may want to put another operating system on that Mac hardware. Linux is lean, open, and highly customizable. Who says that you cant bring the two together in a happy marriage? Well, Apple might have a word to say about that, but you probably dont care anyways.
Note: For the purposes of this tutorial, well be using Ubuntu, the [most popular Linux distribution][1], as our preferred choice. Youre free to choose a different distribution, but you can then only follow these steps are generic guidelines and not exact instructions. We claim no responsibility for any damage that is done to your system. Additionally, this tutorial assumes that you want to dual-boot between Linux and Mac OS X. Its recommended to keep Mac OS X on the hard drive so that you can update the firmware if needed — something you cannot do in Linux.
Before we even start with the first step, make sure that your computer is backed up in case anything goes wrong. How you do this is up to you, so feel free to use Time Machine, CrashPlan, or whatever else you might prefer.
### Download Ubuntu ###
First, youll want to get a [copy of the Ubuntu desktop ISO image][2]. Be sure to choose the 64-bit desktop flavor, and not the image made for Macs. The regular image can boot up in BIOS and EFI modes, while the Mac image can only boot up in BIOS mode. This was done on purpose for some Macs, but we want to be able to boot it up in EFI mode.
### Write to USB Drive ###
Next, grab a USB flash drive that is at least 2GB large well use this to boot up the Ubuntu installer on. To make this drive you can follow [the official Ubuntu steps][3], or [use the dedicated GUI tool for the job][4].
### Resize Partitions ###
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_disk_utility.jpg?ec7b17)
nce youve done that, you can get your MacBook Pro ready for the installation. Open up the Disk Utility, click on your hard drive on the left side, and then choose the Partitions tab. Resize the Mac partition to whatever size youd like it to be — well use the newly created free space to install Ubuntu.
### Boot Up Ubuntu Image ###
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_boot.jpg?ec7b17)
After thats completed, plug in the USB flash drive you prepared and restart your MacBook Pro. Be sure to hold down the Options button from when the screen blanks out for a second to when you see a screen with various boot options. Choose the EFI option (the left one in case you see two of them) to boot up your Ubuntu USB flash drive.
When prompted to choose between “Try Ubuntu” and “Install Ubuntu”, choose “Try Ubuntu” because well need to perform a step after the installer completes but before you restart the system.
### Installer ###
Once the Ubuntu desktop loads, start the installer and go through it normally until you reach the partitioning step. If you cannot access WiFi, its because Ubuntu currently doesnt recognize your WiFi chipset. Dont worry we dont need to have Internet access right now, and itll detect the right driver to use whenever you boot up into your new installation later on.
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_installer_partitions.jpg?ec7b17)
Once you come to the partitioning step, choose to “Do something else”. Then, make sure that the small partition thats ~128MB large is recognized as an EFI boot partition (you can check by clicking on it and choosing Options; additionally, that should be /dev/sda1). Next, you can create an ext4 partition in the new space and have the path “/” be mounted to it. You can also create multiple partitions here if you prefer that and know what youre doing.
Before you continue to the next step, make sure that the bootloader installation location says /dev/sda1, as you want GRUB to be installed into that partition. Then, finish off the installation like normal.
### EFI Boot Fix ###
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_efibootmgr.jpg?ec7b17)
When the installer completes, dont restart just yet! We still need to do one more thing so that well be able to use GRUB. Run the following command:
sudo apt-get install efibootmgr
This will temporarily install a configuration tool for EFI boot setups. Next, run
sudo efibootmgr
This will print out the current boot configuration to your screen. In this, you should be able to see “ubuntu” and “Boot0000*”. Currently, the EFI system will point to Boot0080*, which skips GRUB and goes directly to Mac OS X. To fix this, run the command
sudo efibootmgr -o 0,80`
Now you can restart!
Congratulations! Your Ubuntu installation should now be working! However, there are a few tweaks that you can perform to have a better experience.
### Various Tweaks ###
First, youll need to make a quick change to a GRUB setting so that the SSD wont occasionally freeze. Type
sudo nano /etc/default/grub
in a terminal, and then find the line with **GRUB_CMDLINE_LINUX** and change it to **GRUB_CMDLINE_LINUX="libata.force=noncq"**. Hit CTRL+X to save, and Y then Enter to confirm. Then, youll want to type
sudo nano /etc/grub.d/40_custom
into the terminal, which will open up a new file. In it, type this exactly:
menuentry "Mac OS X" {
exit
}
This will allow you to boot into your Mac OS X installation (the 32-bit and 64-bit entries in GRUB do not work). Do the same thing to save and exit, then type in
sudo update-grub
for the changes to go into effect. Finally, restart your system for good measure.
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_small_retina.jpg?ec7b17)
As you can see, everything is ridiculously small on the Retina display. To fix this, System Settings > Display and change the scaling factor to something larger. On the Retina screen, everything will look extremely tiny and it will make your life much more difficult if you dont change it to something you like.
You may also find that its difficult to grab the edges of a window for resizing. This can also be changed. Type
sudo nano /usr/share/themes/Ambiance/metacity-1/metacity-theme-1.xml
into a terminal, and then change these values appropriately:
<distance name="left_width" value="4"/>
<distance name="right_width" value="4"/>
<distance name="bottom_height" value="4"/>
If thats not big enough, you can also change those values to “6″ instead.
Finally, if you experience any washed out colors, you can grab the display color profile from Mac OS X and use it in Ubuntu. Mount your Mac OS X drive and navigate to
/Library/ColorSync/Profiles/Displays/Color LCD-xxxxxx.icc
where xxxxxx is some random string (there should only be one file anyways, but this string gets randomized). Copy it into your Ubuntu home folder, and then go to System Settings > Color and choose Add New Profile and choose the profile you saved in your home folder.
### Conclusion ###
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_final.jpg?ec7b17)
Congratulations! You now have a great working Linux installation on your MacBook Pro Retina! Feel free to make additional tweaks to [make Ubuntu feel more like home][5]. Im sure that these instructions can be applied to other Mac systems, but each new release has its own pitfalls and advantages. If you use a different machine, its a good idea to look up some documentation first, such as [this][6] for Ubuntu.
Additionally, feel free to check out [other great Linux distros][7] that you can install to your Mac!
Have you installed Linux on a Mac? What problems did you encounter and how did you solve it? Let us know in the comments!
Image Credits: [K?rlis Dambr?ns][8] Via Flickr
--------------------------------------------------------------------------------
via: http://www.makeuseof.com/tag/install-linux-macbook-pro/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.makeuseof.com/tag/windows-xp-users-switch-ubuntu-14-04-lts-trusty-tahr/
[2]:http://www.ubuntu.com/download/desktop/
[3]:http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-mac-osx
[4]:http://www.makeuseof.com/tag/how-to-boot-a-linux-live-usb-stick-on-your-mac/
[5]:http://www.makeuseof.com/tag/11-tweaks-perform-ubuntu-installation/
[6]:https://help.ubuntu.com/community/MacBookPro
[7]:http://www.makeuseof.com/pages/best-linux-distributions
[8]:https://www.flickr.com/photos/janitors/10037346335

View File

@ -0,0 +1,141 @@
如何在MacBook Pro Retina上安装Linux
================================================================================
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/linux-macbook-pro-retina-840x420.jpg?ec7b17)
MacBook Pros拥有非常强大的配置有些人想强上加强他们想用Linux系统。
不管您是想要更开放和个性化的操作系统又或者您只想要需要用某些在Linux特有的软件您都会想要把Linux装载您的MacBook上。 可惜的是MacBook Pros们可是一块块密不透风砖头让您想装其他系统又无从下手。尤其是Linux比在MacBooks上装Windows还难。 Boot Camp在此时对于Linux来说也是手无对策。 虽然如此,但并不代表您完全不能做到,装机走起!
### 为什么要在MacBook Pro Retina上装Linux ###
买MacBook不就是为了OS X吗为何要装Linux 其实买MacBook的原因不必须只是因为它的系统 其极致的性能,极其耐用的电池以及高大上的持久力都是购买它的原因。 这些这么好的硬件再加上一块能让您体验到HiDPI的清晰度Retina显示屏其不皆是买入的理由乎
但是如果您对OS X无爱又或者您真心需要使用Linux为何不将这自由开源小巧个性化的Linux塞进您的高大上硬件呢苹果可能有话要说了可谁在乎呢~
注:在本期教程我们将会使用[最流行的Linux发行版][1] - Ubuntu来作为我们这次安装的选择。您也可以用自己想用的的Linux发行版但相关的步骤会和本教程有出入。 如果您把自己的系统玩坏了,我们将不承担任何责任。 本教程将教您如何Linux 和 OS X 双系统启动另外只有在OS X 才能升级固件所以我们建议您不要将OS X 删除。
但在我们开始之前请您用您喜欢的方法比如Time Machine 或 CrashPlan将您的电脑彻底备份以防万一。
### 下载 Ubuntu ###
首先您需要下载一份[copy of the Ubuntu desktop ISO image][2] 。 该镜像在BIOS和EFI模式下都能启动而Mac版的只能在BIOS启动。 可是我们需要在EFI模式启动所以请确保您选择的是64-bit64位而不是Mac版的64-bit。
### 存入U盘USB ###
其次第二步, 找个2GB以上的USB, 我们将会用该USB作为Ubuntu的安装启动盘。 你可以按照 [the official Ubuntu steps][3] 或者 [use the dedicated GUI tool for the job][4] 的步骤来准备安装盘.
### 调整分区大小 ###
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_disk_utility.jpg?ec7b17)
当你这一步也完成的时候你的大Mac就做好安装的准备了。 打开Disk Utility磁盘工具 点击左边选择你的硬盘, 选择Partitions分区标签页。 把分区调整到你喜欢的大小 - 我们将会用新创建的空间来安装Ubuntu。
### 启动Ubuntu镜像 ###
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_boot.jpg?ec7b17)
当关机之后屏幕一黑时请按住Option键alt知道你看到不同的启动选项。选择EFI选项如果有两个的话选择左边的哪一个来从USB启动Ubuntu.
当你看到“Try Ubuntu" 和 "Install Ubuntu" 两个选项的时候, 选择 "Try Ubuntu" 因为我们需要在安装完成之后重启之前弄一些其他的东西。
### 安装器 ###
当Ubuntu的桌面加载好之后一路向下走直到你看到分区的这一步。 如果你连接不上WiFi的话就代表你的Ubuntu还暂时不知道如何跟你这位高大上Mac做朋友 不过不用担心, 我们暂时还不需要网络, 在你迟些重启的时候会自动识别你的驱动。
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_installer_partitions.jpg?ec7b17)
一路来到分区这个步骤之后, 选择 "Do Something else" 这个选项。 然后请确保那块大约128MB左右的分区已经设置成EFI启动分区你可以按他一下然后选择Option来确定一下 另外,那一块盘应该是 /dev/sda1. 下一步, 你要在新建的空间里创建一个 ext4分区用“/”路径来安装它。 如果你知道你自己在干嘛的话也可以创建几个不同的分区切记这不是Windows啊孩纸
在你开始下一步之前请确保你的安装引导程序boot loader是选择了 /dev/sda1GRUB也是装到该分区的。 然后按照平常一样该咋装咋装。
### EFI Boot Fix ###
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_efibootmgr.jpg?ec7b17)
当你的安装器装完Ubuntu之后不要按重启 我们还需要弄这么点东西才能使用GRUB。 请运行下列的指令:
sudo apt-get install efibootmgr
这个将会暂时地安装一个EFI boot的配置工具然后 运行:
sudo efibootmgr
这个将会列印出当前的启动设置, 你应该看到的是 "ubuntu" 和 "Boot0000", 当前的EFI设置是把系统指向 Boot0080, 这样的话就会跳过GRUB然后直接跳入OS X所以我们要用一下指令来修复它
sudo efibootmgr -o 0,80`
现在就可以重启了!
恭喜你啦~你的Ubuntu现在应该就可以用了哦不过下列的一些调整会让性能提升哦
### 坑爹地调整设置 ###
首先你需要改一下GRUB的设置这样你的SSD盘才不会偶尔死机 输入:
sudo nano /etc/default/grub
在Terminal找到 **GRUB_CMDLINE_LINUX** 把他改成 **GRUB_CMDLINE_LINUX="libata.force=noncq"** 。 按下CTRL + X保存然后按Y来确定保存。 接下来你要输入:
sudo nano /etc/grub.d/40_custom
在Terminal会打开一个新的文件请使用真精准手指准确地一字一字输入
menuentry "Mac OS X" {
exit
}
这将会让你boot到你的Mac OS X安装程序GRUB的32-bit和64bit项不能用。然后CTRL+X 和 Y 保存退出,然后输入:
sudo update-grub
最后必须要重启才能生效。
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_small_retina.jpg?ec7b17)
在极其高清的Retina显示屏上神马都这么小坑爹啊啊 去Setting -> Display 里把 Scaling Factor弄大一点吧不然妈妈又要担心你的近视眼了。
你也可能觉得在边边改变窗口大小是一件极其困难的事情,坑爹啊啊? 去Terminal输入
sudo nano /usr/share/themes/Ambiance/metacity-1/metacity-theme-1.xml
然后在里面修改下面的参数:
<distance name="left_width" value="4"/>
<distance name="right_width" value="4"/>
<distance name="bottom_height" value="4"/>
如果还是太小把上面的东西改成6吧
最后如果你觉得你的Linux把你那Retina鲜艳的颜色洗掉了请到你的OS X盘找到以下的文件
/Library/ColorSync/Profiles/Displays/Color LCD-xxxxxx.icc
xxxxxx只是一串随机的字符不过这路径应该只有一个文件。把他搬到你Ubuntu的Home folder 然后到 System Settings > Color 选择 Add New Profile 并选择你那刚弄过来的icc文件
### 总结 ###
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_final.jpg?ec7b17)
恭喜你啦, 现在终于有一台属于你的Linux MacBook Pro Retina啦如果你想把你的Ubuntu弄得更手熟请按 [make Ubuntu feel more like home][5] 尽情地修改配置吧! 该教程也弄用于其他的Mac系统当然每个release都不由不同的好处和坏处。 如果你用的是其他的电脑,请翻一翻[这篇为Ubuntu写的文档][6]
Additionally, feel free to check out [other great Linux distros][7] that you can install to your Mac!
另外你还可以看一下其他可以在Mac安装的[Linux 发行包][7]哦!
Image Credits: [K?rlis Dambr?ns][8] Via Flickr
--------------------------------------------------------------------------------
via: http://www.makeuseof.com/tag/install-linux-macbook-pro/
译者:[213edu](https://github.com/213edu) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.makeuseof.com/tag/windows-xp-users-switch-ubuntu-14-04-lts-trusty-tahr/
[2]:http://www.ubuntu.com/download/desktop/
[3]:http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-mac-osx
[4]:http://www.makeuseof.com/tag/how-to-boot-a-linux-live-usb-stick-on-your-mac/
[5]:http://www.makeuseof.com/tag/11-tweaks-perform-ubuntu-installation/
[6]:https://help.ubuntu.com/community/MacBookPro
[7]:http://www.makeuseof.com/pages/best-linux-distributions
[8]:https://www.flickr.com/photos/janitors/10037346335