Switching from macOS to Linux/Printable version


Switching from macOS to Linux

The current, editable version of this book is available in Wikibooks, the open-content textbooks collection, at
https://en.wikibooks.org/wiki/Switching_from_macOS_to_Linux

Permission is granted to copy, distribute, and/or modify this document under the terms of the Creative Commons Attribution-ShareAlike 3.0 License.

Installing

Downloading edit

To install Ubuntu, first get it from Ubuntu's download page. You have the choice between Desktop and Server versions. If you are familiar with the command line and intend to run Ubuntu as a server, download the server version first. If you are unfamiliar with the command line, you can install the GUI while you learn it. Instructions to do that appear later.

Ubuntu is released twice a year, once in April, once in October. These versions are supported for 9 months. Every 2 years, Ubuntu releases a "Long Term Support" (LTS) version that is supported for 5 years.

The version matches the year, month, and day. Ubuntu 16.04.03 means it was released in on April 3rd, 2016. Ubuntu 17.10.1 was released on October 1st, 2017.

Installing edit

Virtual Machines edit

VirtualBox is free so you can get started with this right now. There are many instructions online that discusses how to do this. The steps are basically as follows.

  • Create a new VM
  • Attach the downloaded iso
  • Start the VM
  • Run the installer

VMware Fusion is easier. Just select "Install from disc or image" and drag the iso on top of it.

Boot Camp edit

Installing Ubuntu on a Mac

Non-Mac Hardware edit

Ubuntu's desktop tutorial. Ubuntu's server tutorial. Ubuntu's server installation guide.

Forgotten Password edit

If you forget your password you must reboot and enter Recovery Mode. If you are at the login screen you can reboot by pressing control-alt-delete (control-option-delete). Hold down the shift key as soon as the computer restarts. Almost immediately you will enter the GNU GRUB menu. If the computer wont even boot to the GRUB menu, you must boot to a CD's GRUB menu.

Once booted to the GRUB menu, choose "Advanced options for Ubuntu", then "recovery mode", then "Drop to root shell prompt". Type these commands to make the disk writable.

mount -o remount,rw /
mount --all

Then you can change a password using passwd. User information is stored in /etc/passwd and passwords are stored in /etc/shadow. /etc/passwd needs to have 644 permissions and /etc/shadow must have 640 permissions. Home folders are in /home/. Group information is stored in /etc/groups.

Software Update edit

Finding your version edit

You can find out the current version of your OS with this command.

cat /etc/lsb-release

This is what it printed.

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"

You can also view the version of the Linux kernel by running this command.

uname -a

This is what it printed.

Linux ubuntu 4.4.0-87-generic #110-Ubuntu SMP Tue Jul 18 12:55:35 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

According to the Linux Kernel Archives the latest version at the time of writing is 4.15.

Update edit

The first thing you want to do after installing (assuming your networking is working) is to update. To update run these commands.

sudo apt-get update

This command updates your local copy of available software that you can install. Run this command periodically to make sure your source list is up-to-date.

When I first installed 16.04 and ran apt-get update I got an error that said the following.

The repository 'cdrom://Ubuntu 16.04.3 LTS _Xenial Xerus_ - Release amd64 (20170801) xenial Release' does not have a Release file.

It's pretty annoying when an error appears right out of the box, but don't let it stop you. I fixed it by searching for the error on the internet and I found this page that says to edit /etc/apt/sources.list and comment out lines that began with "deb cdrom". That fixed the problem for me.

Upgrade edit

Next, run this command to upgrade the packages already installed on your computer.

sudo apt-get upgrade

The Ubuntu server guide says to run this command to upgrade Ubuntu server.

sudo do-release-upgrade

On other Linux versions you would run this command instead.

sudo apt-get dist-upgrade

Viewing what you have installed edit

apt list --installed

This will print a long list of all of the software installed on your computer.

Getting new software edit

SSH edit

I setup SSH first because I'm most familiar with the Mac, so I prefer to work from a Mac, so I prefer to login to Linux using Mac's Terminal.app.

SSH isn't installed by default. You can install it using the following command.

sudo apt-get install openssh-server

You could also install it using the tasksel command (see below).

To check it's status run this command.

service ssh status

Once it's running you can ssh into your Linux box by first getting the IP of your Linux computer by running this command.

ip addr show

Then on a different computer (like your Mac), you can ssh in by running this command.

ssh name@yourip

If you are using a virtual machine, now would be a good time to make a snapshot.

Virtualmin edit

Virtualmin GPL is an extension of the Webmin web console that is used to configure a Unix based server using a web browser. I intend on using a web console as a crutch so that I can get up and running as quickly as possible. I intend on learning how to configure everything using the command line, but getting a production server running will give me a reason to learn the command line.

I choose Virtualmin for one reason, it safely backs up MySQL databases. I didn't see any other free web consoles . I don't have my own scripts to do this, so I'm relying on this product to do it for me. Virtualmin also installs Webmin and LAMP, which I also plan to install. So this just does it all for me.

To find the latest instructions see the Virtualmin instructions.

At the time of this writing, the instructions were to run these commands.

wget http://software.virtualmin.com/gpl/scripts/install.sh
sudo /bin/sh install.sh

