Advertisement
FocusedWolf

Arch: Installing packages like a boss

Jun 23rd, 2024 (edited)
808
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.79 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 sudo
  157.     # firefox    <-- I use [$ yay -S librewolf-bin] now.
  158.     fastfetch
  159.     gimp inkscape
  160.     steam wine winetricks wine-mono wine-gecko
  161.     kdialog
  162.     neovim neovide ttf-hack-nerd mousepad
  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.     konsole
  173.     kate # NOTE: This also installs kwrite.
  174.     dolphin dolphin-plugins kio-admin
  175.  
  176.     ark
  177.     p7zip # Needed by ark to open 7-zip files.
  178.     unrar # Needed by ark to open rar files.
  179.  
  180.     kcalc
  181.     gwenview
  182.     filelight
  183.     spectacle
  184.     okular
  185.     gparted
  186.     ksystemlog
  187.     gsmartcontrol # Harddisk health inspector.
  188.     plasma-systemmonitor # Task Manager.
  189.     plasma-desktop plasma-nm
  190.     egl-wayland plasma-wayland-protocols # Wayland.
  191.  
  192.     sddm # Display manager.
  193.  
  194.     grub efibootmgr os-prober # Boot loader.
  195. )
  196. pacstrap -K /mnt "${packages[@]}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement