Manjaro Linux: Tips 'n Tricks
I love Manjaro Linux, based on Arch Linux. It's the right distribution for me:
- Simple. Conceptually and operationally. Install it, and it works. Everything is where it should be.
- Fresh. It is a rolling release: every program is always kept up-to-date. At all time. You don't have to wait for next release until feature X of your favorite program is made available for your distribution. And especially, you don't have to upgrade (or reinstall) your distribution in order to get your much needed feature. Never.
- Stable. Even if your system is continuously being updated, Arch and Manjaro teams do a very good job in keeping your system completely functional at all time. I've had fewer problems with Manjaro than with any other operating systems at all (including Windows, of course).
- Fast and lean. Systemd boots your system in a few seconds. Manjaro is fast, really fast.
- Complete. You need a program? The latest version is in the official repository. If not, it is in the AUR. What is the AUR? The Arch User Repository, a user-contributed repository that contains "receipes" (scripts) to automatically download, compile, package and install almost any Linux-related piece of software on the earth. You issue a single command, and your program gets installed.
- Infinitely customizable. Everything is modular. Everything can be modified. The exceptional Arch wiki explains in a clear and concise way how to customize every aspect of the system.
Summarizing, Manjaro is fun.
I feel that some aspects of the system shoud be cofigured differently, by default. I always tune the OS a little bit when I install it on a new computer. I'm going to explain the most important things that I change, both as a future reference for me, and to share it with the community.
Systemd journal size limit
Systemd journal contains a log of what happens in the system, especially during boot. It can be useful if something goes wrong, but, if you don't limit its size (so that it contains the latest messages only), it ends up in growing too much. From the Arch wiki:
If the journal is persistent (non-volatile), its size limit is set to a default value of 10% of the size of the respective file system. For example, with /var/log/journal
located on a 50 GiB root partition this would lead to 5 GiB of journal data. The maximum size of the persistent journal can be controlled by SystemMaxUse
in /etc/systemd/journald.conf
, so to limit it for example to 50 MiB uncomment and edit the corresponding line to:
SystemMaxUse=50M
Use the fastest mirrors
When you download software or updates from the repository, be sure to connect to the fastest mirror. It is determined automatically by Manjaro: simply run the utility
sudo pacman-mirrors -g |
Access the AUR through Pacaur
Yaourt is the default utility to install a program from the AUR. It has two problems: it is very verbose (it interrupts the installation continually to ask (silly) questions), and the default configuration makes it unable to install large packages (because it compiles them in RAM).
We address both the problems by installing and configuring an alternative package manager, pacaur. Install it using yaourt:
yaourt -S pacaur |
Then, I suggest to change these options in the config file /etc/xdg/pacaur/config:
builddir=/var/pacaur/tmp # build directory on disk: you must create and grant write permissions to this dir editpkgbuild=false # don't ask if user wishes to edit build script editinstall=false # don't ask if user wishes to edit install script sudoloop=true # prevent timeout, if user doesn't insert sudo password in time |
Periodically clean package cache
When you download a package from the repositories, it is stored (forever) in a local cache. This may be useful, for example, to revert to a previous version of a package if a newer version does not work properly; however, it ends up polluting your hard disk. The following commands clear all but the latest 3 versions of each package that is actually installed on your system, and delete all of the older, and all of the unused packages:
sudo paccache -r sudo paccache -ruk0 |
Recommended proprietary software
- WPS Office Community (pacaur -S wps-office): free, but proprietary, office suite with a very good compatibility with Microsoft Office
- Foxit Reader (pacaur -S foxitreader): KDE Okualr is a beautiful and handy PDF viewer, but it lacks the capability to adjust the scale when printing. Use Foxit with caution, it is unmaintained (and thus potentially vulnerable).
- Microsoft Office: if you own a license of Microsoft Office 2010, you can install it on wine. Almost everything works:
- Using Q4Wine, create a new prefix named (for example) "Office2010", selecting a win32 architecture
- In Q4Wine system group, open winecfg and select:
- Windows version: Windows XP
- In Libraries > New override for library, type msxml6 and press Add; make sure it is added as Native, builtin (or Native, then builtin)
- Also add riched20 library, like before
- In Q4Wine, launch Office installer in the Office2010 prefix
- Run Word and proceed to online activation
- If you need to copy-paste from Songpress, also install Songpress for Windows in the Office2010 prefix
Some notes (useful for my own system)
BTRFS for system, EXT4 for /home
In Calamares select custom partitioning:
- locate the small (e.g., 230 MB) FAT32 EFI system partition. Mount to /boot/efi and apply flags: boot, esp
- locate the main Windows NTFS partition. Resize e.g. to 128 GB
- create a "mid-sized" BTRFS partition, e.g. 40 GB. Mount to / and apply flag: root
- create a large EXT4 partition filling the remaining space. Mount to /home
TLP switches off external sound card
TLP switches off external sound card (Lexicon Alpha) after some seconds of inactivity.
From Manjaro forum: Edit the file in /etc/default/tlp. Disable the autosuspend by editing a line like this:
USB_AUTOSUSPEND=0
Odroid printing server
- Configure printer in Odroid. Since HP proprietary plugin isn't (wasn't?) available for ARM processor, install foo2hp driver.
- Windows client machines: either use Windows driver or download and install driver from HP website (the latter correctly supports duplex printing).
Then, add a new printer and type the URL of the printer, exactly as it appears on Odroid CUPS web page, e.g. http://odroid:631/printers/HP-Color-LaserJet-CP1215 - Linux (Manjaro) client machines: no drivers needed, because rendering will take place on Odroid machine! To achieve this, IPP protocol must be used. Add a new printer and paste printer address, but replace protocol from http to ipp, e.g.: ipp://odroid:631/printers/HP-Color-LaserJet-CP1215
systemd-swap
Systemd-swap automatically manages swap files, allocating them dynamically.
sudo pacman -S systemd-swap
Now, swap will placed in /var/lib/systemd-swap/swapfc -- but I don't want to store cache in a BTRFS snapshotted volume. Thus we create (as root) a /home/swapfc directory, and we mount it on /var/lib/systemd-swap/swapfc:
- sudo mkdir /home/swapfc
- add the following line to /etc/fstab:
/home/swapfc /var/lib/systemd-swap/swapfc none defaults,bind 0 0 - sudo mount -av
Now, edit file /etc/systemd/swap.conf to enable swapfc: swapfc_enabled=1
Enable service and reboot (starting service is not enough):
sudo systemctl enable systemd-swap
reboot
Fish configuration
Fish configuration user file is (to be created): ~/.config/fish/config.fish
To enable CTRL-backspace in konsole add command: (in other terminals it may not work)
bind -k backspace backward-kill-word
To create an alias, and make it permanent, interactively type e.g.:
alias ducks 'du -cks * | sort -rn | head -11'
funcsave ducks
SSH keys
- Generate a local ssh key pair (run only once):
ssh-keygen
- Send the public ssh key to each client:
ssh-copy-id <user>@<client_name>