Skip to content

Latest commit

 

History

History
104 lines (66 loc) · 3.77 KB

MAINTENANCE.md

File metadata and controls

104 lines (66 loc) · 3.77 KB

System maintenance

Arch is a rolling release system and has rapid package turnover, so users have to take some time to do system maintenance.

Disable hardware speaker

echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf

Kernel tweaks

echo "vm.dirty_writeback_centisecs=6000" >> /etc/sysctl.d/vm.conf
echo "vm.max_map_count=1048576" >> /etc/sysctl.d/vm.conf

Power optimization

[!] You can install tlp package if you don't want to use power-profiles-daemon.

pacman -Sy tlp tlp-rdw
systemctl enable --now tlp.service
systemctl enable --now NetworkManager-dispatcher.service

# tlp settings: https://linrunner.de/tlp/settings/index.html
nano /etc/tlp.conf
systemctl restart tlp.service

Sound

Check that Pipewire is installed correctly:

pactl info | grep Pipe

Pacman

System update after a long break

Before updating a system that has not been updated for more than a month, first of all update keyring

pacman -Sy archlinux-keyring

Enabling parallel package downloads

Pacman 6.0 introduced the option to download packages in parallel. ParallelDownloads under [options] needs to be set to a positive integer in /etc/pacman.conf to use this feature (e.g., 5). Packages will otherwise be downloaded sequentially if this option is unset.

Mirrors

Visit the Mirrors article for steps on taking full advantage of using the fastest and most up to date mirrors of the official repositories. As explained in the article, a particularly good advice is to routinely check the Mirror Status page for a list of mirrors that have been recently synced. This can be automated with Reflector.

Cleaning the package cache

Pacman stores its downloaded packages in /var/cache/pacman/pkg/ and does not remove the old or uninstalled versions automatically. This has some advantages:

  • It allows to downgrade a package without the need to retrieve the previous version through other means, such as the Arch Linux Archive.
  • A package that has been uninstalled can easily be reinstalled directly from the cache directory, not requiring a new download from the repository.

However, it is necessary to deliberately clean up the cache periodically to prevent the directory to grow indefinitely in size.

The paccache(8) script, provided within the pacman-contrib package, deletes all cached versions of installed and uninstalled packages, except for the most recent three, by default:

paccache -r

Enable and start paccache.timer to discard unused packages weekly.

pacman -Sy pacman-contrib
systemctl enable --now paccache.timer

To remove all the cached packages that are not currently installed, and the unused sync database, execute:

pacman -Sc

To remove all files from the cache, use the clean switch twice, this is the most aggressive approach and will leave nothing in the cache directory:

pacman -Scc

Remove orphaned packages

pacman -Qdtq | pacman -Rns -

Firewall

A firewall can provide an extra layer of protection on top of the Linux networking stack. It is highly recommended to set up some form of firewall.

See Category:Firewalls for available guides.