[R] issue with update.packages(), library 'utils'
Duncan Murdoch
murdoch@dunc@n @end|ng |rom gm@||@com
Mon Jun 8 18:16:26 CEST 2026
There's one other possibility I can see: maybe
.builtDate(repo["Built"]) > .builtDate(inst["Built"]))
in the needs.install() function in old.packages(), even just after a
reinstall. This could be due to time zone differences or some other
bug. Someone who is experiencing this would have to debug something
like that.
Duncan Murdoch
On 2026-06-08 9:47 a.m., Jinsong Zhao wrote:
> On 6/8/2026 9:09 PM, Duncan Murdoch wrote:
>> On 2026-06-08 8:54 a.m., Karl Schilling wrote:
>>> Dear Duncan Murdoch:
>>>
>>> I did just what you recommended. I have only one library.
>>> > lp <- .libPaths()
>>> > lp
>>> [1] "C:/Program Files/R/R-4.6.0patched/library"
>>> > length(lp)
>>> [1] 1
>>
>> That looks suspicious to me. I haven't used Windows in a long time,
>> but when I did, that directory would have been write protected. When
>> I would try to install a package there it would fail, and R would add
>> a user library and install there instead. The .libPaths() vector would
>> be changed for the rest of that session, but could revert to just one
>> entry if I started a new session.
>>
>>>
>>> But maybe the post by Jinsong ZZhao is relevent here:
>>
>> Yes, that could explain everything. If the date when a binary package
>> is built changes, that could mean that different C libraries were
>> linked into it, and you should use the newer one. Or it might just
>> mean that CRAN rebuilt it unnecessarily, but there's no way for R to
>> know that.
>>
> I think that CRAN rebuilt the package unnecessarily is the root of the
> problem. As I know, for a major version, such as 4.6.x, the tool chains
> will keep unchanging for a long time, so it is not necessary to rebuilt
> the package with same version nearly every day.
>
> Best,
>
> Jinsong
>
>> Duncan Murdoch
>>
>>
>>
>>>
>>>> The root of the problem is that old.packages have updated the internal
>>>> function needs.install, which compares the built date of repo and the
>>>> installed packages. And it seems that repo packages have newer built
>>>> date, though I do not know why.
>>>>
>>>> So reinstallation R and all packages could not solve the problem.
>>>>
>>>> Best,
>>>> Jinsong
>>>>
>>>> PS: the internal function need.install:
>>>>
>>>> .ts <- function(x) if (isTRUE(!is.na(x)))
>>>> as.POSIXlt(x, optional = TRUE, tz = "UTC")
>>>> else NA
>>>> needs.install <- function(repo, inst)
>>>> ((package_version(repo["Version"]) >
>>>> package_version(inst["Version"])) ||
>>>> (package_version(repo["Version"]) ==
>>>> package_version(inst["Version"]) &&
>>>> (isTRUE(.builtDate(repo["Built"]) >
>>>> .builtDate(inst["Built"])) || isTRUE(.ts(repo["Published"]) >
>>>> .ts(inst["Published"])))))
>>>
>>>
>>> I reinstalled r 4.6patched and all packages on May 28. Later that day,
>>> then, "update.packages" did result in only three packages highlighted
>>> for updating. A couple of days later, ALL my packages were again in the
>>> list to be updated. And just as documented in the post by
>>> guido.hooiveld using wur.nl, my installed packages had the same version
>>> numbers as those in the repository.
>>> Looking at the repository
>>> https://cloud.r-project.org/bin/windows/contrib/4.6, I realized that the
>>> "Last modified" date was more recent (mostly June 7) - though the
>>> version numbers of my installed packages were identical to those in the
>>> repository.
>>>
>>> So does "Last modified" reflect / affect the .builtDate in the above
>>> function? And do different dates for "Last modified" imply changes even
>>> if the version numbers are unchanged?
>>>
>>> Thank you so much for your help,
>>>
>>> Karl Schilling
>>>
>>>
>>> On 08.06.2026 14:01, Duncan Murdoch wrote:
>>>> I think what needs to happen here is that someone who is experiencing
>>>> this needs to debug it. It sounds as though old.packages() is
>>>> identifying packages that you think don't need replacing. You need to
>>>> figure out why this is happening.
>>>>
>>>> A guess:
>>>>
>>>> - Your .libPaths() vector (which is used as the default for lib.loc)
>>>> contains two or more library paths. You have old packages in one of
>>>> those paths, and when you install new ones, they go into the other
>>>> path.
>>>>
>>>> You can diagnose this as follows:
>>>>
>>>> 1. Print .libPaths(). How many entries does it have?
>>>> 2. If it has two (or more) entries, run the following:
>>>>
>>>> lp <- .libPaths()
>>>> both <- intersect(list.files(lp[1]), list.files(lp[2]))
>>>> print(both)
>>>>
>>>> (If you have more than two entries, do this for all pairs.)
>>>>
>>>> This will list all the packages that you have installed in both
>>>> places. On my system, the first entry is my user library, the second
>>>> is the system library. You generally need admin permissions to modify
>>>> the system library, so if you sometimes run with admin permissions and
>>>> sometimes don't, you can end up with different versions in those two
>>>> places.
>>>>
>>>> 3. To find out if you have different versions, run
>>>> packageVersion(pkgname, lp[1]) and compare to packageVersion(pkgname,
>>>> lp[2]). For example, I see that I have "bslib" installed in both
>>>> places, and I see
>>>>
>>>> > packageVersion("bslib", lp[1])
>>>> [1] ‘0.11.0’
>>>> > packageVersion("bslib", lp[2])
>>>> [1] ‘0.10.0’
>>>>
>>>> So it looks as though my system library has an obsolete version
>>>> installed. I should delete it.
>>>>
>>>> Duncan Murdoch
>>>>
>>>>
>>>>
>>>>
>>>> On 2026-06-08 7:40 a.m., Paulo Barata wrote:
>>>>> To the R-Help list,
>>>>>
>>>>> I have also the same problem here. Most often when I attempt to
>>>>> update my packages, it seems that most of them, maybe all of them,
>>>>> are flagged as needing update, even when they were updated just the
>>>>> previous day.
>>>>>
>>>>> I do not use RStudio, I only use R directly. Currently, I am using R
>>>>> version 4.6.0 Patched (2026-05-29 r90087 ucrt), on Windows 10
>>>>> Professional.
>>>>>
>>>>> Paulo Barata
>>>>>
>>>>> Rio de Janeiro - Brazil
>>>>>
>>>>> -------------------------------------------------
>>>>>
>>>>>>
>>>>>> Message: 1
>>>>>> Date: Sun, 7 Jun 2026 16:30:34 +0200
>>>>>> From: Karl Schilling <karl.schilling using uni-bonn.de>
>>>>>> To: r-help using r-project.org
>>>>>> Subject: Re: [R] issue with update.packages(), library 'utils'
>>>>>> Message-ID: <240738c2-9935-40a9-b461-c82776cd1a77 using uni-bonn.de>
>>>>>> Content-Type: text/plain; charset="utf-8"; Format="flowed"
>>>>>>
>>>>>> I have exactly the same problem as reported by Guido Hooiveld.
>>>>>>
>>>>>> I had previously attributed my problem with an inappropriate way of
>>>>>> updating my packages when I updated from R 4.5 to 4.6. I then
>>>>>> completely
>>>>>> reinstalled R4.6 and all packages, which "solved" the problem - at
>>>>>> least
>>>>>> when I run "update.packages2 the same day I reinstalled everything
>>>>>> (see
>>>>>> my postings and related answers from May27-29.
>>>>>> Alas, the next day the problem was back again, and ALL my packages
>>>>>> updated the day before were now identified as outdated.
>>>>>>
>>>>>> I have no idea about the background of this problem. But a cue may be
>>>>>> possibly come from the observation that when I use RStudio to
>>>>>> check for
>>>>>> packages that need to be updated (RStudie >Tools > Check for Package
>>>>>> Updates ...), this does not happen.
>>>>>>
>>>>>> Karl Schilling
>>>>>>
>>>>>>
>>>>>> On 04.06.2026 13:49, Hooiveld, Guido via R-help wrote:
>>>>>>> Hi, I got confused by the recent behavior of update.packages() from
>>>>>>> the library utils. Since a while it reports that updates of ALL
>>>>>>> installed packages are available at the CRAN repository but turns
>>>>>>> out
>>>>>>> that this is not the case for MOST packages. In other words, most of
>>>>>>> the installed packages on my computer are of the same version as on
>>>>>>> the repository, yet it still is reported that an update for these
>>>>>>> packages is available. Of course I can re-install these (current)
>>>>>>> packages, but that is IMHO a waste of time/bandwidth. I had a
>>>>>>> look at
>>>>>>> it, and to me it seems this also somehow relates to the function
>>>>>>> old.packages(). That is, old.packages() identifies also packages as
>>>>>>> outdated, whereas they are clearly not... ?? See code below. Any
>>>>>>> suggestion on what may be causing this, and how to avoid it? Thanks,
>>>>>>> Guido
>>>>>>>> ## update.packages() identifies that updates for e.g. ##
>>>>>>>> 'ActivePathways' and 'alphavantager' are available for my
>>>>>>>> installation. ## Yet, the installed version is the same as on the
>>>>>>>> repository. ## (Note that after these 2 notifications I cancelled
>>>>>>>> update.packages()
>>>>>>>> update.packages(repos=https://cloud.r-project.org)
>>>>>>> ActivePathways : Version 2.0.6 installed in C:/Program
>>>>>>> Files/R/R-4.6.0/library Version 2.0.6 available at
>>>>>>> https://cloud.r-project.org/bin/windows/contrib/4.6 alphavantager :
>>>>>>> Version 0.1.3 installed in C:/Program Files/R/R-4.6.0/library
>>>>>>> Version
>>>>>>> 0.1.3 available at
>>>>>>> https://cloud.r-project.org/bin/windows/contrib/4.6
>>>>>>> cancelled by user Warning message: In .available.both(repos, method,
>>>>>>> ...) : Some listed binary packages have no source
>>>>>>>> ## check and compare the output of old.packages() old.pkgs <-
>>>>>>>> old.packages(repos=https://cloud.r-project.org)
>>>>>>> Warning message: In .available.both(repos, method, ...) : Some
>>>>>>> listed
>>>>>>> binary packages have no source
>>>>>>>> head(old.pkgs)
>>>>>>> Package LibPath Installed ActivePathways "ActivePathways"
>>>>>>> "C:/Program
>>>>>>> Files/R/R-4.6.0/library" "2.0.6" alphavantager "alphavantager"
>>>>>>> "C:/Program Files/R/R-4.6.0/library" "0.1.3" anytime "anytime"
>>>>>>> "C:/Program Files/R/R-4.6.0/library" "0.3.13" aod "aod" "C:/Program
>>>>>>> Files/R/R-4.6.0/library" "1.3.3" ape "ape" "C:/Program
>>>>>>> Files/R/R-4.6.0/library" "5.8-1" aplot "aplot" "C:/Program
>>>>>>> Files/R/R-4.6.0/library" "0.2.9" Built ActivePathways "R 4.6.0; ;
>>>>>>> 2026-05-30 02:41:50 UTC; windows" alphavantager "R 4.6.0; ;
>>>>>>> 2026-05-30
>>>>>>> 03:56:11 UTC; windows" anytime "R 4.6.0; x86_64-w64-mingw32;
>>>>>>> 2026-05-30 01:03:29 UTC; windows" aod "R 4.6.0; ; 2026-05-30
>>>>>>> 01:07:09
>>>>>>> UTC; windows" ape "R 4.6.0; x86_64-w64-mingw32; 2026-05-30 02:11:50
>>>>>>> UTC; windows" aplot "R 4.6.0; ; 2026-05-30 03:14:45 UTC; windows"
>>>>>>> ReposVer Repository ActivePathways "2.0.6"
>>>>>>> https://cloud.r-project.org/bin/windows/contrib/4.6 alphavantager
>>>>>>> "0.1.3" https://cloud.r-project.org/bin/windows/contrib/4.6 anytime
>>>>>>> "0.3.13" https://cloud.r-project.org/bin/windows/contrib/4.6 aod
>>>>>>> "1.3.3" https://cloud.r-project.org/bin/windows/contrib/4.6 ape
>>>>>>> "5.8-1" https://cloud.r-project.org/bin/windows/contrib/4.6 aplot
>>>>>>> "0.2.9" https://cloud.r-project.org/bin/windows/contrib/4.6
>>>>>>>> ## Of the 519 packages on my system, only 3 are really outdated. ##
>>>>>>>> Note that these are NOT ActivePathways' and 'alphavantager' that
>>>>>>>> were
>>>>>>>> identified ## by update.packages() above. length(
>>>>>>>> old.pkgs[,"Installed"] == old.pkgs[,"ReposVer"] )
>>>>>>> [1] 519
>>>>>>>> sum( old.pkgs[,"Installed"] == old.pkgs[,"ReposVer"] )
>>>>>>> [1] 516
>>>>>>>> sum( old.pkgs[,"Installed"] != old.pkgs[,"ReposVer"] )
>>>>>>> [1] 3
>>>>>>>> old.pkgs[ old.pkgs[,"Installed"] != old.pkgs[,"ReposVer"] ,]
>>>>>>> Package LibPath Installed limSolve "limSolve" "C:/Program
>>>>>>> Files/R/R-4.6.0/library" "2.0.1" RCurl "RCurl" "C:/Program
>>>>>>> Files/R/R-4.6.0/library" "1.98-1.18" rjsoncons "rjsoncons"
>>>>>>> "C:/Program
>>>>>>> Files/R/R-4.6.0/library" "1.3.2" Built limSolve "R 4.6.0;
>>>>>>> x86_64-w64-mingw32; 2026-05-30 01:01:26 UTC; windows" RCurl "R
>>>>>>> 4.6.0;
>>>>>>> x86_64-w64-mingw32; 2026-04-21 00:45:50 UTC; windows" rjsoncons "R
>>>>>>> 4.6.0; x86_64-w64-mingw32; 2026-05-30 03:10:49 UTC; windows"
>>>>>>> ReposVer
>>>>>>> Repository limSolve "2.0.2"
>>>>>>> https://cloud.r-project.org/bin/windows/contrib/4.6 RCurl
>>>>>>> "1.98-1.19"
>>>>>>> https://cloud.r-project.org/bin/windows/contrib/4.6 rjsoncons
>>>>>>> "1.3.3"
>>>>>>> https://cloud.r-project.org/bin/windows/contrib/4.6
>>>>>>>> ## sessionInfo() sessionInfo()
>>>>>>> R version 4.6.0 (2026-04-24 ucrt) Platform: x86_64-w64-mingw32/x64
>>>>>>> Running under: Windows 11 x64 (build 22631) Matrix products: default
>>>>>>> LAPACK version 3.12.1 locale: [1] LC_COLLATE=English_United
>>>>>>> States.utf8 [2] LC_CTYPE=English_United States.utf8 [3]
>>>>>>> LC_MONETARY=English_United States.utf8 [4] LC_NUMERIC=C [5]
>>>>>>> LC_TIME=English_United States.utf8 time zone: Europe/Amsterdam
>>>>>>> tzcode
>>>>>>> source: internal attached base packages: [1] stats graphics
>>>>>>> grDevices
>>>>>>> utils datasets methods base loaded via a namespace (and not
>>>>>>> attached):
>>>>>>> [1] compiler_4.6.0 tools_4.6.0
>>>>>>> --------------------------------------------------------- Guido
>>>>>>> Hooiveld, PhD Nutrition, Metabolism & Genomics Group Division of
>>>>>>> Human
>>>>>>> Nutrition & Health Wageningen University the Netherlands Visiting
>>>>>>> address: Mail address: HELIX (Building 124), room 2048 Stippeneng
>>>>>>> 4 PO
>>>>>>> Box 17 6708 WE Wageningen 6700 AA Wageningen the Netherlands the
>>>>>>> Netherlands tel: (+) 31 317 485788 fax: (+) 31 317 483342 email:
>>>>>>> guido.hooiveld using wur.nl internet: http://www.humannutrition.nl
>>>>>>> http://scholar.google.com/citations?user=qFHaMnoAAAAJ
>>>>>>> http://www.scopus.com/authid/detail.url?authorId=6603101814
>>>>>>> ______________________________________________ R-help using r-project.org
>>>>>>> mailing list -- To UNSUBSCRIBE and more, see
>>>>>>> https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the
>>>>>>> posting guide https://www.R-project.org/posting-guide.html and
>>>>>>> provide
>>>>>>> commented, minimal, self-contained, reproducible code.
>>>>>>
>>>>>> ------------------------------
>>>>>>
>>>>>> Message: 2
>>>>>> Date: Sun, 7 Jun 2026 23:23:43 +0200
>>>>>> From: Iago <iagogv using disroot.org>
>>>>>> To: r-help using r-project.org
>>>>>> Subject: Re: [R] issue with update.packages(), library 'utils'
>>>>>> Message-ID: <bf1dc0c5-3a67-42c9-b5e9-05fada44e91f using disroot.org>
>>>>>> Content-Type: text/plain; charset="utf-8"
>>>>>>
>>>>>> I had this problem too and I don’t use RStudio, so this is/was an R
>>>>>> issue. Regarding the previous discussion on this issue, the curious
>>>>>> thing is that it had never occurred before when updating from 4.4 to
>>>>>> 4.5, from 4.3 to 4.4, etc., at least to me.
>>>>>>
>>>>>> Iago
>>>>>>
>>>>>
>>>>> ______________________________________________
>>>>> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>>> PLEASE do read the posting guide
>>>>> https://www.R-project.org/posting-guide.html
>>>>> and provide commented, minimal, self-contained, reproducible code.
>>>>
>>>> ______________________________________________
>>>> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>> PLEASE do read the posting guide
>>>> https://www.R-project.org/posting-guide.html
>>>> and provide commented, minimal, self-contained, reproducible code.
>>
>> ______________________________________________
>> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> https://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
More information about the R-help
mailing list