You are not logged in.

#1 2021-02-10 08:58:59

EdeWolf
Member
Registered: 2016-01-06
Posts: 85

[solved] pacman: how to delay system upgrade?

Hello,

so I am running pacman -Syuw today, and a week later I would like to install/update my system to this very state, preferably even offline, instead of getting the then current one. Is there a way to accomplish this?

Thanks

Ede

Last edited by EdeWolf (2021-02-10 10:42:06)

Offline

#2 2021-02-10 09:00:11

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [solved] pacman: how to delay system upgrade?


Jin, Jîyan, Azadî

Offline

#3 2021-02-10 09:04:49

EdeWolf
Member
Registered: 2016-01-06
Posts: 85

Re: [solved] pacman: how to delay system upgrade?

Thanks. In case that is the only answer, that implies, an offline update to a state already saved on my machine is not possible. As here we just connect to an older archive.

And sorry, I am aware by mistake I've taken the wrong forum, this of course should have gone into the pacman subforum.

Offline

#4 2021-02-10 09:31:41

mpan
Member
Registered: 2012-08-01
Posts: 1,640
Website

Re: [solved] pacman: how to delay system upgrade?

Edit: a much better solution is proposed by seth below. I was stupid.

The problem with -Sywu and waiting for a week with actually installing packages is that you are doing -Sy without a complete -Su. That may easily lead to a partial upgrade. Aside from that, you may create a separate cache directory, let’s say “/path/to/cache” and then:

sudo pacman -Sywu --cachedir=/path/to/cache

This will download all the packages to “/path/to/cache”, so you can then easily install them using pacman -U:

find /path/to/cache/ -type f -exec sudo pacman -U {} \+

The problem of doing -Sy without a full -Su could be resolved with checkupdates from community/pacman-contrib, but unfortunately it has no option to set cache path. However, if you are sure that none of the new ackages were not downloaded before some date, you can:

sudo checkupdates -d

Then, when an update is needed:

find "$PACMAN_CACHE" -type f -ctime -"$DAYS" -exec sudo pacman -U --needed {} \+

However, in this case you are playing the guessgame of whether all the required files are in the right time range.

Last edited by mpan (2021-02-10 09:56:13)

Offline

#5 2021-02-10 09:33:18

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,626

Re: [solved] pacman: how to delay system upgrade?

# pacman -Syuw
do nothing
do nothing again
more of nothing
# pacman -Su

You update the database and fill the cache w/ the required packages, but don't install them.
Then, in a long long future in a galaxy far far away, you just update the system (but not the database) which will use the previously cached packages (as they match the current database requriements) - provided you didn't wipe the cache and it's big enough to hold all packages.

Edit: spent too much time on the starwars reference…

Last edited by seth (2021-02-10 09:34:32)

Online

#6 2021-02-10 09:55:21

mpan
Member
Registered: 2012-08-01
Posts: 1,640
Website

Re: [solved] pacman: how to delay system upgrade?

Now I feel stupid. xD

Last edited by mpan (2021-02-10 09:55:43)

Offline

#7 2021-02-10 10:41:34

EdeWolf
Member
Registered: 2016-01-06
Posts: 85

Re: [solved] pacman: how to delay system upgrade?

@seth: Thanks, so far that was the most polite way of saying rtfm, I have come across:

-y, --refresh
           Download a fresh copy of the master package database from the server(s) defined in pacman.conf(5). This should typically be used each time you use --sysupgrade or -u. Passing two --refresh or -y flags will force a refresh of all package
           databases, even if they appear to be up-to-date.

Basically, just leave -y away. Have not tested it, but I believe that does exactly what I want it to do. That is the price of years of automatic, thoughtless use of Syu.

May patience [and forgiveness] be with you. Always.

@mpan: That will be my fallback strategy in case I've misunderstood seth.

Thanks all again

Offline

#8 2021-02-10 15:24:47

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,510
Website

Re: [solved] pacman: how to delay system upgrade?

EdeWolf wrote:

@mpan: That will be my fallback strategy in case I've misunderstood seth.

I believe you understood correctly, but Seth was just answering your question as it was asked.  Mpan was highlighting why that can be dangerous.  Note Seth's solution includes many lines of "do nothing" - if that's what you do, then that solution is correct, but you must do nothing with pacman in that intervening time: any attempt to install any new package can (and most likely will) result in problems.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2021-02-10 16:02:03

EdeWolf
Member
Registered: 2016-01-06
Posts: 85

Re: [solved] pacman: how to delay system upgrade?

Thanks Trilby. I did a small test and the answer of seth has been spot on - installing a known state without renewed updating. I am aware I should not touch pacman in between, but in fact, that is the whole intention: freeze a system (packagewise) for a certain period of time.

Offline

Board footer

Powered by FluxBB