Download updates always start from beginning in pacman, why?

I used to download package first and then install them later using

sudo pacman -Syudw

and then

sudo pacman -Syu

but recently I’m unable to do it , It always start from beginning

1 Like

That’s the wrong command. In order to only download the packages and not update them yet, you should use… :point_down:

sudo pacman -Syw

You should also never use the -d option.

That’s the wrong command too. In order to update/upgrade when the packages have already been downloaded, you should use -U, not -S. See the manual… :point_down:

man pacman

but this is only sync packages this didn’t show any package to download

:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date

After that nothing happened

You have obviously not been maintaining your system. The community repo was dropped over a year ago already.

You probably have loads of .pacnew files sitting around, including for /etc/pacman.conf.

3 Likes

oh yes I do have it, I guess I have to update it on one go, to save myself from further issue

And by the way…

That’s because you had already updated your system. :stuck_out_tongue:


List your .pacnew files with… :point_down:

pacdiff -o

… and merge them. Do not blindly copy them over the existing configuration files, because that will break things. The .pacnew files are only supposed to be a guide on account of what may need to be changed.

If you do not have the pacdiff command on your system, then you must install the pacman-contrib package first.

1 Like
pacdiff -o                                                                                              
warning: config file /etc/pacman.conf, line 21: directive 'SyncFirst' in section 'options' not recognized.
warning: config file /etc/pacman.conf, line 21: directive 'SyncFirst' in section 'options' not recognized.
/usr/share/icons/default/index.theme.pacsave
/etc/passwd.pacnew
/etc/shells.pacnew
/etc/locale.gen.pacnew
/etc/default/grub.pacnew
/etc/pam.d/kde.pacnew
/etc/pamac.conf.pacnew
/etc/mkinitcpio.conf.pacnew
/etc/pacman.conf.pacnew
/etc/pacman-mirrors.conf.pacnew
/etc/sane.d/canon_lide70.conf.pacnew
/etc/sane.d/escl.conf.pacnew
/etc/pam.d/sddm.pacnew
/etc/systemd/homed.conf.pacnew
/etc/systemd/pstore.conf.pacnew

I don’t know how to merge them :pleading_face:

Mod note: You should learn to use </> code blocks to paste code. You can also type three tilde ~ before and after the code.

man pacdiff

:wink:

Alternatively, you can install manjaro-pacnew-checker from the repos in order to help you merge them from within the GUI, or even pacnew-chaser from the AUR. Personally I use the latter.

1 Like

You should never use the -d argument for syncing your system

       -d, --nodeps
           Skips dependency version checks. Package names are still
           checked. Normally, pacman will always check a package’s
           dependency fields to ensure that all dependencies are
           installed and there are no package conflicts in the
           system. Specify this option twice to skip all dependency
           checks.

The -y argument is to sync metadata and the -u is for updating the system

The flow is

The -y

  • sync metadata

The -u

  • create list of packages changed (compare system with metadata)
  • download packages

Not using -w

  • verify the packages
  • start a transaction
    • for each package to sync
      • register transaction hooks
      • remove the old package
      • unpack and setup the new package
      • run transaction hooks

You can interrupt the process using the -w argument which will only download to the cache.

sudo pacman -Syuw

Subsequently you can run

sudo pacman -Syu

Which will check the cache and if the package version does not match the metadata the corresponding package will be fetched from the mirror.

If you use -Syw you will need to provide a list of packages - so generally speaking the -y is redundant and you should use (–print to only list what would have been done).
IF you use the -y without the -u you will update metadata and thus the the packages you get may not be matching your system (generating an unsupported partial update)

sudo pacman -Swp libreoffice-fresh

This will however, only provide you with the named package, in many cases you would want the dependencies as well.

Extending the example (added --print to only list the result)

sudo pacman -Swp libreoffice-fresh $(pacman -Si libreoffice-fresh | grep 'Depends On' | cut -d':' -f2)
2 Likes

The -u is not required. The man page states… :point_down:

UPGRADE OPTIONS (APPLY TO -S AND -U)
       -w, --downloadonly
           Retrieve all packages from the server, but do not install/upgrade anything.

Also… :point_down:

There is no mention in the man page that -Syu checks the locally downloaded packages first. It says that it checks the installed packages against the ones on the mirrors and will download and update the packages from the mirrors that are newer than the installed ones.

Replied to wrong poster...

You should consider RTFT (read the fine thread) before updating - especially when you don’t have much clue what you’re doing:

[Stable Updates] 2024-12-16 - Kernels, Cinnamon, Deepin, Cosmic, Mauikit, ZFS - #47 by Hal9000

It’s important to understand what you are using (Desktop, Branch) to read the correct update thread…

It’s also important not to skip updates, and not to skip merging pacnew files.

If this is too much, then perhaps consider that Manjaro might not be the right distribution - because it is ROLLING and does require minimal maintenance more than once or twice every year.

Terminal Tips:

You are very confused about your own terminal useage… might I suggest you take FISH for a spin?

I rather dislike many man pages (some are good, others are just TL;DR)…

  1. Install tldr package and run ‘tldr pacman’.
  2. type sudo pacman - and press the tab:
Tab help using FISH terminal
❯ sudo pacman -S <tab>
-Sb                (Alternate database location)
-Sc           (Remove [all] packages from cache)
-Sd               (Skip [all] dependency checks)
-Sg     (Display members of [all] package GROUP)
-Sh                               (Display help)
-Si        (View PACKAGE [extended] information)
-Sl            (List all packages in REPOSITORY)
-Sp                (Dry run, only print targets)
-Sq                      (Show less information)
-Sr                (Alternate installation root)
-Ss      (Search remote repositories for regexp)
-Su  (Upgrade all packages that are out of date)
-SV                   (Display version and exit)
-Sv                (Output more status messages)
-Sw          (Only download the target packages)
-Sy   (Download fresh package databases [force])
  • From here you can SEE that -Sy will FORCE download fresh package databases.

  • Also that -d option will SKIP ALL DEPENDENCY CHECKS.

  • Your terminal has a lot of built-in help… for this reason, many thousands of Linux users never got near a forum because they simply read and use the assistance built in.

  • Similarly, Manjaro posts regular update threads so that AFTER EVERY UPDATE you can enter the thread and vote (No Problem, or Problem I fixed myself - post details, or 'Problem - details below and wait for assistance fixing the problem).

❯ tldr pacman
pacman

  Arch Linux package manager utility.
  See also: pacman-sync, pacman-remove, pacman-query, pacman-upgrade, pacman-files, pacman-database, pacman-deptest, pacman-key, pacman-mirrors.
  For equivalent commands in other package managers, see https://wiki.archlinux.org/title/Pacman/Rosetta.
  More information: https://manned.org/pacman.8.

  Synchronize and update all packages:

    sudo pacman -Syu

  Install a new package:

    sudo pacman -S package

  Remove a package and its dependencies:

    sudo pacman -Rs package

  Search the database for packages containing a specific file:

    pacman -F "file_name"

  List installed packages and versions:

    pacman -Q

  List only the explicitly installed packages and versions:

    pacman -Qe

  List orphan packages (installed as dependencies but not actually required by any package):

    pacman -Qtdq

  Empty the entire pacman cache:

    sudo pacman -Scc

1 Like

You replied to the wrong poster. :face_with_hand_over_mouth:

1 Like

slight correction

  • -y will download metadata if mirrors metadata is newer
  • -yy will force download metadata - even if metadata is identical
2 Likes

You should consider RTFT (read the fine thread) before updating - especially when you don’t have much clue what you’re doing:

Mod edit: fixed link so it goes to the first post in the Stable Updates topic

It’s important to understand what you are using (Desktop, Branch) to read the correct update thread…

It’s also important not to skip updates, and not to skip merging pacnew files.

If this is too much, then perhaps consider that Manjaro might not be the right distribution - because it is ROLLING and does require minimal maintenance more than once or twice every year.

Terminal Tips:

You are very confused about your own terminal useage… might I suggest you take FISH for a spin?

I rather dislike many man pages (some are good, others are just TL;DR)…

  1. Install tldr package and run ‘tldr pacman’.
  2. type sudo pacman - and press the tab:
Tab help using FISH terminal
❯ sudo pacman -S <tab>
-Sb                (Alternate database location)
-Sc           (Remove [all] packages from cache)
-Sd               (Skip [all] dependency checks)
-Sg     (Display members of [all] package GROUP)
-Sh                               (Display help)
-Si        (View PACKAGE [extended] information)
-Sl            (List all packages in REPOSITORY)
-Sp                (Dry run, only print targets)
-Sq                      (Show less information)
-Sr                (Alternate installation root)
-Ss      (Search remote repositories for regexp)
-Su  (Upgrade all packages that are out of date)
-SV                   (Display version and exit)
-Sv                (Output more status messages)
-Sw          (Only download the target packages)
-Sy   (Download fresh package databases [force])
  • From here you can SEE that -Sy will download fresh package databases.

  • Also that -d option will SKIP ALL DEPENDENCY CHECKS.

  • Your terminal has a lot of built-in help… for this reason, many thousands of Linux users never got near a forum because they simply read and use the assistance built in.

  • Similarly, Manjaro posts regular update threads so that AFTER EVERY UPDATE you can enter the thread and vote (No Problem, or Problem I fixed myself - post details, or 'Problem - details below and wait for assistance fixing the problem).

❯ tldr pacman
pacman

  Arch Linux package manager utility.
  See also: pacman-sync, pacman-remove, pacman-query, pacman-upgrade, pacman-files, pacman-database, pacman-deptest, pacman-key, pacman-mirrors.
  For equivalent commands in other package managers, see https://wiki.archlinux.org/title/Pacman/Rosetta.
  More information: https://manned.org/pacman.8.

  Synchronize and update all packages:

    sudo pacman -Syu

  Install a new package:

    sudo pacman -S package

  Remove a package and its dependencies:

    sudo pacman -Rs package

  Search the database for packages containing a specific file:

    pacman -F "file_name"

  List installed packages and versions:

    pacman -Q

  List only the explicitly installed packages and versions:

    pacman -Qe

  List orphan packages (installed as dependencies but not actually required by any package):

    pacman -Qtdq

  Empty the entire pacman cache:

    sudo pacman -Scc

1 Like

Perhaps we should also add this little essay below to the advice? :wink:

2 Likes

I don’t think I belong in this thread, something has slipped. :sunglasses:

I just edited that post so that it links to the start of the Stable Updates topic instead of your specific post.

1 Like

The new packages are only downloaded, if they are not already in the download cache.

I have a systemd service that periodically checks for updates and downloads them, so that the subsequent update is faster:

I’ve set up pacman -Syuw --noconfirm for this.

4 Likes

Thank you :+1:

2 Likes

Thank you guys for all your help , I had to manually merge pacman.conf and pacman.conf.pacnew. I check them side by side . Like there was comment on CacheDir = /var/cache/pacman/pkg/ so I had to uncomment it , removed entire [community].

There was rarely any change on other .pacnew files so I didn’t touch them.