[HowTo] Manjaro Linux - Maintenance - Using LTE network

From time to time comments like this appears - and you are correct - maintaining a Manjaro Linux with limited bandwidth is a challenge to be reckoned.

This guide has been written from the perspective of having only mobile broadband with a dataplan.

It should not be considered a best practise document but instead point out what to be aware of, and why.

update nagging

Disable Manjaro Package Manager Pamac’s built-in update nagging. The update nagging will pull metadata on every run, that is for a default Manjaro system (no aur) anywhere from a few megabytes up approx. 61 megabytes.

 $ ls -l -h /var/lib/pacman/sync
total 61M
-rw-r--r-- 1 root root 151K  1 jul 16:02 core.db
-rw-r--r-- 1 root root 2,3M 26 jun 00:03 core.files
-rw-r--r-- 1 root root 9,0M  1 jul 17:25 extra.db
-rw-r--r-- 1 root root  49M 26 jun 00:07 extra.files
-rw-r--r-- 1 root root 141K 30 jun 15:18 multilib.db
-rw-r--r-- 1 root root 277K 26 jun 00:07 multilib.files
-rw-r--r-- 1 root root    0 26 jun 10:44 refresh_timestamp

This can be done by editing the file /etc/pamac.conf and change this part

## How often to check for updates, value in hours (0 to disable):
RefreshPeriod = 0

TIP: The CLI editor micro can work with protected files without the need to run with sudo.

Or you can point, and click your system’s application launcher, to find Add/Remove SoftwarePreferences → Disable Check for updates.

carefully examine your system

Q: Why would I do that?
A: Because all packages present will be evaluated using the metadata and those with newer versions will be downloaded.

Examine your system for packages no longer needed.

A mundane example: You at some point tested different office packs to find the one suiting your use-case. When you settled on one but didn’t remove the other(s) you would be pulling many megabytes you do not need.

[INFO] Stable branch - BIG update BEST practice

evaluate your system’s condition

Before doing this - you may want to use pacman-mirrors --status to evaluate if you need to generate a list of up-to-date mirrors. If there is a green OK for the first mirror you are good to go.

It is important to remember to evaluate your system without changing the state of the package manager.

Please read the Pacman - Arch Wiki article and specifically note

Warning When installing packages in Arch, avoid refreshing the package list without upgrading the system (for example, when a package is no longer found in the official repositories). In practice, do not run pacman -Sy package_name instead of pacman -Syu package_name , as the former could lead to dependency issues. See System maintenance#Partial upgrades are unsupported and BBS#89328.

Q: Why is that important?
A: Using the package manager to check for updates will replace your current metadata.

If you check for updates using the package manager, and then decides - not now - your system is in a partial-sync-state. This means that any subsequent addition of packages will use versions not matching your current system, which in turn may create weird and very hard to resolve issues.

To safely evaluate your system - without changing current state - use the checkupdates script from the package pacman-contrib. The script will download the new metadata to a temporary folder and evaluate what packages has changed. With this script the current system’s metadata state is not changed or altered in any way. It is totally safe - it only requires the download of ~61M of data.

The checkupdates script can be run with --download option to download pending updates to the cache, verify and signature checking the packages.

checkupdates --download

After this you are free to run sudo pacman -Syu which will update from cache.

update process

When a Manjaro Linux system is updated from the repositores, the package manager does so in steps.

Manjaro’s package manager pamac uses the native libalpm to install packages.

step one

Download changed packages according to metadata.
:information_source: This process can be interrupted without any consequeses for the running system.

Both the native package manager pacman and Manjaro’s package manager pamac offers a -w argument.

pamac upgrade --download-only

When you are on a mobile network with high latency, pacman offers an optional --disable-download-timeout argument

sudo pacman -Syu --downloadonly [--disable-download-timeout]

step two

Verify signatures of downloaded packages.
:information_source: This step can be interrupted without any consequences for the running system.

step three

Update the system.
:warning: :high_voltage: This the most critical step as it requires to be run in it’s full length.

:warning: NEVER interrupt this stage.
If your region has unexpected power outages - be sure your system has a battery backup and that battery has the necessary power to complete the transaction.

The short explanation: Any package may contain hooks and scripts that perform various actions during the process. If the process is interrupted certain actions like PostTransaction, post_install, post_upgrade, post_remove will not be executed and this could have fatal consequences.

Read the section 1.8 of the pacman wiki page What happens during package install/upgrade/removal for a more indepth explanation.

conclusion

This writeup is a simplified explanation of a Manjaro Linux system update.

If you - instead of one truckload of updates - prefer the updates in smaller batches - consider switching to testing or edge (unstable) branch. Despite the name the edge branch is as stable as Arch Linux.

A more advanced solution could be maintaining a Portable Mirror as described in Create and Use a Portable Mirror

5 Likes

This is not a discussion thread. If you have questions or even improvements - please create a new topic with a link back to

https://forum.manjaro.org/t/188769

1 Like