Skip to content

Instantly share code, notes, and snippets.

@uncomfyhalomacro
Forked from juancarlospaco/arch-tricks.md
Last active January 13, 2022 09:59
Show Gist options
  • Save uncomfyhalomacro/ded5d0ce3db64d6f63a252212af811c7 to your computer and use it in GitHub Desktop.
Save uncomfyhalomacro/ded5d0ce3db64d6f63a252212af811c7 to your computer and use it in GitHub Desktop.
Arch Linux Tips & Tricks

Required Packages

sudo pacman -S xdelta3 ccache axel

pacman.conf

sudo cp /etc/pacman.conf /etc/pacman.conf.backup
sudo nano /etc/pacman.conf

Search & replace:

XferCommand = /usr/bin/axel -n 2 -v -a -o %o %u
  • Uses axel instead of curl for faster downloads.
UseDelta = 0.75
  • Use Binary Deltas for packages for faster downloads.
# Misc options
#UseSyslog
Color
CheckSpace
VerbosePkgLists
  • Use color on the terminal, display download totals, check free space before download.

makepkg.conf

sudo cp /etc/makepkg.conf /etc/makepkg.conf.backup
sudo nano /etc/makepkg.conf

Search & replace:

DLAGENTS=('ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
          'http::/usr/bin/axel -n 2 -v -a -o %o %u'
          'https::/usr/bin/axel -n 2 -v -a -o %o %u'
          'rsync::/usr/bin/rsync --no-motd -z %u %o'
          'scp::/usr/bin/scp -C %u %o')
  • Uses axel instead of curl for faster downloads.
MAKEFLAGS="-j$(nproc)"
COMPRESSGZ=(gzip -c -f -n -p)
COMPRESSBZ2=(bzip2 -c -f -p$(nproc))
COMPRESSXZ=(xz -c -z - --threads=$(nproc))
COMPRESSLRZ=(lrzip -q --threads=$(nproc))
  • Uses Multi-Threading for Compression tools for faster installs.
BUILDENV=(!distcc color ccache check !sign)
  • Use ccache for faster installs/compilations.
CFLAGS="-march=native -mtune=native -O2 -pipe -fstack-protector-strong"
CXXFLAGS="-march=native -mtune=native -O2 -pipe -fstack-protector-strong"
  • Make compilers optimize compiled binaries for your CPU for faster executables.

journald.conf

Clean out, Delete old unused rotated Logs, leaving the most recent last one:

sudo journalctl --vacuum-files=1

Disable Logging logs to disk:

sudo nano /etc/systemd/journald.conf

Edit it like:

[Journal]
Storage=none

Delete old packages:

sudo pacman -Scc
  • Delete old Pacman package Caches, you can reply y to all questions.
sudo pacman -R libgo
  • If you installed/compiled a Go lang app, it leaves you a 50~90Mb lib on GCC folders, only used to develop on Go, if you are not a go lang developer you can just delete it.

/etc/hosts

sudo cp /etc/hosts /etc/hosts.backup
sudo nano /etc/hosts

Add on the bottom:

# ADS
127.0.0.1 adclick.g.doublecklick.net
127.0.0.1 googleadservices.com
127.0.0.1 open.spotify.com
127.0.0.1 pagead2.googlesyndication.com
127.0.0.1 desktop.spotify.com
127.0.0.1 googleads.g.doubleclick.net
127.0.0.1 pubads.g.doubleclick.net
127.0.0.1 audio2.spotify.com
127.0.0.1 spclient.wg.spotify.com
127.0.0.1 securepubads.g.doubleclick.net
127.0.0.1 static.doubleclick.net
127.0.0.1 ad.doubleclick.net
  • Block Ads, make Spotify dont play/display Ads.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment