Upgrade 20.04 to 21.04 due to an npm permissions issue

Bug #1953524 reported by Charles Simms
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)
New
Undecided
Unassigned

Bug Description

I ran the installation to upgrade using https://help.ubuntu.com/community/ImpishUpgrades
section:- Upgrading Ubuntu Desktops to 21.10
but got the following message:
The upgrade will continue but the '/tmp/apt-dpkg-install-ZM0HnK/0993-npm_7.5.2+ds-1_all.deb' package may not be in a working state. Please consider submitting a bug report about it.

Now I cant upgrade using the software updater I get the following error
The package system is broken
If you are using third party repositories then disable them, since they are a common source of problems.
Now run the following command in a terminal: apt-get install -f
Transaction failed: The package system is broken
 The following packages have unmet dependencies:
node-mkdirp:
---
ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu65.4
Architecture: amd64
CasperMD5CheckResult: unknown
CrashDB: ubuntu
CurrentDesktop: ubuntu:GNOME
DistributionChannelDescriptor:
 # This is a distribution channel descriptor
 # For more information see http://wiki.ubuntu.com/DistributionChannelDescriptor
 canonical-oem-somerville-xenial-amd64-20160624-2
DistroRelease: Ubuntu 21.04
EcryptfsInUse: Yes
InstallationDate: Installed on 2017-11-12 (1486 days ago)
InstallationMedia: Ubuntu 16.04 "Xenial" - Build amd64 LIVE Binary 20160624-10:47
Package: ubuntu-release-upgrader (not installed)
ProcVersionSignature: Ubuntu 5.4.0-91.102-generic 5.4.151
RebootRequiredPkgs: Error: path contained symlinks.
Tags: hirsute dist-upgrade
Uname: Linux 5.4.0-91-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm audio cdrom dip docker lpadmin plugdev pulse pulse-access root sambashare sudo video wireshark
VarLogDistupgradeTermlog:

_MarkForUpload: True

Revision history for this message
Chris Guiver (guiverc) wrote (last edit ):

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please execute the following command only once, as it will automatically gather debugging information, in a terminal:

apport-collect 1953524

When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

(are you sure you were upgrading from 20.04 to 21.10? The current procedure will upgrade you from 20.04 to 21.04 (ie. next supported release) which matches the package you mention, ie. `npm | 7.5.2+ds-1 | hirsute/universe | source, all`)

I've marked this incomplete as no details were provided; you can change status back to "New" after running apport-collect.

Bug reporting is mostly about finding & fixing problems thus preventing future users from hitting the same bug.

I suspect a Support site would be more appropriate, eg. https://answers.launchpad.net/ubuntu. You can also find help with your problem in the support forum of your local Ubuntu community http://loco.ubuntu.com/ or asking at https://askubuntu.com or https://ubuntuforums.org, or for more support options please look at https://discourse.ubuntu.com/t/community-support/709

Changed in ubuntu-release-upgrader (Ubuntu):
status: New → Incomplete
Revision history for this message
Charles Simms (charliebsimms) wrote : CurrentDmesg.txt.txt

apport information

tags: added: apport-collected dist-upgrade hirsute
description: updated
Revision history for this message
Charles Simms (charliebsimms) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Charles Simms (charliebsimms) wrote : ProcEnviron.txt

apport information

Revision history for this message
Charles Simms (charliebsimms) wrote : VarLogDistupgradeAptHistorylog.txt

apport information

Revision history for this message
Charles Simms (charliebsimms) wrote : VarLogDistupgradeAptclonesystemstate.tar.gz

apport information

Revision history for this message
Charles Simms (charliebsimms) wrote : VarLogDistupgradeAptlog.txt

apport information

Revision history for this message
Charles Simms (charliebsimms) wrote : VarLogDistupgradeApttermlog.txt

apport information

Revision history for this message
Charles Simms (charliebsimms) wrote : VarLogDistupgradeLspcitxt.txt

apport information

