Skip to content

Latest commit

ย 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

README.md

๐Ÿ–ฅ๏ธ Arch Linux Installation Guide for Lenovo Legion Y520

Complete workstation setup for DevOps, Cloud Engineering, and Development

This repository contains a comprehensive guide to install and configure Arch Linux on the Lenovo Legion Y520 laptop. The setup is optimized for professional development work with full GPU support (NVIDIA Optimus), security hardening, and DevOps tools.


๐Ÿ“š Documentation Structure

This repository is organized into several sections covering different aspects of the installation and configuration:

๐Ÿ—๏ธ Installation Guides

Document Description
README.md Base Arch Linux installation (this document)
01-desktop.md Desktop environment (Xorg, XFCE/KDE, NVIDIA, Optimus Manager)
02-utils.md System utilities, Zsh, optimizations, power management
03-software.md Essential applications, Steam, VirtualBox, Wine

๐Ÿ”ง Software Configuration

Document Description
software/postgress.md PostgreSQL installation and remote access
software/postgress_tips.md PostgreSQL users, databases, and roles management
software/gnome_keyring.md GNOME Keyring for secure password storage
software/droid_cam.md Virtual webcam setup with DroidCam
software/rclone.md Rclone with Google Drive mount

๐Ÿš€ PACUSER Suite

The PACUSER scripts are located in the ../scripts/ directory. Run the main orchestrator with ./pacmaster.sh for automated post-installation setup.


๐ŸŽฏ Key Features

Hardware Support

  • NVIDIA Optimus - Automatic GPU switching (Intel/NVIDIA)
  • Lenovo Legion Y520 - Full hardware support
  • Hybrid Graphics - Power saving and performance modes

Security

  • UFW Firewall - Pre-configured DevOps rules
  • Fail2Ban - SSH brute-force protection
  • GNOME Keyring - Secure credential storage

Development Tools

  • Docker & Docker Compose - Containerization with NVIDIA runtime
  • Kubernetes - kubectl, helm, k9s, kubectx
  • PostgreSQL - Database server with remote access
  • VSCode & Windsurf - AI-powered IDEs

System Optimization

  • TLP & Intel Undervolt - Power management
  • ZRAM - Memory compression
  • BBR + CAKE - Network optimization
  • Custom kernel tuning - DevOps-optimized sysctl


๐Ÿš€ Quick Start

Option 1: Manual Installation

Follow the step-by-step guide below for a complete manual installation.

Option 2: Automated Setup (Recommended)

Use the PACUSER v2.0 suite for automated post-installation:

cd ../pacuser
cp app/config/pacuser.conf app/config/pacuser.conf.local
nano app/config/pacuser.conf.local  # Customize your settings
./pacmaster.sh

Before starting the installation, ensure you have:

  • A bootable Arch Linux USB drive
  • An active internet connection
  • Backup of any important data from the device (installation will wipe all data on the disk)
  • Access to UEFI/BIOS settings to boot from USB

๐Ÿ“ฅ Installation Guide

1. Verify System Connection

2. Set Keyboard Layout

Set the keyboard layout to Italian (or your preferred layout):

loadkeys it

3. Update System Clock

Synchronize the system clock with NTP and set timezone:

timedatectl set-ntp true
timedatectl set-timezone Europe/Rome

4. Partitioning the Disk

Use cfdisk to create the following partitions on /dev/nvme0n1:

Partition Size Type
EFI 512MB EFI System
Swap 4GB Linux swap
Root (/) 50GB Linux filesystem
Home (/home) Remaining Linux filesystem
cfdisk /dev/nvme0n1

5. Format the Partitions

mkfs.fat -F32 /dev/nvme0n1p1  # EFI Partition
mkswap /dev/nvme0n1p2        # Swap Partition
swapon /dev/nvme0n1p2        # Activate swap
mkfs.ext4 /dev/nvme0n1p3      # Root Partition
mkfs.ext4 /dev/nvme0n1p4      # Home Partition

6. Mount the Partitions

mount /dev/nvme0n1p3 /mnt
mkdir /mnt/home
mount /dev/nvme0n1p4 /mnt/home
mkdir -p /mnt/boot/efi
mount /dev/nvme0n1p1 /mnt/boot/efi

7. Install Base System

