###### tags: `Public`, `Technical`, `Configuration`, `Linux`, `Mac`, `Apple M1`, `Arch Linux`, `ARM`, `Arch Linux ARM` # [Asahi Linux](https://asahilinux.org/) ## Install - [The first Asahi Linux Alpha Release is here!](https://asahilinux.org/2022/03/asahi-linux-alpha-release/) - `curl https://alx.sh | sh` ``` » New size (min): 85% Resizing will free up 74.16 GB of space. Note: your system may appear to freeze during the resize. This is normal, just wait until the process completes. » Continue? (y/N): N » New size (min): 85% Resizing will free up 74.16 GB of space. Note: your system may appear to freeze during the resize. This is normal, just wait until the process completes. » Continue? (y/N): y Started APFS operation Aligning shrink delta to 74,158,526,464 bytes and targeting a new physical store size of 420,226,269,184 bytes Determined the minimum size for the targeted physical store of this APFS Container to be 457,011,363,840 bytes Error: -69521: Your APFS Container resize request is below the APFS-system-imposed minimal container size (perhaps caused by APFS Snapshot usage by Time Machine) Failed to run process: diskutil apfs resizeContainer disk0s2 420226269184 root : ERROR Process execution failed Traceback (most recent call last): File "/private/tmp/asahi-install/main.py", line 807, in <module> InstallerMain().main() File "/private/tmp/asahi-install/main.py", line 659, in main while self.main_loop(): File "/private/tmp/asahi-install/main.py", line 779, in main_loop return self.action_resize(parts_resizable) File "/private/tmp/asahi-install/main.py", line 599, in action_resize self.dutil.resizeContainer(target.name, val) File "/private/tmp/asahi-install/diskutil.py", line 202, in resizeContainer self.action("apfs", "resizeContainer", name, size, verbose=2) File "/private/tmp/asahi-install/diskutil.py", line 38, in action subprocess.run(["diskutil"] + list(args), check=True) File "/private/tmp/asahi-install/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['diskutil', 'apfs', 'resizeContainer', 'disk0s2', '420226269184']' returned non-zero exit status 1. ``` - [How to delete Time Machine local snapshots in macOS](https://appleinsider.com/articles/21/06/26/how-to-delete-time-machine-local-snapshots-in-macos) ### [Apple GPU drivers now in Asahi Linux](https://asahilinux.org/2022/12/gpu-drivers-now-in-asahi-linux/) ## Upgrade ### m1n1 - `curl https://alx.sh | sh` ``` ❯ curl https://alx.sh | sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1511 100 1511 0 0 808 0 0:00:01 0:00:01 --:--:-- 811 Bootstrapping installer: Checking version... Version: v0.5.3 Downloading... Extracting... Initializing... The installer needs to run as root. Please enter your sudo password if prompted. Password: Welcome to the Asahi Linux installer! This installer is in an alpha state, and may not work for everyone. It is intended for developers and early adopters who are comfortable debugging issues or providing detailed bug reports. Please make sure you are familiar with our documentation at: https://alx.sh/w Press enter to continue. By default, this installer will hide certain advanced options that are only useful for Asahi Linux developers. You can enable expert mode to show them. Do not enable this unless you know what you are doing. Please do not file bugs if things go wrong in expert mode. » Enable expert mode? (y/N): N Collecting system information... Product name: MacBook Pro (14-inch, 2021) SoC: Apple M1 Max Device class: j314cap Product type: MacBookPro18,4 Board ID: 0x8 Chip ID: 0x6001 System firmware: iBoot-7459.141.1 Boot UUID: 1661C2B3-25BB-4A3E-A3F2-2B8801C8B2F5 Boot VGID: 1661C2B3-25BB-4A3E-A3F2-2B8801C8B2F5 Default boot VGID: 1661C2B3-25BB-4A3E-A3F2-2B8801C8B2F5 Boot mode: macOS OS version: 12.5.1 (21G83) SFR version: 21.7.83.0.0,0 System rOS version: 12.5.1 (21G83) No Fallback rOS Login user: cliff Collecting partition information... System disk: disk0 Collecting OS information... Partitions in system disk (disk0): 1: APFS [macOS (220208)] (420.00 GB, 6 volumes) OS: [B*] [macOS (220208)] macOS v12.5.1 [disk4s1s1, 1661C2B3-25BB-4A3E-A3F2-2B8801C8B2F5] 2: APFS [Asahi Linux (220326)] (2.50 GB, 4 volumes) OS: [ ] [Asahi Linux (220326)] m1n1 v1.0 (macOS 12.3 stub) [disk2s2, 612E30FE-EF54-4342-A23E-529D0B968ADB] 3: EFI (500.17 MB) 4: Linux Filesystem (71.38 GB) 5: APFS (System Recovery) (5.37 GB, 2 volumes) OS: [ ] recoveryOS v12.5.1 [Primary recoveryOS] [B ] = Booted OS, [R ] = Booted recovery, [? ] = Unknown [ *] = Default boot volume Using OS 'macOS (220208)' (disk4s1s1) for machine authentication. Choose what to do: r: Resize an existing partition to make space for a new OS m: Upgrade m1n1 on an existing OS q: Quit without doing anything » Action (r): m Upgrading installation disk0s3 (Asahi Linux (220326)) Old m1n1 stage 1 version: v1.0 New m1n1 stage 1 version: v1.1.8 Transferring m1n1 variables: chosen.asahi,efi-system-partition=f031f4aa-dade-4314-b939-6b5d7710a6d0 chainload=f031f4aa-dade-4314-b939-6b5d7710a6d0;m1n1/boot.bin To continue the installation, you will need to enter your macOS admin credentials. Password for cliff: Setting the new OS as the default boot volume... Installation successful! Install information: APFS VGID: 612E30FE-EF54-4342-A23E-529D0B968ADB To be able to boot your new OS, you will need to complete one more step. Please read the following instructions carefully. Failure to do so will leave your new installation in an unbootable state. Press enter to continue. When the system shuts down, follow these steps: 1. Wait 15 seconds for the system to fully shut down. 2. Press and hold down the power button to power on the system. * It is important that the system be fully powered off before this step, and that you press and hold down the button once, not multiple times. This is required to put the machine into the right mode. 3. Release it once you see 'Entering startup options' or a spinner. 4. Wait for the volume list to appear. 5. Choose 'Asahi Linux (220326)'. 6. You will briefly see a 'macOS Recovery' dialog. * If you are asked to 'Select a volume to recover', then choose your normal macOS volume and click Next. You may need to authenticate yourself with your macOS credentials. 7. Once the 'Asahi Linux installer' screen appears, follow the prompts. If you end up in a bootloop or get a message telling you that macOS needs to be reinstalled, that means you didn't follow the steps above properly. Fully shut down your system without doing anything, and try again. If in trouble, hold down the power button to boot, select macOS, run this installer again, and choose the 'p' option to retry the process. Press enter to shut down the system. ``` ## Packages ### screenFetch - `sudo pacman -S screenfetch` ### base-devel - `sudo pacman -S base-devel` ### Git - `sudo pacman -Syy` - `sudo pacman -S git` ### Timeshift - `git clone https://aur.archlinux.org/timeshift.git` - `cd timeshift` - `makepkg -si` ### glxgears - `sudo pacman -S glxgears` ### Docker - `sudo pacman -S docker` - `sudo gpasswd -a $USER docker` - `systemctl start docker.service` - Starting Docker service will take much time for unknown reason - `sudo pacman -S docker-buildx` ### Visual Studio Code - https://wiki.archlinux.org/title/Visual_Studio_Code - Failed... ### CLI - `sudo pacman -S usbutils` ## Uninstall - `diskutil list` ``` /dev/disk0 (internal): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme 500.3 GB disk0 1: Apple_APFS_ISC 524.3 MB disk0s1 2: Apple_APFS Container disk4 420.2 GB disk0s2 3: Apple_APFS Container disk2 2.5 GB disk0s3 4: EFI EFI - ASAHI 500.2 MB disk0s4 5: Linux Filesystem 71.2 GB disk0s5 6: Apple_APFS_Recovery 5.4 GB disk0s6 /dev/disk2 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +2.5 GB disk2 Physical Store disk0s3 1: APFS Volume Asahi Linux - Data 2.8 MB disk2s1 2: APFS Volume Asahi Linux 1.1 MB disk2s2 3: APFS Volume Preboot 205.2 MB disk2s3 4: APFS Volume Recovery 1.9 GB disk2s4 /dev/disk4 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +420.2 GB disk4 Physical Store disk0s2 1: APFS Volume 210208-Root 15.2 GB disk4s1 2: APFS Snapshot com.apple.os.update-... 15.2 GB disk4s1s1 3: APFS Volume Preboot 408.9 MB disk4s2 4: APFS Volume Recovery 804.7 MB disk4s3 5: APFS Volume 210208-Data 206.2 GB disk4s5 6: APFS Volume VM 20.5 KB disk4s6 ``` - Partitions need to be deleted: `disk0s3`、`disk0s4`、`disk0s5` - `diskutil eraseVolume free free disk0s5` - `diskutil eraseVolume free free disk0s4` - `diskutil apfs deleteContainer disk0s3` - `diskutil apfs resizeContainer disk0s2 0` ## [Pacman](https://archlinux.org/pacman/) - https://wiki.archlinux.org/title/pacman ### Upgrading packages - `sudo pacman -Syu` ## Reference ### Alpha - [Asahi Linux Desktop アルファ版の内蔵SSDへのインストールとアンインストール](https://qiita.com/asfdrwe/items/20edadf1d33f28bb3fb1) - [How to install Asahi Linux on M1 Mac!](https://youtu.be/B9uJxvdVFBE) ### Development - [How to Install Linux on M1 Mac! - Asahi Linux Install Guide!](https://youtu.be/zp4ynOgrLqI) - [在M1芯片的Mac上原生安装Linux系统!](https://www.bilibili.com/read/cv15158983) - [Asahi Linux pre-alpha installer test notes](https://marcan.st/paste/cE2A0XiS.txt) ### Other Distribution - [Installing Gentoo Linux in Apple Macbook Pro M1](https://blog.devgenius.io/installing-gentoo-linux-in-apple-macbook-pro-m1-49e163534898)