- Скачай образ Windows, которой ты захочешь пользоваться.
- Тоже самое сделай с Arch Linux.
Создание загрузочной флешки
- Форматируй флешку используя ventoy.
- Закинь образы на неё.
Установка Windows
- Перезагрузи ПК и войди в BIOS.
- Поставь флешку первой в очереди запуска или запустись с неё через Boot menu.
- В меню выбери образ Windows.
- Дойди до меню выбора диска и создания разделов.
- Форматируй диск на который хочешь поставить Windows и Arch Linux.
- Создай Раздел для Windows (120гб по желанию если 1TB как у меня).
- (необязательно) Создай раздел для игр и хранения файлов.
- Начни установку на раздел для Windows.
Подготовка к установке Arch Linux
- После успешной установки Windows опять перезагрузись с загрузочной флешки.
- В меню выбери образ Arch Linux.
- Проверь разметку:
* lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINT * fdisk -l # для уверенности
- Найди раздел, который ты оставил для Arch Linux.
- Форматируй его в ext4:
mkfs.ext4 /dev/nvme0n1p5 # имя раздела может отличаться
- Монтируй этот раздел:
mount /dev/nvme0n1p5 /mnt
- Найди загрузочный раздел
- Монтируй раздел загрузчика:
Обычно он самый первый в списке, но смотри по его максимальному размеру, у меня был 96мб.
mount --mkdir /dev/nvme0n1p1 /mnt/boot/efi
Установка системы
pacstrap /mnt base linux linux-firmware nano
Настройка системы
* genfstab -U /mnt >> /mnt/etc/fstab * arch-chroot /mnt * ln -sf /usr/share/zoneinfo/Europe/Moscow /etc/localtime # Укажи свой часовой пояс * hwclock --systohc * echo "мой-хостнейм" > /etc/hostname # имя пользователя * nano /etc/locale.gen # Раскомментируй en_US.UTF-8 и ru_RU.UTF-8, потом: * locale-gen * echo "LANG=en_US.UTF-8" > /etc/locale.conf * passwd # Задай пароль root
Установка загрузчика
* pacman -S grub efibootmgr * grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB * grub-mkconfig -o /boot/grub/grub.cfg
Перезагрузка
* exit * umount -R /mnt * reboot
Добавление Windows в GRUB
- Установи os-prober, если его нет:
- Включи его в настройках GRUB (по умолчанию в Arch он отключён):
echo 'GRUB_DISABLE_OS_PROBER=false' | sudo tee -a /etc/default/grub
- Запусти поиск систем:
- Если всё работает, он должен вывести путь к Windows, например:
/dev/nvme0n1p1:Windows Boot Manager:Windows:efi
- Обнови конфигурацию GRUB:
sudo grub-mkconfig -o /boot/grub/grub.cfg
- Перезагрузи систему:
Если при запуске Arch Linux не получается войти в root или другого пользователя
- В GRUB выбери Arch Linux, но нажми
e
, чтобы отредактировать параметры загрузки. - Найди строку, которая начинается с
linux
, и добавь в конец:
init=/bin/sh
- Нажми F10 или Ctrl+X, чтобы загрузиться.
- Когда загрузится консоль, смонтируй файловую систему на запись:
- Сбрось пароль root:
Введи новый пароль дважды.
- Перезагрузи систему:
После этого сможешь войти как root с новым паролем. Потом лучше создать обычного пользователя:
* useradd -m -G wheel -s /bin/bash твой_логин * passwd твой_логин
И дать ему sudo:
Там найди строку %wheel ALL=(ALL:ALL) ALL
и убери #
.
Попробуй сбросить пароль и зайти.
UPDATE! 10/11/2022 This post has been deprecated. See this post which supersedes it.
I am currently going through another coding camp right now.
Although this environment is not part of the course, it is of benefit to anyone looking for a smarter, more dynamic environment for developing on Windows using Linux.
How I set up Arch Linux for WSL
Windows Subsystem for Linux (WSL) is a way to use Linux on Windows without re-partitioning your hard drive or using a Virtual Machine like Virtual Box.
You need to install something called Hyper-V if you want to use Windows Subsystem for Linux (WSL). It can NOT be installed with Window 10 Home, but should work with Windows 11 Home. This will require a reboot.
Right click on the Windows menu and select «Powershell (Administrative)». If you are using Windows 11, open «Windows Terminal (Administrative)». We will enable Hyper-V in the command line rather than going through a bunch of other Windows like I had to do.
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Enter fullscreen mode
Exit fullscreen mode
You probably should enable Hyper-V with the Deployment Image Servicing and Management tool (DISM) to help configure windows and Windows images. This will allow DISM to enable Windows features while the operating system is running.
DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V
Enter fullscreen mode
Exit fullscreen mode
When the installation is completed, reboot and come back here.
From the Microsoft Store App, you should install the Windows Terminal application and also Visual Studio Code. If you have Windows 11, you should already have Windows Terminal.
Get a Windows Installer
You should install either Chocolatey or Scoop so you can download some stuff in the command line, especially the NerdFonts that are required for Powerline, Powerlevel10k, and VS Code. These fonts have extra characters that can be used in the Windows Terminal.
I recommend Scoop (scoop
) over Chocolatey (choco
) because it is better organized. Packages are grouped into «Buckets».
Installing Scoop
Set-ExecutionPolicy ByPass -Scope Process -Force
$env:SCOOP='C:\Applications\Scoop'
$env:SCOOP_GLOBAL='C:\GlobalScoopApps'
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine')
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
Enter fullscreen mode
Exit fullscreen mode
Note: we can’t use
irm get.scoop.sh | iex
, not even in an Administrative PowerShell! (This is why PowerShell sucks!)If
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
doesn’t work, try runningirm get.scoop.sh -outfile 'install.ps1' ; .\install.ps1 -RunAsAdmin
. This will createinstall.ps1
locally, which you will need todel install.ps1
later.
We need to set the execution policy to Bypass
. We could have also used Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
which would have set the execution policy to RemoteSigned
. You can see what execution policy is used by running Get-ExecutionPolicy
.
We should get scoop
to work. Let’s update it.
scoop update
Enter fullscreen mode
Exit fullscreen mode
Get the NerdFonts
Because the entire set of NerdFonts is about a couple of gigabytes, you should just get the essential fonts.
I recommend installing these fonts from NerdFonts.
- Meslo
- FiraCode
- FiraMono
- Hack
We first need to add the nerd-fonts
bucket.
scoop bucket add nerd-fonts
Enter fullscreen mode
Exit fullscreen mode
Next install the font packages
scoop install Meslo-NF Meslo-NF-Mono Hack-NF Hack-NF-Mono FiraCode-NF FiraCode-NF-Mono FiraMono-NF FiraMono-NF-Mono
Enter fullscreen mode
Exit fullscreen mode
You should be able to set your Windows terminal to use one of the fonts we installed by going to the settings. A lot of folks are recommending using Meslo.
Installing ArchWSL
We need to get ArchWSL from the extras
bucket. Before we run WSL for the first time, we need to set it’s version to version 2. This will use WSL2, which is recommended. We can view what version our Linux distribution is using later with wsl -l -v
.
wsl --set-version 2
scoop bucket add extras
scoop install archwsl
Enter fullscreen mode
Exit fullscreen mode
You might have seen a message at the end saying «Even when you are logging in as ‘root’, some operations (like service command) require Windows administrator privileges». This is nothing to worry about. We’re going to do something in a little bit so we don’t have to log in as root directly.
Note: To view what Linux distributions are available, we can use
wsl -l
. To view version information, we can usewsl -v
. Combining-l
with-v
, we can see what version of WSL we are using and what Linux distribution is being used withwsl -l -v
.
We are now ready to take care of some basic tasks to get Arch Linux up and running.
Start by running the Arch.exe
program.
Arch.exe
Enter fullscreen mode
Exit fullscreen mode
First lets set our root password with passwd
, you could use your windows password, but a different password would be more secure.
NOTE: Bash is set up to show the current username of the user that is logged in, and the machine that you are logged into. This is called the prompt. Later we’ll do some stuff to make it look pretty. I would recommend giving your computer a name instead of
"Dell-XPS_13-bunch_of_numbers"
. You can do that in your Windows setting. For now well, call our PC «Crystal». This will show up if we run the commanduname -n
.
Our prompt in Bash will also use#
if root (the administrator) is logged in and$
if a regular user is logged in.
[root@crystal]# passwd
Enter fullscreen mode
Exit fullscreen mode
Once you have set up your root password, let’s create our regular user and give them permission to use the sudo
command that temporarily gives them the power to run root command with the sudo
prefix.
[root@crystal]# echo "%wheel ALL=(ALL) ALL" > /etc/sudoers.d/wheel # This creates the sudoers file
[root@crystal]# useradd -m -G wheel -s /bin/bash jrcharney # Create a new users. I will set mine for jrcharney
[root@crystal]# passwd jrcharney # Set the password for the new user
[root@crystal]# exit # Return to powershell
Enter fullscreen mode
Exit fullscreen mode
We need to return to the Powershell for a moment to set the default user.
Arch.exe config --default-user jrcharney # Note: Use your username not mine!
Enter fullscreen mode
Exit fullscreen mode
Note: If the above command doesn’t work, try restarting the
LxssManager
in an Administrative Powershell/Windows Terminal.
Do this by running these two command:net stop lxssmanager
thennet start lxssmanager
Contrary to what the ArchWSL Setup documentation says, you can’t use&&
in Powershell. But that’s not going to matter once we get this running.
If that doesn’t work, try restarting the computer, but that should only be a last resort.
Once we have our default user, we can launch Arch
again. Thanks to how ArchWSL is set up, Arch
will be a option in our dropdown menu on the Windows Terminal, but we can’t set it as the default option. That will still need to be PowerShell because Microsoft.
But that’s no big deal, because the next time we start our Linux terminal, you should see something like this as your user prompt.
[jrcharney@crystal]$
Enter fullscreen mode
Exit fullscreen mode
Congratulations! You now have LINUX installed on Window! This next part will add all those rad toys to it to make it look awesome and a lot less scary.
Set up Arch Linux
If this were actually Arch Linux, we could have used a script called arch_install
to knock out some of this stuff. Since we don’t have it, we got to do it manually.
Here’s just the quick summary of everything I ran to get mine set up. The first few packages we install will be the ArchLinux keyring, the base development tools, Git, another package manager called yay
that will let us use the ArchLinux User Repo (AUR), and short list of other cool stuff.
Note: I’m not going to write the prompt anymore. Almost everything will be done as your default user, even the
sudo
commands.
sudo pacman-key --init
sudo pacman-key --populate
sudo pacman -Syu
sudo pacman -S archlinux-keyring # Note: ArchWSL says this is optional, but THIS PACKAGE IS MANDITORY! It should be the first one installed.
sudo pacman -S --needed base-devel git # When you install the `base-devel` package for ArchWSL, `fakeroot` and `fakeroot-tcp` are in conflict. When asked if you want to replace `fakeroot-tcp` with `fakeroot` SAY NO!
sudo git clone https://aur.archlinux.org/yay.git # This will install `yay` which will allow you access to the ArchLinux User Repository.
cd yay # Go to the yay directory (TODO: Could I have put this in a Downloads directory?)
makepkg -si # Make the `yay` package, this will also install the Go Language (`golang`) that `yay` needs to do stuff.
sudo pacman -S openssh # Install OpenSSH so we can use SSH.
sudo pacman -S github-cli # Install this so we can use `gh` to do github command. (TODO: Is there something similar for gitlab?)
sudo pacman -S lolcat # Install `lolcat` (colorful cat), this will also install the Ruby programming language that it depends on.
sudo pacman -S bat # `bat` is like `cat`, but it looks better.
sudo pacman -S bat-extras fzf clang llvm rust # Some important tools I'll talk about them later.
sudo pacman -S python-pip # Python needs pip to install some packages
sudo pacman -S lm_sensors psutils python-psutil neofetch bashtop htop # Install these to show system information and to manage processes in a more user-friendly way
sudo pacman -S figlet cowsay fortune-mod cmatrix nyancat # Command line toys, some of them are important that they install some depedencies you'll want to have around.
sudo pacman -S ponysay # It's like cowsay, only 20% cooler.
yay -S bash-pipes # One more toy (`pipes.sh`), because the Internet is a Series of Tubes. (Note You can't use `sudo` with `yay` upfront. Yay will ask you for your sudo password later.)
sudo pacman -S imagemagick # Manipulate images from the command line. You probably won't use it a whole lot, but there's some cool stuff that is important
mkdir bin # Add this directory. It should be added to your `$PATH`. You can use this directory to launch scripts that you write to do tasks
mkdir Projects Downloads Documents Sandbox Music Pictures Videos # Just some placeholder directories. I should really make them softlinks to their Windows counterpart later.
curl wttr.in # Check to see if we have curl installed by checking the weather!
sudo pacman -S zsh # Install Zsh
zsh --version # Show the version of Zsh. (We're still in Bash, but that will change shortly.)
chsh -l # Show a list of shells we can change to. (You can also see this in `/etc/shells`)
Enter fullscreen mode
Exit fullscreen mode
OK, we should be ready to do everything in Zsh from now on.
A few things to note
- You’ll be asked some questions when you launch Zsh the first time when you run Oh-My-Zsh. I forget what I said, most of these aesthetic. There’s probably a tutorial about it on YouTube.
- You may be asked some questions to get Powerlevel10K working (at least for Oh-My-Zsh), if not, run
p10k
. - If things don’t have color when you run
pacman -Ss
, go into the/etc/pacman.conf
file and uncomment the line that saysColor
. Visually, this helps out tremendously. - We could have changed the shell to Zsh using
chsh -s $(which zsh)
, but there was a problem getting that done. Fortunately we can do this with Oh-My-Zsh
sh -c "$(curl -fsSL http://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" # Install Oh-My-Zsh. (I should have used `yay -S oh-my-zsh-git` but this works just as well.) (If it asks if you want to change the default shell to Zsh, say yes!)
yay -S --noconfirm zsh-theme-powerlevel10k-git # Install the powerlevel10k them for zsh.
echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >> ~/.zshrc # Use the Powerlevel10K theme in Zsh. (You could use it in Bash too, but I'm not going to do that.)
exec zsh # Restart zsh
p10k configure # Configure the Powerlevel10k prompt.
sudo pacman -S tmux # Install the terminal multiplexer. (We'll have some basic stuff set up in `~/.tmux.conf`)
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm # Install the TMUX plugin manager.
sudo pacman -S powerline # Install powerline. The command to enable it for tmux should be in `~/.tmux.conf`.
sudo pacman -S lsd # Use lsd (not that LSD! This one make the ls command look cool.) (I added commands to ~/.bash_aliases to use it.)
sudo pacman -S jq # Command-line JSON processor. This will be useful later. (There's also `hq` and `yq`, but I haven't tried those yet.)
sudo pacman -S neovim # Neovim is something I'm adding. It's basically a text editor based on Vim, but all the plugins are written in Lua. This should also install Lua.
sudo pacman -S python-neovim # Python 3 plugin support for Neovim
sudo pacman -S zsh-autosuggestions # Enable auto suggestions in Zsh
sudo pacman -S zsh-syntax-highlighting # Enable syntax highlighting. You will need to add a line to to bottom of your `~/.zshrc` file.
Enter fullscreen mode
Exit fullscreen mode
To Activate zsh-syntax-highlighting
, add the following line to the end of ~/.zshrc
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
Enter fullscreen mode
Exit fullscreen mode
My Github repo should contain
~/.bash_aliases
~/.tmux.conf
~/.bashrc
~/.zshrc
~/.p10k.zsh
You should also run VS Code from this environment for the first time such that both applications become familiar with each other.
code . # That is "code" space "period"
Enter fullscreen mode
Exit fullscreen mode
This will install what WSL and VS Code needs to work with each other.
TODO: How do I set WSL/Arch as the default terminal for VS Code?
Anything else, I’ll probably tack on here later. I do have some dotfiles you can download to run some other tasks.
Congratulations! You’re ready to code like a pro!
Taskwarrior (optional)
There’s one thing I would suggest doing if you are doing software development: Install taskwarrior. This is useful because you can write down tasks for things you can do while working on project. Personally, I’m more of a Trello person because Kanban is awesome and can be used for more than just computer development. I used it to help me list all the things I need to do when I moved into my apartment a few months ago. It’s that versatile.
You could also use something like Notion, which as a Markdown editor, but in terms of Markdown editors, I prefer Typora ($15) because it supports Mermaid where you can generate UML diagrams and other charts and uses MathJax for LaTeX support. You can also embed HTML and SVG and generate a preview of what the code looks like.
To install Taskwarrior, install the task
package.
sudo pacman -S task
Enter fullscreen mode
Exit fullscreen mode
We can also install a couple of terminal interface programs such as taskwarrior-tui
and vit
. I will add that.
sudo pacman -S taskwarrior vit
Enter fullscreen mode
Exit fullscreen mode
There is also a command-line time tracking app called timewarrior (timew
) that integrate with task
.
sudo pacman -S timew
Enter fullscreen mode
Exit fullscreen mode
Because we installed powerlevel10k earlier, if we add a task, an item should appear showing how many tasks you have on the right side. If it doesn’t show up, you may need to restart ArchWSL or check ~/.p10k.zsh
to make sure that the segment is enabled.
In fact, Powerlevel10k has many segments that can be useful. You should enable the ones you know that you will need as enabling all of them will be taxing to your system resources.
The first time you run task
you will be told that a configuration file could not be found and asked if you would like to create a sample one. Say yes to it.
Similarly, if you run timew
the first time, it will also ask of you would like to create a new database file. Also say yest to that.
I wanted to install Taskell (taskell
), which is a command-line Kanban board written in Haskell, but for some reason, the taskell
package would not download. Which is unfortunate considering it could be integrated with Trello and Github and it used Markdown. It is quite unfortunate and will need to be brough up at a later date.
So, this is the part where the Coding Boot Camp picks up. Good luck!
This article can be basically divided into two parts: (i) Install Arch in WSL, (ii) Configure as per your needs. Each part can be followed independently so if you are not a fan of GUI programs in WSL, leaving the part is perfectly fine.
Part 0: For those running Windows 10 2004 or above
Download and install Linux kernel update package from Microsoft’s site. Set default version to WSL2 by running:
wsl --set-default-version 2
in PowerShell.
Part I: Installation
Head to https://github.com/yuk7/ArchWSL/releases and download the .appx
and .cer
files.
Now double click the .cer
file and follow the prompts to install the certificates necessary for the installation of Arch WSL. When done, double-click the .appx
file to install it.
Once there, open Arch from Start menu and let it install. When done, you should see an installation complete message. If you encountered problems with the installation see the issues at https://github.com/yuk7/ArchWSL/issues. If there is none, feel free to open an issue.
Part II: Configuration
Open Arch again. It should be logged in as root.
Uncomment the servers closest to your region in /etc/pacman.d/mirrorlist
. Now run pacman -Syyu
to fetch and install updates.
If you get invalid or corrupted package (PGP signature)
error, do not delete the downloaded packages. Run the following commands one by one as root:
rm -R /etc/pacman.d/gnupg/
rm -R /root/.gnupg/
gpg --refresh-keys
pacman-key --init && pacman-key --populate archlinux
pacman -S archlinux-keyring
pacman -Syu
It should install fine.
Create a normal user account
Running everything as root on a normal machine is a pretty stupid idea.
useradd -m -g users -G wheel,storage,power -s /bin/bash <username>
will add a user with whatever you used in <username>
. Set a password for this user with
passwd <username>
Uncomment the following line after running visudo
:
%wheel ALL=(ALL) ALL
Time to install a Desktop Environment
First, we install xorg xorg-server and then xfce4. You may install a Desktop Environment of your choice.
pacman -S xorg xorg-server pacman -S xfce4 export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0 export LIBGL_ALWAYS_INDIRECT=1
While the DE is being installed, grab VcXsrv or (again) you should be fine with your favourite X Server.
Hit Win+Q
, type in XLaunch
and hit Enter. Once there, select One Large Window
(just for the sake of it, if you wish to see the DE in action). Check Disable access control
, leave the rest as is and click Next
and then Finish
. Allow access if prompted by firewall.
Result
Загрузить PDF
Загрузить PDF
Из этой статьи вы узнаете, как текущую операционную систему компьютера заменить на Arch Linux, которая является дистрибутивом Linux. Arch Linux можно установить на компьютеры под управлением Windows и Mac OS X.
-
Создайте резервную копию данных, которые хранятся на компьютере, и скопируйте ее на внешний жесткий диск. Текущая операционная система будет удалена, поэтому сделайте резервную копию важных данных.
-
Arch Linux можно скачать в виде образа (ISO-файла), который можно записать на чистый DVD-диск и открыть на компьютере. Чтобы загрузить образ:
- на компьютере установите торрент-клиент BitTorrent или uTorrent;
- откройте страницу https://www.archlinux.org/download/ в браузере;
- в разделе «BitTorrent» нажмите на ссылку «Torrent»;
- откройте скачанный торрент-файл в торрент-клиенте BitTorrent или uTorrent;
- дождитесь, когда образ (ISO-файл) Arch Linux скачается на компьютер.
-
Запишите скачанный образ на чистый DVD-диск. Когда образ Arch Linux скачается, запишите его на чистый DVD-диск с помощью оптического привода компьютера. Когда диск будет записан, оставьте его в приводе.
- Если на компьютере нет DVD-привода, купите внешний оптический привод и подключите его к компьютеру через USB-кабель.
-
Нажмите «Пуск» «
> «Питание»
> «Перезагрузка».
- На компьютере Mac откройте меню «Apple», нажмите «Системные настройки» > «Загрузка» > «Внешний диск» > «Перезагрузка», а затем еще раз нажмите «Перезагрузка», когда появится запрос.
-
Нажмите клавишу, которая позволит войти в BIOS и изменить основное загрузочное устройство. На большинстве современных компьютеров это клавиша F12, но точная клавиша отображается на экране во время загрузки компьютера. Если вам не удается найти клавишу на экране, нажмите F1, F2, F10 или Del.
- Пропустите этот шаг на компьютере Mac.
-
Выберите установочный DVD-диск в качестве основного загрузочного устройства. В меню выделите соответствующую опцию, например, «DVD Drive» (DVD-привод) или «Disk Drive» (Оптический привод), а затем нажимайте на клавишу + до тех пор, пока эта опция не окажется в верхней части меню.
- Пропустите этот шаг на компьютере Mac.
- На некоторых компьютерах сначала перейдите на вкладку «Advanced» (Дополнительно) или «Boot Options» (Параметры загрузки).
-
Для этого нажмите соответствующую клавишу, которая отображается в нижней части экрана или в правом нижнем углу экрана. Компьютер будет перезагружен.
- Пропустите этот шаг на компьютере Mac.
-
Установщик Arch Linux будет запущен; теперь жесткий диск можно разбить на разделы.
Реклама
-
В данный момент к компьютеру подключены как минимум два диска: жесткий диск и DVD-диск с установщиком Arch Linux. Чтобы проверить подключенные диски:
- введите fdisk -l и нажмите ↵ Enter;
- найдите имя диска самой большой емкости; имя похоже на «/dev/sda» и расположено справа от «Disk» (Диск).
-
Введите cfdisk [имя диска], где вместо [имя диска] подставьте имя жесткого диска, а затем нажмите ↵ Enter. Теперь выберите «DOS» и снова нажмите ↵ Enter.
- Например, если имя диска «/dev/sda», в терминале введите cfdisk /dev/sda.
-
Выберите раздел (посередине экрана), потом выберите «Удалить» (в нижней части экрана), а затем нажмите ↵ Enter; повторите описанные действия с любым разделом, который отобразится посередине экрана. В итоге на экране должна появиться строка Pri/Log Free Space (Пустое пространство).
-
Этот раздел будет работать как оперативное запоминающее устройство системы Arch Linux. Для этого:
- выберите «New» (Создать) и нажмите ↵ Enter;
- выберите «Primary» (Первичный) и нажмите ↵ Enter;
- введите число мегабайт (например, 1024 для одного гигабайта) и нажмите ↵ Enter; как правило, размер swap-раздела должен быть в 2-3 раза больше размера оперативной памяти (например, если оперативная память компьютера равна 4 ГБ, swap-раздел должен быть равен 8192 МБ или 12288 МБ);
- выберите «End» (Завершить) и нажмите ↵ Enter.
-
На этом разделе будут храниться файлы операционной системы Archix и другая информация. Для этого:
- выберите раздел «Pri/Log Free Space» (Пустое пространство);
- выберите «New» (Создать) и нажмите ↵ Enter;
- выберите «Primary» (Первичный) и нажмите ↵ Enter;
- убедитесь, что число, которое находится в строке «Size (in MB)» (Размер [в MБ]), верное;
- нажмите ↵ Enter;
- еще раз выберите первичный раздел;
- выберите «Bootable» (Загрузочный) и нажмите ↵ Enter.
-
Так он превратится в аналог оперативной памяти системы:
- выберите swap-раздел;
- выберите «Type» (Тип) и нажмите ↵ Enter;
- введите 82 и нажмите ↵ Enter;
- если swap-раздел все еще выделен, выберите «Write» (Запись) и нажмите ↵ Enter;
- введите yes (да) и нажмите ↵ Enter.
-
В столбце «Name» (Имя) в левой части экрана найдите имя у swap-раздела (например, «sda1») и у первичного раздела (например, «sda2»). Вам понадобятся имена, чтобы отформатировать разделы.
-
Выберите «Quit» (Выход) и нажмите ↵ Enter.
-
Так вы сможете использовать его в операционной системе. Для этого введите mkfs.ext4 /dev/[имя первичного раздела] и нажмите ↵ Enter.
- Например, если имя первичного раздела «sda2», введите mkfs.ext4 /dev/sda2.
-
Введите mount /dev/[имя раздела]/mnt и нажмите ↵ Enter. Раздел станет диском, с которым можно работать.
-
Введите mkswap /dev/[имя раздела] и нажмите ↵ Enter, а затем введите swapon /dev/[имя раздела] и нажмите ↵ Enter. Теперь можно установить Arch Linux.
- Например, если имя swap-раздела «sda1», введите mkswap /dev/sda1, а затем введите swapon /dev/sda1.
Реклама
-
Если компьютер подключен к маршрутизатору через Ethernet-кабель, пропустите этот шаг, потому что проводное соединение предпочтительнее беспроводного. [1]
- введите ip link и нажмите ↵ Enter, чтобы определить имя сетевого интерфейса сетевого адаптера;
- введите pacman -S iw wpa_supplicant и нажмите ↵ Enter, чтобы установить необходимое программное обеспечение;
- введите pacman -S dialog и нажмите ↵ Enter, чтобы установить меню беспроводного адаптера;
- введите pacman -S wpa_actiond и нажмите ↵ Enter, чтобы установить программное обеспечение, которое позволит автоматически подключаться к известным сетям;
- введите systemctl enable netctl-auto@имя_интерфейса.service, чтобы включить службу автоматического подключения беспроводного адаптера;
- В следующий раз, когда вы перезагрузите компьютер, введите wifi-menu имя_интерфейса, чтобы открыть меню беспроводного адаптера. Когда вы впервые подключитесь к сети, последующие подключения (после перезагрузки/включения компьютера) будут происходить в автоматическом режиме. Не вводите эту команду на данном этапе; в противном случае вы лишитесь доступа к сети.
-
Введите pacstrap/mnt base base-devel и нажмите ↵ Enter. Начнется установка системы на компьютер.
- Как правило, этот процесс занимает около 15–30 минут в зависимости от скорости интернет-соединения.
-
Введите arch-chroot/mnt и нажмите ↵ Enter. Теперь можно изменить параметры корневого каталога, включая пароль.
-
Вы будете пользоваться этим паролем, чтобы войти в учетную запись администратора (root-аккаунт). Для этого:
- введите passwd и нажмите ↵ Enter;
- введите пароль и нажмите ↵ Enter;
- еще раз введите пароль и нажмите ↵ Enter.
-
Для этого:
- введите nano /etc/locale.gen и нажмите ↵ Enter;
- прокрутите вниз и выберите нужный язык;
- выделите букву, которая находится непосредственно перед символом «#» (за нужным языком) и нажмите Del;
- удалите символ «#» из других версий языка (например, всех версий «ru_RU»);
- нажмите Ctrl+O (или ⌘ Command+O на компьютере Mac), а затем нажмите ↵ Enter;
- выйдите, нажав Ctrl+X или ⌘ Command+X;
- введите locale-gen и нажмите ↵ Enter, чтобы завершить настройку языка.
-
Для этого:
- введите cd usr/share/zoneinfo и нажмите ↵ Enter;
- введите ls и нажмите ↵ Enter;
- найдите свою страну или регион, а затем введите cd usr/share/zoneinfo/страна (например, Russia) и нажмите ↵ Enter;
- еще раз введите ls и нажмите ↵ Enter;
- найдите нужный часовой пояс, а затем введите ln -s/usr/share/zoneinfo/страна/часовой пояс/etc/localtime и нажмите ↵ Enter.
-
Для этого введите echo имя > /etc/hostname и нажмите ↵ Enter.
- Например, чтобы компьютер назывался «Panda», введите echo Panda > /etc/hostname.
-
Это программа, которая установит Arch Linux. Для этого:
- введите pacman -S grub-bios и нажмите ↵ Enter;
- введите y и нажмите ↵ Enter;
- дождитесь, когда GRUB скачается.
-
Убедитесь, что устанавливаете GRUB на жесткий диск (например, «sda»), а не на раздел (например, «sda1»). Чтобы установить GRUB:
- Введите grub-install /dev/имя диска (например, grub-install /dev/sda) и нажмите ↵ Enter.
-
В нем хранится информация об оборудовании компьютера, то есть с помощью этого файла система сможет работать с компьютерными комплектующими. Введите mkinitcpio -p linux и нажмите ↵ Enter.
-
Введите grub-mkconfig -o /boot/grub/grub.cfg и нажмите ↵ Enter.
-
Введите genfstab/mnt >>/mnt/etc/fstab и нажмите ↵ Enter. Так Arch Linux сможет идентифицировать файловые системы раздела.
-
Введите umount/mnt и нажмите ↵ Enter, а затем введите reboot и нажмите ↵ Enter. Извлеките DVD-диск и дождитесь, когда компьютер перезагрузится.
-
Введите root в строке «login» и нажмите ↵ Enter, а затем введите пароль и нажмите ↵ Enter. Теперь вы успешно установили и запустили Arch Linux на компьютере.
- Чтобы установить графический интерфейс пользователя, который позволит пользоваться мышью, установите GNOME на компьютере.
Реклама
Советы
- Описанный метод подразумевает установку базовой системы, которая использует только командную строку. Существует множество менеджеров рабочего стола или других аналогичных программ, которые можно установить в системе.
Реклама
Предупреждения
- Пароль к административной учетной записи должен быть надежным и легко запоминающимся. Если вы забудете его, вы не сможете полноценно работать с системой.
Реклама
Об этой статье
Эту страницу просматривали 59 562 раза.
Была ли эта статья полезной?
Dual Boot Arch Linux and windows 11/10 . Install Arch Linux With GUI alongside windows 11. This is a complete step by step tutorial of Arch linux installation 2024.
This Article walks you through the installation guide of Arch Linux With Plasma Desktop and dual Boot with windows 11. Using dual boot you can setup windows 11 and arch Linux on the same drive.
The Pre-requisites of this video
* You need Windows 11 or Windows 10 installed on your PC or laptop.
* An 8 GB or higher USB drive to create a bootable disk with ArchLinux
* At least 40GB of free space reserved from your existing drive.
Creating Free Space For ARCH LINUX
- Open command prompt and type DISKMGMT to access disk manager.
- View connected drives and their partitions.
- Identify the target drive (e.g., Drive 0) with its partitions.
- Choose the C Or D or Any Drive for ArchLinux and right-click on it.
- Select “shrink volume” to allocate free space for ArchLinux.Allocate a minimum of 40GB or more (type in MegaBytes, e.g., 200,000 MB).Click “shrink” to create unallocated free space
Download ArchLinux & Make Bootable USB
- Download the Arch ISO from HERE
- Connect a USB stick to your computer.Use Rufus to burn the downloaded ISO image to the USB drive.
Create System Restore Point
It is recommended to create a System Restore point before installing Archlinux. This option allows you to take a snapshot of the current state of the system. If something goes wrong with the Arch installation, you can use this backup to restore your system to normal.
BIOS Settings
- Reboot your computer.
- During the reboot, enter the BIOS settings using the keyboard shortcut (commonly F2, F9, or ESC).
- In UEFI BIOS, enable USB boot and set the USB drive as the primary boot order.
- Disable secure boot in the BIOS settings.
- If available, enable options like Microsoft’s third-party UEFI.
- Consider clearing any keys or certificates after disabling secure boot.
- Save the changes in the BIOS settings.
- Your system should now boot into ArchLinux from the USB drive.
- If the boot fails, use the boot menu to load Arch install media.
Increase Console FONT
Now, on your monitor, you will see a terminal expecting input. Note that the mouse functionality is disabled so you need to rely on the keyboard
Type setfont ter-132n
and press enter to increase the size of the console.
Using iWCTL for WIFI Connection
If using built-in WiFi support, use the iwctl tool to connect to the internet.
- To find list of network interfaces type:
iwctl device list
- To search for WIFI Networks type:
iwctl station wlan0 get-networks
- To connect to WIFI network type:
iwctl station wlan0 connect WIFI_NAME
- Once connected run :
ping google.com
to check internet connection (Interrupt Ping with CTRL + C) - Then type the command to syncnorize the package database:
pacman -Sy
- Then Type this command :
pacman -S archlinux-keyring
Create Partitions For Arch Linux
- Type
lsblk
to list all connected drives on the PC. - Identify the main drives, focusing on SDA or NVME (ignore loops).
- NVME0n1 is MY drive with Windows 11, and SDA is the BootableUSB.
- Create partitions for Arch Linux using earlier free space.
- Type cfdisk /dev/nvme0n1 and press enter.
- Use arrow keys for selection and enter key for confirmation.
- Scroll to free space and create 3 partitions: EFI, ROOT, and swap.
- Create EFI partition (e.g., 800MB) with type EFI System.
- Create ROOT partition (e.g., 20GB or higher) with type Linux file system.
- Use remaining free space for swap partition with type Linux SWAP.
- Write changes to alter the disk and exit from CFDisk.
Formatting Partitions
- Type lsblk to view all newly created partitions
- NVME0N1P5 for EFI, NVME0N1P6 for Root, and NVME0N1P7 for Swap.
- Format the Arch EFI Partition (e.g., NVME0N1p5)
mkfs.fat -F32 /dev/nvme0n1p5
- Format the root partition (e.g., NVME0N1p6)
mkfs.ext4 /dev/NVME0N1p6
- Format the swap partition (e.g., nvme0n1p7)
mkswap /dev/nvme0n1p7
Mount Partitions
- Mount the root partition (e.g., NVME0n1p6) to the “mnt” directory.
mount /dev/nvme0n1p6 /mnt
- Create a directory inside “
mnt
” and name it “boot
,” then mount the EFI partition to this directory.
mkdir /mnt/boot
mount /dev/nvme0n1p5 /mnt/boot
- Enable the swap partition by typing
swapon /dev/nvme0n1p7
- Verify proper mounting of all partitions by typing
lsblk
Installing ArchLinux
Now, it’s time to install the Arch Linux to the root partition which Is mounted to /mnt.
pacstrap -i /mnt base base-devel linux linux-headers linux-firmware amd-ucode sudo git nano vim neofetch htop cmake make bluez bluez-utils networkmanager cargo gcc mpv
Run the above command to start installing the base system of Arch Linux. Accept the defaults. This will take some time, sit back, relax, and don’t interrupt the computer.
Generate File System Table (FSTAB)
It’s time to generate a file system table. If you notice, the NVME partitions are mounted to the live session of USB, but when we boot arch from the main drive we need to tell the system to mount all these partitions to the same location.
genfstab -U /mnt >> /mnt/etc/fstab
CHROOT To Newley Installed system
So far we are running everything from the Live Session. It’s Time to enter, into the drive where we have installed Arch Linux. For that type:
arch-chroot /mnt
Now you can see the prompt has changed to something else, which means we have entered into the actual drive as a root user.
Change Root Password
Then type passwd
and set the root password. This is a superuser account and is known as a top-tier user in Linux.
Adding a Standard User
Also, we are going to create a standard user by tying the below command and replace the username placeholder with your name
useradd -m -g users -G wheel,storage,video,audio -s /bin/bash USER_NAME
Then set the password by typing
passwd USER_NAME
Now, we have added this new user to the wheel group and other groups. The Wheel group allows the user to access root privileges with a sudo command. For that, we need to edit the sudoers file. Type the below command
EDITOR=nano visudo
Uncomment the line in the image and save the changes with CTRL + O and CTRL + X to Exit.
SetupTimezone/Region
- Use
ln -sf /usr/share/zoneinfo/
and press tab to see the list of available options. - Choose the appropriate timezone, for example
ln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime
- Synchronize the current time with the hardware clock using
hwclock --systohc
Setup System Language
It’s time to set a system language by generating a locale. Type the below command
nano /etc/locale.gen
Scroll all the way and uncomment the below line in the image and save the changes. This is going to tell the system to use American English as the system locale.
Now type the below commands to generate a locale & Config file
locale-gen
echo "LANG=en_US.UTF-8" >> /etc/locale.conf
Setup Host Name
Now, type the below command to set up the hostname of this computer. In this case, I am going to say “archlinux” and save the changes
echo "archlinux" >> /etc/hostname
Then type nano /etc/hosts
and add the below lines.
Make sure you replace the GREEN part with your hostname and save the changes
Grub-Installation
It’s time to install the grub boot loader which is going to help boot arch Linux. Type the below commands
pacman -S grub efibootmgr dosfstools mtools
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
Enable Services
systemctl enable bluetooth
systemctl enable NetworkManager
Then exit from Chroot by typing exit
& Unmount the partitions by typing
umount -lR /mnt
Shutdown the computer and eject the USB Stick
Connecting TO WIFI Using NMCLI
Once the system is restarted you can see the grub menu. From here you can boot into only Arch for now and Windows 11 boot entry will be missing.
We are going to fix that issue in a moment. For now, let’s just boot into Arch Linux. Now log in with your user account & increase the console font by typing below command
setfont -d
- Check the status of all network interfaces:
nmcli dev status
- Turn on the WIFI Radio:
nmcli radio wifi on
. - View available wifi networks with the command specified
nmcli dev wifi list
- Connect to wifi using the relevant command, replace placeholders with your network information and enclosing the password in double-quotes
sudo nmcli dev wifi connect WIFI_NAME password "WIFI_PASSWORD"
- Update the PACMAN database with:
sudo pacman -Sy
Installing GUI
It’s time to install the desktop environment. For Plasma Desktop Run the below commands
sudo pacman -S xorg sddm plasma-meta plasma-wayland-session kde-applications noto-fonts noto-font-emoji ttf-dejavu ttf-font-awesome
sudo systemctl enable sddm
For GNOME Desktop
sudo pacman -S xorg gdm gnome gnome-extra
sudo systemctl enable gdm
Then Reboot the system
sudo reboot now
and this time Arch Linux will boot With a GUI Environment
Fix Discover App Backend
The first thing to do after installing ArchLinux is to fix the Discover app backend. To do so open KONSOLE and type the below command to install flatpak and use it as a backend for discover.
sudo pacman -Sy flatpak
Install NVIDIA Drivers (Optional)
If you have a modern NVIDIA graphic card, it’s recommended to install NVIDIA proprietary drivers.
"This is completely optional, installing this package on older systems may or may not work, so please refer to this article"
Anyway, inside the konsole you can type the below command to set up NVIDIA drivers.
sudo pacman -Sy nvidia
Once it’s done, reboot your computer. Now if I type nvidia-smi
command inside the terminal you can see it shows the NVIDIA driver information.
Adding Windows Entry To GRUB
- Install OS-Prober with the command provided
sudo pacman -Sy os-prober
- Edit the grub file,
sudo nano /etc/default/grub
- Set the
GRUB_TIMEOUT=20
- Scroll to the bottom and uncomment the line related to os-prober.
Save changes with ctrl + o and exit with ctrl + x.
Run grub-mkconfig -o /boot/grub/grub.cfg
to update the grub configuration.Verify that Windows boot manager is detected.
Reboot the system. Using the grub menu you can boot into either Arch or Windows 11
Removing ArchLinux From Dual Boot
- Reboot your computer and boot into Windows 11.
- Open Disk Management utility by typing diskmgmt in the search bar.
- Delete each new partition by right Clicking created during ArchLinux installation, starting with swap and root partitions.
- “Note that the LINUX EFI partition cannot be deleted using Disk Management“
- Open Command Prompt as an administrator and type
DISKPART
- Type
list disk
to view all connected drives, select the appropriate drive with
select disk 0
- Type
list partition
to view all partitions on the selected drive. - Identify the Arch EFI partition (e.g., partition 5).
- Select the Arch EFI partition with
select partition [number]
- Type
DELETE PARTITION OVERRIDE
to remove the partition. - Verify the deletion in Disk Management; the free space is now available.
- Utilize the gained free space to merge it back into Windows 11 partitions