Changed in ubuntu-release-upgrader (Ubuntu):
status: Incomplete → New
Revision history for this message
Charles Simms (charliebsimms) wrote : Re: [Bug 1953524] Re: Upgrade 20.04 to 21.10

Chris

Thank you for your response.

I have ran apport-collect 1953524 which has updated my bug in launchpad.

Yes I was trying to upgrade to 21.04.

Regards
Charlie Simms

On Wed, 8 Dec 2021 at 01:41, Chris Guiver <email address hidden>
wrote:

> Thank you for taking the time to report this bug and helping to make
> Ubuntu better. Please execute the following command only once, as it
> will automatically gather debugging information, in a terminal:
>
> apport-collect 1953524
>
> When reporting bugs in the future please use apport by using 'ubuntu-
> bug' and the name of the package affected. You can learn more about this
> functionality at https://wiki.ubuntu.com/ReportingBugs.
>
>
> (are you sure you were upgrading from 20.04 to 21.10? The current
> procedure will upgrade you from 20.04 to 21.04 (ie. next supported release)
> which matches the package you mention, ie. `npm | 7.5.2+ds-1 |
> hirsute/universe | source, all`)
>
> I've marked this incomplete as no details were provided; you can change
> status back to "New" after running apport-collect.
>
> Bug reporting is mostly about finding & fixing problems thus preventing
> future users from hitting the same bug.
>
> I suspect a Support site would be more appropriate, eg.
> https://answers.launchpad.net/ubuntu. You can also find help with your
> problem in the support forum of your local Ubuntu community
> http://loco.ubuntu.com/ or asking at https://askubuntu.com or
> https://ubuntuforums.org, or for more support options please look at
> https://discourse.ubuntu.com/t/community-support/709
>
>
> ** Changed in: ubuntu-release-upgrader (Ubuntu)
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1953524
>
> Title:
> Upgrade 20.04 to 21.10
>
> Status in ubuntu-release-upgrader package in Ubuntu:
> Incomplete
>
> Bug description:
> I ran the installation to upgrade using
> https://help.ubuntu.com/community/ImpishUpgrades
> section:- Upgrading Ubuntu Desktops to 21.10
> but got the following message:
> The upgrade will continue but the
> '/tmp/apt-dpkg-install-ZM0HnK/0993-npm_7.5.2+ds-1_all.deb' package may not
> be in a working state. Please consider submitting a bug report about it.
>
> Now I cant upgrade using the software updater I get the following error
> The package system is broken
> If you are using third party repositories then disable them, since they
> are a common source of problems.
> Now run the following command in a terminal: apt-get install -f
> Transaction failed: The package system is broken
> The following packages have unmet dependencies:
> node-mkdirp:
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1953524/+subscriptions
>
>

Revision history for this message
Brian Murray (brian-murray) wrote : Re: Upgrade 20.04 to 21.10

The following lines in VarLogDistUpgradeApttermlog.txt indicate where part of the problem is:

Preparing to unpack .../npm_7.5.2+ds-1_all.deb ...^M
dpkg-maintscript-helper: error: file '/usr/share/npm/node_modules/node-gyp' not owned by package 'npm:all'^M
dpkg-maintscript-helper: error: file '/usr/share/npm/node_modules/node-gyp/gyp' not owned by package 'npm:all'^M
dpkg-maintscript-helper: error: file '/usr/share/npm/node_modules/node-gyp/gyp/pylib' not owned by package 'npm:all'^M
dpkg-maintscript-helper: error: file '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp' not owned by package 'npm:all'^M
dpkg-maintscript-helper: error: file '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/generator' not owned by package 'npm:all'^M
dpkg-maintscript-helper: error: file '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.pyc' not owned by package 'npm:all'^M
dpkg-maintscript-helper: error: file '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.pyc' not owned by package 'npm:all'^M
dpkg-maintscript-helper: error: file '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/input.pyc' not owned by package 'npm:all'^M
dpkg-maintscript-helper: error: file '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/common.pyc' not owned by package 'npm:all'^M
dpkg-maintscript-helper: error: file '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.pyc' not owned by package 'npm:all'^M
dpkg-maintscript-helper: error: file '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.pyc' not owned by package 'npm:all'^M
dpkg-maintscript-helper: error: file '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.pyc' not owned by package 'npm:all'^M
dpkg-maintscript-helper: error: directory '/usr/share/npm' contains files not owned by package npm:all, cannot switch to symlink^M
dpkg: error processing archive /var/cache/apt/archives/npm_7.5.2+ds-1_all.deb (--unpack):^M
 new npm package pre-installation script subprocess returned error exit status 1^M
