Advertisement
FocusedWolf

Arch: Installing packages like a boss

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