How to avoid a potential problem with system upgrade?

Hello. I've been prompted to install ~85 new packages since 3 days ago. I tried to upgrade the system tonight and run into a potential problem, for which I request some advice (since upgrades gone wrong have previously broken my system).

I'm on gnome, so before I update/upgrade, I disable extensions (often also tweaks). I then switch to tty, log in and "sudo pacman-mirrors -f" followed by "sudo pacman -Syyu".

Tonight my connection to the new mirror list that was generated was extremely slow. 4 mirrors (the first ones on the list, which are supposedly the ranked fastest to slowest as far as I've read) failed to download community.db before the 5th one succeeded.

At that point I realised that maybe the connection was in no condition to do an 80-package-upgrade without issues, so after the database was synced I declined the system upgrade (selected "n" on the [Y/n] dialog).

I then shut down the computer. Now I would like to try again tomorrow or the day after, but what would the best course of action be?
Repeat my usual steps (-mirrors -f && -Syyu)?
Something else?

Thank you.

You can also use -i for 'interactive' to select the mirror list .. though I dont know if/how that works in TTY.
And you can check the status of mirrors at

1 Like

if connection is very "slow", you can only download packages without install
checkupdates -d or sudo pamac update -w
:beer: :beer: :beer:
2..4 hours later, you can make a speed update

1 Like
  1. Use the checkupdates script to safely check if updates are available, do not use pacman for that purpose. Read the update announcement on the forum. Pamac tray icon is pretty good for this purpose, too, just don't be tempted to click on it and click the Apply button, that way trouble lies :wink:

  2. Do not install software if updates are available. First update, then install stuff.

  3. Wait a day before updating, unless you really need to install new software. Read the update announcement thread on the forum for potential issues.

  4. Make a timeshift snapshot before updating, just in case.

  5. Use pacman from a TTY to update, do not update while in a GUI session. If you have packages installed form the AUR, use yay to update. You do not need to update the AUR packages as often as the packages from the repos. Having outdated AUR packages is generally not a problem, because they will not be dependencies for anything system-related.

  6. If your internet connection is slow and you want to continue using your computer while the updates are downloading, you can do that using pacman -Syyuw (double y if you changed the mirrors, single y if you haven't) while in the GUI session (i.e. from a terminal emulator), and then log out, drop to a TTY and update using pacman -Su.

If you follow these 6 points, the chances of something going wrong with an update are negligible.


Great, thanks for the tips! I'll be checking the the status from now on. Mirror list regeneration and upgrade was fine and speedy today.

What I really wanted to know is what happens if I generate a new mirror list, then for whatever reason -Syy fails or I don't enter the command and after that I regenerate another mirror list followed by a successful -Syy? Does that scenario fall under the IMPORTANT category written here?

Never use -Syy alone, without the u.

If your mirrors are synced properly, -Syyu will not fail. The checkupdates script is a safe way of testing that your mirrors work before updating. You do not need to run pacman-mirrors often. Unfortunately, there is a script that runs it for you in the background automatically every week. I suggest disabling that, but nothing bad will happen if you don't.

On the off chance it does fail, post about it here on the forum. :smiley:

Oh, thank you! I didn't know there is this script, that way I can avoid running pacman-mirrors on every upgrade and instead run checkupdates or check the status of mirrors from And read the anouncements. :slightly_smiling_face:

Well, I asked about this particular scenario because it has actually happened yesterday (downloading the database from the mirrors was not working properly, aka was failing on the fastest mirrors, and even though I used -Syyu, I didn't want to risk going through with the u upgrade, so effectively I synced the database without upgrading the system! kind of like what -Syy would do?) and more than once before in the past (has required me to clear pacman cache and remove the lock.db file). Recently, after I restored a snapshot (because probably after some upgrade which I used to do in GUI caused my initramfs to go missing), I was careless enough to forget about -Syyu after generating a new mirrorlist and what I did was immediately regenerate another list and then do -Syyu. I don't see anything awry yet, but I'm being cautious (maybe startup is taking a bit longer than it did in the past and I have some buggy gnome extensions, but that's all).

Truth be told, I have read a couple of wiki pages and tutorials about proper updating and maintenance, but I'm still confused about the syncing process and the manjaro recommended command flow for minimal-risk update under stable. I've seen posts on this forum by experienced user recommending we always use pacman-mirrors before upgrading, others saying it is not necessary (unless we are troubleshooting or mirrors are down) and it wastes bandwidth, but what I would really appreciate is to learn the safest way to upgrade, so that I don't run into broken systems often (it has happened to me thrice in one year under gnome). I've read that generating new mirrorlists often could introduce problems, so I suppose it would be wise to move away from it for routine updating and hope that pacman takes care of keeping the mirrorlist with up-to-date and fast mirrors by itself?

checkupdates will simply let you know if there are updates available. It works pretty much the same way as the Pamac tray icon. If there are no updates available, and you know that there should be, because there is a forum announcement about updates, that means there is something wrong with your mirror list. Running pacman-mirrors -f will likely fix that issue.

There is never any need to run pacman -Syy without u. That is a potentially harmful command, because it updates your local package database, but does not download new versions of packages, so it may cause a partial update situation the next time you update and, depending on how unlucky you are, may break your system (not very likely, though, but still, don't do it).

If you want to download the updates, but not yet apply them for whatever reason, use pacman -Syyuw (or just a single y if you haven't updated the mirror list). After that, you should use pacman -Su to install the updated packages you downloaded. That's a relatively safe command, because it not only synchronises the package database, but also downloads new versions of packages.

1 Like

I think I have a better understanding now. I gather that the database which is downloaded from the mirrors needs to correspond with the new packages that are to be updated (that means I have to at least download them after syncing the database). Since, my connection appears to suffer sometimes, I find the commands that you provided very helpful. I will follow your advice. Thank you.

Okay so, I checked my /var/log/pacman.log for warnings or errors.

On previous transactions I have a few warnings about .pacnew files and a warning about different permissions on a folder:

[ALPM] warning: /etc/security/limits.d/10-gcr.conf installed as /etc/security/limits.d/10-gcr.conf.pacnew

[ALPM] warning: /etc/shadow installed as /etc/shadow.pacnew

[ALPM] warning: directory permissions differ on /opt/
filesystem: 755 package: 775

This last warning probably has to do with an AUR package installed on that folder. I suppose I could ignore it with no immediate problems.

But the .pacnew files are a whole other story. Now things are getting complicated and even though I read that proper maintenance includes taking care of those files by merging, I certainly don't yet have the time to devote to learning about what the original and corresponding .pacnew file do before I manually mess with them. So my question is, what happens if I let them both exist? What risks are there if I don't merge the original with the .pacnew file?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by