Errors were encountered while processing:^M
 /var/cache/apt/archives/npm_7.5.2+ds-1_all.deb^M

However, looking at VarLogDistUpgradeAptclone the package node-gyp (which I'm guessing owns those files) is the official one from the Ubuntu archive for Focal.

The file /var/log/dist-upgrade/main.log from your upgrade attempt would be helpful in further figuring out what went wrong. The folder /var/log/dist-upgrade/ contains folders for the date and times an upgrade was attempted or made so if you don't find it in the root directory look in a folder like '20211207-1234'.

Changed in ubuntu-release-upgrader (Ubuntu):
status: New → Incomplete
Revision history for this message
Charles Simms (charliebsimms) wrote : Re: [Bug 1953524] Re: Upgrade 20.04 to 21.10
Download full text (5.2 KiB)

Brian

I have attached /var/log/dist-upgrade/20211207-0850 and 20211207-0819 which
have the log file requested.

Many thanks
Charlie Simms

On Wed, 8 Dec 2021 at 16:35, Brian Murray <email address hidden>
wrote:

> The following lines in VarLogDistUpgradeApttermlog.txt indicate where
> part of the problem is:
>
> Preparing to unpack .../npm_7.5.2+ds-1_all.deb ...^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp' not owned by package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp' not owned by package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib' not owned by package
> 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp' not owned by package
> 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/generator' not owned by
> package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.pyc' not
> owned by package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.pyc'
> not owned by package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/input.pyc' not owned by
> package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/common.pyc' not owned
> by package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.pyc' not
> owned by package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.pyc' not owned
> by package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.pyc'
> not owned by package 'npm:all'^M
> dpkg-maintscript-helper: error: directory '/usr/share/npm' contains files
> not owned by package npm:all, cannot switch to symlink^M
> dpkg: error processing archive
> /var/cache/apt/archives/npm_7.5.2+ds-1_all.deb (--unpack):^M
> new npm package pre-installation script subprocess returned error exit
> status 1^M
> Errors were encountered while processing:^M
> /var/cache/apt/archives/npm_7.5.2+ds-1_all.deb^M
>
> However, looking at VarLogDistUpgradeAptclone the package node-gyp
> (which I'm guessing owns those files) is the official one from the
> Ubuntu archive for Focal.
>
> The file /var/log/dist-upgrade/main.log from your upgrade attempt would
> be helpful in further figuring out what went wrong. The folder
> /var/log/dist-upgrade/ contains folders for the date and times an
> upgrade was attempted or made so if you don't find it in the root
> directory look in a folder like '20211207-1234'.
>
> ** Changed in: ubuntu-release-upgrader (Ubuntu)
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1953524
>
> Title:
> Upgrade 20.04 to 21.10
>
> Status in ub...

Read more...

Changed in ubuntu-release-upgrader (Ubuntu):
status: Incomplete → New
summary: - Upgrade 20.04 to 21.10
+ Upgrade 20.04 to 21.04
Revision history for this message
Brian Murray (brian-murray) wrote : Re: Upgrade 20.04 to 21.04

To test whether or not this was a generic problem I installed npm and node-gyp on an Ubuntu 20.04 system and then upgraded to Ubuntu 21.04. When doing this I did not encounter any errors so I suspect this failure was due to a local configuration change on your system.

Revision history for this message
Brian Murray (brian-murray) wrote :

Here's some evidence for the historical document.

bdmurray@clean-focal-amd64:~$ grep -C3 "npm_\|node-gyp_" /var/log/dist-upgrade/apt-term.log
Unpacking node-isexe (2.0.0-5) over (2.0.0-4) ...
Preparing to unpack .../479-node-which_2.0.2+~cs1.3.2-1_all.deb ...
Unpacking node-which (2.0.2+~cs1.3.2-1) over (2.0.2-1) ...
Preparing to unpack .../480-node-gyp_7.1.2-4_all.deb ...
Unpacking node-gyp (7.1.2-4) over (6.1.0-3) ...
Preparing to unpack .../481-node-har-schema_2.0.0-4_all.deb ...
Unpacking node-har-schema (2.0.0-4) over (2.0.0-3) ...
--
Unpacking node-uuid (8.3.2+~8.3.0-4) over (3.3.2-2) ...
Preparing to unpack .../528-node-write-file-atomic_3.0.3+~3.0.1-1_all.deb ...
Unpacking node-write-file-atomic (3.0.3+~3.0.1-1) over (3.0.3-1) ...
Preparing to unpack .../529-npm_7.5.2+ds-1_all.deb ...
Unpacking npm (7.5.2+ds-1) over (6.14.4+ds-1ubuntu2) ...
Preparing to unpack .../530-node-cacache_15.0.5+~cs13.9.21-1_all.deb ...
Unpacking node-cacache (15.0.5+~cs13.9.21-1) over (11.3.3-2) ...

summary: - Upgrade 20.04 to 21.04
+ Upgrade 20.04 to 21.04 due to an npm permissions issue
Revision history for this message
Charles Simms (charliebsimms) wrote : Re: [Bug 1953524] Re: Upgrade 20.04 to 21.10
Download full text (5.6 KiB)

Brian

Have you been able to make any progress?

I dont understand as any further install I still get the same error when I
run sudo apt-get install -f:
dpkg-maintscript-helper: error: file '/usr/share/npm/node_modules/node-gyp'
not owned by package 'npm:all'

Do I have to change the owner and group of
/usr/share/npm/node_modules/node-gyp to nmp:all, I thought with sudo it
should work.

I cant even build java apps using gradle. This is a real blocker, do I have
to now do a clean ubuntu install?

Regards
Charlie Simms

On Wed, 8 Dec 2021 at 16:35, Brian Murray <email address hidden>
wrote:

> The following lines in VarLogDistUpgradeApttermlog.txt indicate where
> part of the problem is:
>
> Preparing to unpack .../npm_7.5.2+ds-1_all.deb ...^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp' not owned by package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp' not owned by package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib' not owned by package
> 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp' not owned by package
> 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/generator' not owned by
> package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.pyc' not
> owned by package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.pyc'
> not owned by package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/input.pyc' not owned by
> package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/common.pyc' not owned
> by package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.pyc' not
> owned by package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.pyc' not owned
> by package 'npm:all'^M
> dpkg-maintscript-helper: error: file
> '/usr/share/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.pyc'
> not owned by package 'npm:all'^M
> dpkg-maintscript-helper: error: directory '/usr/share/npm' contains files
> not owned by package npm:all, cannot switch to symlink^M
> dpkg: error processing archive
> /var/cache/apt/archives/npm_7.5.2+ds-1_all.deb (--unpack):^M
> new npm package pre-installation script subprocess returned error exit
> status 1^M
> Errors were encountered while processing:^M
> /var/cache/apt/archives/npm_7.5.2+ds-1_all.deb^M
>
> However, looking at VarLogDistUpgradeAptclone the package node-gyp
> (which I'm guessing owns those files) is the official one from the
> Ubuntu archive for Focal.
>
> The file /var/log/dist-upgrade/main.log from your upgrade attempt would
> be helpful in further figuring out what went wrong. The folder
> /var/log/dist-upgrade/ contains folders for the date and times an
> upgrade ...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.