Proper (preferred) way to update your system

I was using this until recently:

sudo pacman-mirrors -g && sudo pacman -Syyu

But lately I see this guideline for update:

sudo pacman -Sy
sudo pacman -S archlinux-keyring
sudo pacman -Su

Should I always use one one of these two (second one?), or certain conditions require certain (different) way of updating your system. If so, how can I know which one to use?

I have a feeling/guess I should always use second one, but I'm just asking to get confirmation :slight_smile:

i use it this way:

sudo pacman-mirrors -g --geoip ##reloads mirrors list from around my location
sudo pacman -Syyu ##upgrades
sudo pacman -Scc ##cleans cache

As long as you dont have keyring errors, you dont need to re-install archlinux-keyring

2 Likes

in order to get an idea what pacman and yaourt commands to use in different situations, please have a look at the following commands of pacui with detailed explanations (in pacui's help page):

  • update system (do this regularly - sometimes you have to answer "yes)
  • maintain system (do this from time to time)
  • fix pacman errors (do this only when you encounter problems, which are not fixed by running the first two commands)

this is dangerous.
for example: the current package of networkmanager works. the next version of this package has a fatal flaw and does not work. the command above deletes ALL package versions of networkmanager (even the currently working package). this means when you boot your system the next time (with the broken version of networkmanager), you do not have any internet connection and you cannot downgrade (offline) to the last working version of networkmanager!

3 Likes

@excalibur1234 and @anon35400795 Thank you both for your answers. Now I understand exactly how to update the system. Phil adds re-installing keyring for just in case.

Thanks for explaining this. There is a compromise I will be using, I will clean cache after every system update, but I will leave last two versions in cache for just in case something like what you described may happen.

The latter suggestion was for when the archlinux-keyring was updated. It is good to update it first before any other things are, to avoid signing conflicts.

Under normal conditions, a simple sudo pacman -Syu should be enough. You don't have to rank your mirrors every time, or even use two y's. The -Syy is necessary only when you, say make a change in your mirrorlist, to pull the whole cache again.

Ref: https://wiki.archlinux.org/index.php/Pacman#Upgrading_packages

1 Like

I see. How do you know, before you start updating, when is archlinux-keyring updated?

Thank you for explanation. I have read pacman wiki, but I just didn't get it with all the possibilities and differences. Your explanation is simple enough for beginner like me.

You should always look at the update Announcement in the forum. It usually says so.

1 Like

Ah, thanks! I do read update for stable but I never looked for this info.
Until now :smile:

This is mentioned when necessary. For example, the update before last had it:

1 Like

Ah, then I'm doing it correctly. Phil posted it in last update as well.
This answers my question and I will change and mark your post as solved. So normally I would update with:

sudo pacman -Syu

Unless Phil post this:

sudo pacman -Sy
sudo pacman -S archlinux-keyring
sudo pacman -Su

...in his announcement which indicates keying was updated and those commands need to be run. Now I understand better the whole updating process thanks to all of you.

And use what you were previously using, if you ever want to rank mirrors and refresh the package cache. You might want to do this a few times an year. (Or whenever you have reason to doubt that your mirrorlist isn't optimal).

sudo pacman-mirrors -g && sudo pacman -Syy

The u isn't necessary unless you also want to update.

1 Like

Gotcha! Thank you again!

Unless you’re running out of space on your / partition,  pacman -Sc  or  -Scc  is not really necessary.

1 Like

Could you please give us a hint, how many versions should anybody cache on his system?
A rule of thumb or something.

You can find this

  • add/delete Software
    ---> pacman-manager window opens up
  • Menu (three bars)
    -- Settings
    ---> window comes up
  • last tab Cache

I set it to 3.

Your explanation with the network-manager was very good, never thought of this.

I had to downgrade some packages now and then and had a very long list of different versions on drive and from the net; but if this happens must of this would be missed...

as mentioned by you: 3 versions are default. 2 should still be enough, if you always fix problems immediately.

keeping only 1 version can be problematic, when you update you system, then clean your cache and then reboot and notice something is not working anymore. because then the prior version, which worked, will have been deleted from the system.

in theory, you can clean your system shortly before your root partition is full. no real need to clean it before that.

2 Likes
  1. Read the system upgrade thread and understand what is being updated and how it relates to your system. If you are not comfortable with what is being upgraded then WAIT for a couple of days, reading the thread for issues experienced and solutions to these issues. Let others perform the upgrade and essentially beta test this process for you. If you are new to Manjaro and/or Linux in general I would recommend you wait, read and learn anyway.

  2. Before actually applying the update, BACKUP your system. I would recommend creating a disk image of your system disk using Clonezilla, but there are other options available. See threads in this forum covering what people use to backup their system. Whatever software you use to backup, test that the restore process actually works.

  3. I would recommend updating from CLI instead of GUI, from this thread you see there are many ways of using pacman and pacman-mirrors, it comes down to personal preference.

Personally I don't run pacman-mirrors each upgrade. All my local mirrors are very quick, I find my fastest local mirror at the top of /etc/pacman.d/mirrorslist, check it has synced using the provided link in the upgrade thread, and if so I simply run sudo pacman -Syu.

The keyring update commands are useful to know if something goes amiss, but you should not need to run them each time.

I don't explicitly clean my package cache after each upgrade, thus keep the latest three version of all installed packages. Unless you are experiencing root file system space issues there is no need to clean your cache after each update. If you do clean your cache then do it after you are sure all system components are working properly, meaning you won't need to downgrade anything. Even then I would recommend keeping at least two versions of each package.

1 Like

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

Forum kindly sponsored by