FocusedWolf

Arch: Installing packages like a boss

Jun 23rd, 2024 (edited)
963
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 6.75 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # POSTED ONLINE: https://pastebin.com/QqfPfgWv
  4.  
  5. # Usage:
  6. #
  7. # 1. Copy to Arch USB stick.
  8. #
  9. # 2. Boot system with Arch USB and begin install process.
  10. #
  11. # 3. Access the files you copied to Arch USB:
  12. #
  13. #     NOTE: First mount your root partition to /mnt/ or else you'll need to redo these steps after.
  14. #
  15. #     $ mkdir -p /mnt/usb
  16. #     $ lsblk -f    <-- Find the Arch USB device. It likely is /dev/sdb1.
  17. #     $ mount /dev/sdb1 /mnt/usb
  18. #     $ cd /mnt/usb/
  19. #     $ ls -al
  20. #     <Now you can see what you copied to the Arch USB>
  21. #
  22. # 4. Run this script when its time to install packages:
  23. #
  24. #     $ ./pacstrap.sh
  25. #
  26. # 5. Generate an fstab file:    <-- Done after pacstrap step if you follow https://wiki.archlinux.org/title/Installation_guide
  27. #
  28. #    $ genfstab -U /mnt >> /mnt/etc/fstab
  29. #
  30. #    NOTE: After running genfstab the mounted usb will get added to /mnt/etc/fstab.
  31. #          You need to remove these lines from /mnt/etc/fstab (e.g. $ vim /mnt/etc/fstab, delete the /usb line, and save)
  32. #          or else Linux will not boot without the USB plugged in:
  33. #
  34. #          # /dev/sdb1 LABEL=ARCH_######
  35. #          UUID=####-####          /usb        vfat        rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro   0 2
  36.  
  37. # Update pacman mirrors using reflector.
  38. reflector --verbose --country "United States" --latest 10 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
  39.  
  40. # Backup pacman config.
  41. cp /etc/pacman.conf /etc/pacman.conf.bak
  42.  
  43. # Create custom pacman.conf with desired settings.
  44. cat <<EOF > /etc/pacman.conf
  45. #
  46. # /etc/pacman.conf
  47. #
  48. # See the pacman.conf(5) manpage for option and repository directives
  49.  
  50. #
  51. # GENERAL OPTIONS
  52. #
  53. [options]
  54. # The following paths are commented out with their default values listed.
  55. # If you wish to use different paths, uncomment and update the paths.
  56. #RootDir     = /
  57. #DBPath      = /var/lib/pacman/
  58. #CacheDir    = /var/cache/pacman/pkg/
  59. #LogFile     = /var/log/pacman.log
  60. #GPGDir      = /etc/pacman.d/gnupg/
  61. #HookDir     = /etc/pacman.d/hooks/
  62. HoldPkg     = pacman glibc
  63. #XferCommand = /usr/bin/curl -L -C - -f -o %o %u
  64. #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
  65. #CleanMethod = KeepInstalled
  66. Architecture = auto
  67.  
  68. # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
  69. #IgnorePkg   =
  70. #IgnoreGroup =
  71.  
  72. #NoUpgrade   =
  73. #NoExtract   =
  74.  
  75. # Misc options
  76. #UseSyslog
  77. Color
  78. #NoProgressBar
  79. CheckSpace
  80. #VerbosePkgLists
  81. ParallelDownloads = 10
  82. DownloadUser = alpm
  83. #DisableSandbox
  84. ILoveCandy
  85.  
  86. # By default, pacman accepts packages signed by keys that its local keyring
  87. # trusts (see pacman-key and its man page), as well as unsigned packages.
  88. SigLevel    = Required DatabaseOptional
  89. LocalFileSigLevel = Optional
  90. #RemoteFileSigLevel = Required
  91.  
  92. # NOTE: You must run `pacman-key --init` before first using pacman; the local
  93. # keyring can then be populated with the keys of all official Arch Linux
  94. # packagers with `pacman-key --populate archlinux`.
  95.  
  96. #
  97. # REPOSITORIES
  98. #   - can be defined here or included from another file
  99. #   - pacman will search repositories in the order defined here
  100. #   - local/custom mirrors can be added here or in separate files
  101. #   - repositories listed first will take precedence when packages
  102. #     have identical names, regardless of version number
  103. #   - URLs will have $repo replaced by the name of the current repo
  104. #   - URLs will have $arch replaced by the name of the architecture
  105. #
  106. # Repository entries are of the format:
  107. #       [repo-name]
  108. #       Server = ServerName
  109. #       Include = IncludePath
  110. #
  111. # The header [repo-name] is crucial - it must be present and
  112. # uncommented to enable the repo.
  113. #
  114.  
  115. # The testing repositories are disabled by default. To enable, uncomment the
  116. # repo name header and Include lines. You can add preferred servers immediately
  117. # after the header, and they will be used before the default mirrors.
  118.  
  119. #[core-testing]
  120. #Include = /etc/pacman.d/mirrorlist
  121.  
  122. [core]
  123. Include = /etc/pacman.d/mirrorlist
  124.  
  125. #[extra-testing]
  126. #Include = /etc/pacman.d/mirrorlist
  127.  
  128. [extra]
  129. Include = /etc/pacman.d/mirrorlist
  130.  
  131. # If you want to run 32 bit applications on your x86_64 system,
  132. # enable the multilib repositories as required here.
  133.  
  134. #[multilib-testing]
  135. #Include = /etc/pacman.d/mirrorlist
  136.  
  137. [multilib]
  138. Include = /etc/pacman.d/mirrorlist
  139.  
  140. # An example of a custom package repository.  See the pacman manpage for
  141. # tips on creating your own repositories.
  142. #[custom]
  143. #SigLevel = Optional TrustAll
  144. #Server = file:///home/custompkgs
  145. EOF
  146.  
  147. # Install packages.
  148. packages=(
  149.     base base-devel linux-firmware
  150.     linux-firmware-qlogic
  151.     linux linux-headers nvidia nvidia-settings
  152.     intel-ucode
  153.     networkmanager
  154.     ufw
  155.     pipewire pipewire-alsa pipewire-jack pipewire-pulse wireplumber easyeffects alsa-utils
  156.     git htop reflector deluge vlc meld speedcrunch tmux okteta sudo
  157.     # firefox    <-- I use [$ yay -S librewolf-bin] now.
  158.     fastfetch
  159.     gimp inkscape
  160.     steam wine winetricks wine-mono wine-gecko
  161.     neovim neovide ttf-hack-nerd
  162.     gvim mousepad # For when neovim doesn't like me.
  163.     python tk python-pyperclip
  164.     wl-clipboard
  165.     flameshot
  166.     ntfs-3g dosfstools mtools gparted
  167.     gvfs
  168.  
  169.     # Install KDE.
  170.     plasma
  171.     xorg
  172.     kdialog
  173.     konsole # Terminal.
  174.     kate # Text editor i never use. NOTE: This also installs kwrite.
  175.     dolphin dolphin-plugins kio-admin
  176.     ark p7zip unrar # Archive management tools.
  177.     kcharselect # Character selector.
  178.     kcalc # Calculator.
  179.     gwenview # Image viewer.
  180.     kcolorchooser # Color picker.
  181.     filelight # Disk space usage.
  182.     spectacle # Screenshot capture.
  183.     okular # PDF and comic viewer.
  184.     gparted # Gnomes "GParted" is better (included with manjaro kde btw) than "KDE Partition Manager": partitionmanager
  185.     gnome-disk-utility # Gnomes other partition manager, that has a handy "Restore Disk Image..." feature that i use to burn iso's to usb instead of using $ dd command.
  186.     ksystemlog # System log viewer.
  187.     gsmartcontrol # Harddisk health inspector.
  188.     plasma-systemmonitor # Task Manager.
  189.     plasma-desktop plasma-nm
  190.  
  191.     kwallet kwalletmanager # Needed by KDE to encrypt credentials so they aren't plain text.
  192.     kwallet-pam # Allows for auto-unlock once configured.
  193.     libsecret # Allows GTK applications (like Chrome) to interface with KDE Wallet.
  194.  
  195.     # gnome-keyring # Only needed if you use GNOME apps that rely on the GNOME keyring.
  196.     # seahorse # GUI for GNOME keyring.
  197.  
  198.     # kaccounts-integration # For online account management (Google, Nextcloud, OwnCloud, etc.) in KDE.
  199.  
  200.     egl-wayland plasma-wayland-protocols # Wayland.
  201.  
  202.     sddm # Display manager.
  203.  
  204.     grub efibootmgr os-prober # Boot loader.
  205. )
  206. pacstrap -K /mnt "${packages[@]}"
Advertisement
Add Comment
Please, Sign In to add comment