Mac System Quick Migration Record (M1 Max)

Big picture out of the box (with pictures and truth)

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here

insert image description here

insert image description here
insert image description here

System migration (about 4 hours, depending on transfer data size)

definition:

  • A = New Mac
  • B = old Mac

Migration (https://support.apple.com/en-us/HT204350):

  1. A, B system itself is upgraded to the latest, consistent, restart after the upgrade
  2. Open [Utilities] -> [Migration Assistant] on computer B, select [To another Mac] as an option after startup, and click [Continue]
  3. Computer A, open [Utilities] -> [Migration Assistant], select [Backup from Mac, Time Machine, or Startup Disk] as the option after startup, and click [Continue]
  4. Computers B and A will display the security code. After confirming that they are consistent, click [Continue] on both B and A.
  5. A computer displays [Select information to transfer to], be sure to wait for the calculation of the size of each item in the list to end
  6. After the calculation of the size of the information to be transmitted by the computer is completed, click [Continue]
  7. Wait about a few hours for the migration to complete

Network configuration (15 minutes, depending on how cumbersome your proxy configuration is)

  1. Configure available network proxies
  2. Without configuring the agent to install the development environment, it will be difficult to move. It can be said that this is a killer that wastes programmers' time.

Shortcut Configuration (2 minutes)

  1. Turn off [Aggregate Search] in the shortcut key configuration, otherwise Command+ Spacewill pop up the search box by default
  2. The shortcut key for configuring input method switching is Command+Space
  3. About the Siri function, what Siri is used on the computer

Install Terminal (10 minutes)

The terminal function that comes with Mac is weaker, install item2: https://iterm2.com/downloads.html

Install brew (30-60 minutes, depending on the network)

  1. Install brew: https://brew.sh/
  2. However, there is a high probability that network problems will cause the installation to fail. Use Tsinghua mirror: https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/

Install fish shell (5 minutes)

A shell with command memory and autocompletion can save a lot of time. therefore

  1. Install fish shell: https://fishshell.com/
  2. But you can install it with brew:brew install fish

Install nodejs (5 minutes)

  1. NodeJs install the latest long-term support version: https://nodejs.org/en/
  2. Install the node version manager using npm:npm install -g nvm

Install rust (5 minutes)

This machine has multiple Rust source code, still need to compile

  1. Install rustup:brew install rustup-init
  2. Initialize rustup: rustup-init -y
  3. Verified version: rustc --version

Install the python package management software (miniforge), (1-5 hours, depending on when the infeasible path is decisively abandoned)

  1. Originally used pyenv to manage the python version, but found that the support of pyenv on Mac M1 was very poor, and gave up after some tossing.
  2. Use conda instead, but use miniforge with Mac M1 support: https://github.com/conda-forge/miniforge
  3. Verify conda:conda --version

Install python 3.8 (3 minutes)

  1. The original project configuration uses the 3.8 version of python, it is best to install this version.
  2. Create an environment with conda:conda create -n python38 python=3.8
  3. Initialize conda in fish shell:conda init fish
  4. Activate python3.8 with conda in fish shell:conda activate python38
  5. Verify python version:python -V
  6. Verify pip version:pip -V

Install tensorflow (10 minutes)

  1. tensorflow must be installed, which is why miniforge is used
  2. Installconda install -c apple tensorflow-deps
  3. Installpython -m pip install tensorflow-macos
  4. Installpython -m pip install tensorflow-metal
  5. Verified version:pip list|grep tensorflow

Failed to install paddle (10 minutes, depending on whether the infeasible path is decisively abandoned)

  1. Project dependencies paddle
  2. Attempt to install failed, paddle does not support M1 yet

Configuring the Rosetta 2 Environment (15 minutes)

  1. The solution is to temporarily use the Rosetta 2 translation mechanism to configure a conda environment
  2. According to the principle of make it run / make it correct / make it fast, it is better to configure a runnable environment first, and those that natively support M1 can slowly toss.
  3. Configure using conda
    • Create an environment where intel packages can be installed:CONDA_SUBDIR=osx-64 conda create -n python38r python=3.8
    • activation:conda activate python38r
    • Configuration:conda env config vars set CONDA_SUBDIR=osx-64
    • restart: conda deactivate,conda activate python38r
    • Test installation:python -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
  4. On this basis, directly install package dependencies on the original python project:pip install -r requirements.txt

Summary (30 minutes, depending on how fast you record)

  1. Try to use mature tools to solve problems:
    • Using Migration Assistant for Mac
    • use brew
    • use fish shell
    • use conda
  2. Solve network problems (Connection Timeout Hell)
    • Configure the necessary domestic mirrors
    • The source code can use the mirror repository on gitcode.net
    • A necessary agent for developers, our programmers spend countless hours on this layer on average, and they are powerless to complain.
  3. Prefer to configure a stable environment
    • The development environment that natively supports M1 is not yet mature
    • First ensure the stability of the development environment process

The history of my first Mac is more than 10 years. It was sprinkled with water in the middle. The Apple store directly thought there was no way. I took it to an ordinary store and took it apart. The second Mac has been in use for 5+ years. The middle battery was bulged and the keyboard collapsed. I also disassembled the battery and keyboard directly in an ordinary shop and replaced the battery and keyboard. The keyboard has been used again. Code the rhythm of the code. For programmers, even in today's era when many resources are cloud-based, a worry-free "terminal" machine is an important productivity. This time, I estimate that the machine will be replaced with a rhythm of 5-10 years. , I hope it can produce more high-quality code, data, text, and ideas in my hands.

Guess you like

Origin blog.csdn.net/huanhuilong/article/details/123947378
Recommended