Webmin edit

Virtualmin will install Webmin. If you don't want Virtualmin but do want Webmin, you can install it with the following commands.

Add the webmin source.

sudo nano /etc/apt/sources.list.d/webmin.list

Add this line.

deb http://download.webmin.com/download/repository sarge contrib

Then run these commands

sudo wget http://www.webmin.com/jcameron-key.asc
sudo apt-key add jcameron-key.asc
sudo rm jcameron-key.asc
sudo apt-get update
sudo apt-get install webmin

Then you can login and configure your server using a web browser at https://yourip:10000.

tasksel edit

This command is a short cut to installing many things, based on the task. Run it without any arguments for a list.

sudo tasksel

In my case I selected "Samba file server".

To see what a task is actually installing, look at /usr/share/tasksel/descs/ubuntu-tasks.desc.

I could also install a specific task by naming it.

sudo tasksel install lamp-server

And I could remove it using the remove command.

sudo tasksel remove lamp-server

After installing LAMP, it is recommended that you secure it.

Desktop GUI edit

If you really want to install the GUI on Ubuntu Server type one of the following.

For only the desktop and not the extras.

sudo apt-get install --no-install-recommends ubuntu-desktop
sudo reboot

To remove:

sudo apt-get remove ubuntu-desktop
sudo reboot

To install the desktop and all of the extras (Firefox, LibreOffice, mp3 player).

sudo tasksel install ubuntu-desktop
sudo reboot

To remove:

sudo tasksel remove ubuntu-desktop
sudo reboot

The rest of this book is going to assume you don't have Desktop installed.

Listing software edit

For an absolutely gigantic list of software that you can install run this command.

apt-cache search .

You can also substitute a keyword to find software with that keyword.

apt-cache search lamp

Ironically, this doesn't list Apache, MySQL, or PHP. Even more ironically a web search led to old documentation that didn't work either. I had to go to the Official Ubuntu Documentation, find the latest Server documentation (16.04 LTS), and look for "LAMP" there. The page there said to use tasksel.


System Preferences (Desktop)

The following is a list of some of Apple's System Preference Panes and where you will be able to find the same settings in Ubuntu Desktop. Most of them are self explanatory and are available in Ubuntu Desktop "System Settings" application, which is found in the Dock or in the Gear menu at the top right of the screen.

Date & Time edit

Desktop edit

Desktop Background edit

"System Settings", "Appearance" to set the background image.

Screensaver edit

"System Settings", "Brightness & Lock" to set the lock time and password requirements.

Ubuntu's ships with only one basic screensaver that locks the screen. If you want a more screensaver follow these screensaver installation instructions.

Displays edit

Resolution edit

"System Settings", "Display" to change resolution. The big difference between this and Mac is that you have to click "Apply" to actually change the resolution. This won't be obvious if you install Ubuntu in a VM that has a very small screen size (800 x 600) because you won't be able to see the "Apply" button.

Brightness edit

Color edit

Night Shift edit

Read about it here.

Dock edit

The Ubuntu Dock is called the Launcher.

"System Settings", "Appearance", "Look" tab allows you set it's size. The "Behavior" tab allows you to Auto-hide the Launcher. There are other ways to configure the Launcher appearance.

Energy Saver edit

Sleep display edit

"System Settings", "Brightness & Lock" to set the lock time.

Sleep computer edit

"System Settings", "Power" allows you to suspend the computer, but I'm not sure what that means.

Sleep hard drives edit

I don't see settings for this.

Wake for Network Access edit

Read about it here.

Start up after power failure edit

Power Nap edit

Power On/Wake edit

Power Off/Sleep edit

Extensions edit

General edit

Default Web browser edit

"System Settings", "Details" pane, "Default Applications" tab allows you to change the default web browser, email, calendar, music, video, and photo applications.

Keyboard edit

Key Repeat & Delay Until Repeat edit

"System Settings", "Keyboard"

Modifier Keys edit

Text edit

Shortcuts edit

"System Settings", "Keyboard"

Input Sources edit

"System Settings", "Text Entry"

Dictation edit

Add bluetooth device edit

Mouse & Trackpad edit

Scroll Direction edit

This seems to be a grey area. You can read about it here and here

Tracking Speed edit

"System Settings", "Mouse & Trackpad"

Add bluetooth device edit

Network edit

Printers & Scanners edit

"System Settings", "Printers".

For scanners, see this, this or this.

Security & Privacy edit

Screensaver Password edit

"System Settings", "Brightness & Lock"

FileVault edit

Firewall edit

Privacy edit

Sharing edit

Sounds edit

Startup Disk edit

Time Machine edit

Users & Groups edit


System Preferences

Energy Saver edit

Sleep display edit

"System Settings", "Brightness & Lock" to set the lock time.

Sleep computer edit

"System Settings", "Power" allows you to suspend the computer, but I'm not sure what that means.

Sleep hard drives edit

I don't see settings for this.

Wake for Network Access edit

Read about it here.

Start up after power failure edit

Power Nap edit

Power On/Wake edit

Power Off/Sleep edit

Extensions edit

Network edit

Sharing edit

Startup Disk edit

Time Machine edit

Users & Groups edit