pacstrap /mnt base base-devel linux linux-firmware linux-headers intel-ucode nano git networkmanager
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt /bin/bash

8. Configure the System

Set Timezone

ln -sf /usr/share/zoneinfo/Europe/Rome /etc/localtime
hwclock --systohc

Configure Locale

nano /etc/locale.gen  # Uncomment it_IT.UTF-8 UTF-8
locale-gen
echo "LANG=it_IT.UTF-8" > /etc/locale.conf

Set Keyboard Layout

echo "KEYMAP=it" > /etc/vconsole.conf

Set Hostname

echo "archlegion" > /etc/hostname

Configure Hosts File

nano /etc/hosts

Add:

127.0.0.1   localhost
::1         localhost
127.0.1.1   archlegion.localdomain    archlegion

Set Password for Root

passwd

Create a New User

useradd -m -G wheel,storage,power,audio,video,users -s /bin/bash username
passwd username
echo "username ALL=(ALL) ALL" | EDITOR=nano visudo

9. Install Bootloader (GRUB)

pacman -S grub efibootmgr dosfstools mtools --noconfirm
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg

10. Network Configuration

systemctl enable NetworkManager

11. Finalizing the Installation

exit
umount -R /mnt
reboot

๐Ÿ”ง Post-Installation Steps

After rebooting, follow these guides for a complete setup:

  1. Desktop Environment - See 01-desktop.md

    • Install Xorg and KDE Plasma/XFCE
    • Configure NVIDIA drivers and Optimus Manager
    • Set up display manager
  2. System Utilities - See 02-utils.md

    • Configure Zsh with Oh My Zsh
    • Install system optimizations
    • Set up power management (TLP, Intel Undervolt)
    • Configure firewall (UFW) and Fail2Ban
  3. Software Installation - See 03-software.md

    • Install essential applications
    • Set up Steam and VirtualBox
    • Configure Wine for Windows applications
  4. Automated Setup - Use PACUSER v2.0

    cd ../pacuser
    ./pacmaster.sh

๐Ÿ” Security Configuration

Firewall Setup

The system includes UFW firewall with DevOps-optimized rules:

sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 22/tcp    # SSH
sudo ufw allow 80/tcp    # HTTP
sudo ufw allow 443/tcp   # HTTPS
sudo ufw enable

Fail2Ban Setup

sudo pacman -S fail2ban --noconfirm
sudo systemctl enable fail2ban
sudo systemctl start fail2ban

GNOME Keyring

For secure password storage, see software/gnome_keyring.md.


๐Ÿ—„๏ธ Database Setup

PostgreSQL Installation

Complete PostgreSQL setup with remote access configuration:

Quick setup:

sudo pacman -S postgresql
sudo -u postgres initdb --locale it_IT.UTF-8 -D /var/lib/postgres/data
sudo systemctl start postgresql
sudo systemctl enable postgresql

๐Ÿ“ฑ Additional Tools

Virtual Webcam

Set up a virtual webcam using DroidCam:

sudo pacman -S v4l2loopback-dkms linux-headers
yay -S droidcam

See software/droid_cam.md for complete configuration.

Cloud Storage

Mount Google Drive with Rclone:

sudo pacman -S rclone
rclone config

See software/rclone.md for detailed setup instructions.


๐ŸŽฎ Gaming & Performance

GPU Switching

Switch between Intel (power saving) and NVIDIA (performance) GPUs:

optimus-manager --switch intel   # Power saving
optimus-manager --switch nvidia  # Performance

Steam Setup

yay -S steam

Power Management

  • TLP - Advanced power management
  • Intel Undervolt - CPU/GPU undervolting
  • ZRAM - Memory compression

See 02-utils.md for complete optimization guide.


๐Ÿ› ๏ธ Troubleshooting

NVIDIA Issues

nvidia-smi                    # Check GPU status
optimus-manager --status      # Check current GPU mode
sudo reboot                   # Required after driver changes

Docker Issues

sudo usermod -aG docker $USER
newgrp docker

Network Issues

sudo ufw status numbered      # Check firewall
sudo systemctl status NetworkManager

๐Ÿ“– Additional Resources


๐Ÿ“„ License

MIT License - See LICENSE for details.


โญ Star the Project

If this guide helped you set up your Arch Linux workstation, consider giving it a star on GitHub!