Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] emerge broken during profile upgrade
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
t3k0
n00b
n00b


Joined: 27 Nov 2007
Posts: 59

PostPosted: Mon Apr 22, 2024 12:57 am    Post subject: [SOLVED] emerge broken during profile upgrade Reply with quote

Hi all,

during following the upgrade guide of newsarticle "2024-03-22-new-23-profiles", emerge broke in the final step leaving a broken system.


    * upgrade from default/linux/amd64/17.1/desktop to default/linux/amd64/23.0/desktop

    * no bin packages

    * CHOST="x86_64-pc-linux-gnu"

    * no CHOST in /etc/make.conf

    * my system runs with glibc


During the final step running

Code:
emerge --ask --emptytree @world


I first removed very outdated packages from the world file with

Code:
emerge -vaW ignuit barry xskat gconf-editor gtkam gxine zim gtk-engines-aurora nimbus redhat-artwork


(However, I think this is not related to the following error.)

emerge failed after 6 or so packages at package sec-keys/openpgp-keys-gentoo-release

And afterwards I was left with a system which cannot run emerge at all:
When I rerun emerge --ask --emptytree @world
I end up with

Code:

PORTAGE_BZIP2_COMMAND setting is invalid: 'bzip2'
PORTAGE_BZIP2_COMMAND setting from make.globals is invalid: 'bzip2'
!!! BINPKG_COMPRESS unsupported bzip2. Missing package: app-arch/bzip2
Calculating dependencies... done!
Dependency resolution took 184.91 s (backtrack: 8/20).

[ebuild   R    ] sys-devel/gnuconfig-20230731
[ebuild   R    ] virtual/libintl-0-r2
[ebuild   R    ] virtual/libiconv-0-r2

[... a thousand packages ...]

[ebuild   R    ] x11-misc/lightdm-1.32.0-r2
[ebuild   R    ] x11-misc/lightdm-gtk-greeter-2.0.8-r1

Fetch instructions for media-libs/asio-sdk-2.3.3:
Warning: File compression unsupported bzip2. Missing package: app-arch/bzip2
portage: stty: command not found
[Errno 2] No such file or directory: 'mount':
   /usr/bin/sandbox /usr/lib/portage/python3.11/ebuild.sh nofetch
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/portage/process.py", line 461, in spawn
    _exec(
  File "/usr/lib/python3.11/site-packages/portage/process.py", line 842, in _exec
    s = subprocess.Popen(["mount", "--make-slave", "/proc"])
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1953, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'mount'
[ERROR] Exception in callback AbstractEbuildProcess._async_waitpid_cb(5661, 1)
handle: <Handle AbstractEbuildProcess._async_waitpid_cb(5661, 1)>
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.11/site-packages/_emerge/AbstractEbuildProcess.py", line 323, in _async_waitpid_cb
    if self.returncode < 0:
       ^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'NoneType' and 'int'
Beendet


I tried installing bzip2 manually, but ended up with a very similar error

Code:

PORTAGE_BZIP2_COMMAND setting is invalid: 'bzip2'
PORTAGE_BZIP2_COMMAND setting from make.globals is invalid: 'bzip2'
!!! BINPKG_COMPRESS unsupported bzip2. Missing package: app-arch/bzip2

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 7.17 s (backtrack: 0/20).

[ebuild   R    ] app-arch/bzip2-1.0.8-r5:0/1::gentoo  USE="static-libs -static -verify-sig" ABI_X86="32 (64) (-x32)" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No]

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) app-arch/bzip2-1.0.8-r5::gentoo
Warning: File compression unsupported bzip2. Missing package: app-arch/bzip2
[Errno 2] No such file or directory: 'mount':
   /bin/bash -c /usr/lib/portage/python3.11/ebuild.sh clean
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/portage/process.py", line 461, in spawn
    _exec(
  File "/usr/lib/python3.11/site-packages/portage/process.py", line 842, in _exec
    s = subprocess.Popen(["mount", "--make-slave", "/proc"])
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1953, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'mount'
 * The ebuild phase 'die_hooks' has been aborted since PORTAGE_BUILDDIR
 * does not exist: '/var/tmp/portage/app-arch/bzip2-1.0.8-r5'

>>> Failed to emerge app-arch/bzip2-1.0.8-r5

 * Messages for package app-arch/bzip2-1.0.8-r5:


Help is apreciated. What can I do now? Thanks.


Last edited by t3k0 on Mon Apr 29, 2024 11:04 am; edited 1 time in total
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1919

PostPosted: Mon Apr 22, 2024 4:00 am    Post subject: Reply with quote

t3k0 wrote:
Hi all,

during following the upgrade guide of newsarticle "2024-03-22-new-23-profiles", emerge broke in the final step leaving a broken system.

  • upgrade from default/linux/amd64/17.1/desktop to default/linux/amd64/23.0/desktop

Sorry but that's the wrong profile. It should be default/linux/amd64/17.1/desktop to default/linux/amd64/23.0/split-usr/desktop
This will be a challenge to fix. I am a bit surprised that the safety net didn't kick in earlier and warn about merge-usr vs split-usr
Back to top
View user's profile Send private message
t3k0
n00b
n00b


Joined: 27 Nov 2007
Posts: 59

PostPosted: Mon Apr 22, 2024 6:09 am    Post subject: Reply with quote

So what do you recommend to do? Switch profile and start the manual from top? Other than gcc, glibc and libtool and the first 5 or so packages from the world file I didn't update, yet.

Or will I mess up my system even more by doing that?
Back to top
View user's profile Send private message
t3k0
n00b
n00b


Joined: 27 Nov 2007
Posts: 59

PostPosted: Mon Apr 22, 2024 7:12 am    Post subject: Reply with quote

OK. I just tested this. But it doesn't work.

When I try the next step of emerging binutils, it directly fails to build with error

Code:
>>> Emerging (1 of 1) sys-devel/binutils-2.41-r5::gentoo
/usr/bin/env: ‘bash’: No such file or directory
 * The ebuild phase 'die_hooks' has been aborted since PORTAGE_BUILDDIR
 * does not exist: '/var/tmp/portage/sys-devel/binutils-2.41-r5'


after
Code:
env-update && source /etc/profile


The emerge error becomes

Code:
PORTAGE_BZIP2_COMMAND setting is invalid: 'bzip2'
PORTAGE_BZIP2_COMMAND setting from make.globals is invalid: 'bzip2'
!!! BINPKG_COMPRESS unsupported bzip2. Missing package: app-arch/bzip2

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 8.06 s (backtrack: 0/20).

[ebuild   R    ] sys-devel/binutils-2.41-r5

Would you like to merge these packages? [Yes/No]

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) sys-devel/binutils-2.41-r5::gentoo
Warning: File compression unsupported bzip2. Missing package: app-arch/bzip2
[Errno 2] No such file or directory: 'mount':
   /bin/bash -c /usr/lib/portage/python3.11/ebuild.sh clean
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/portage/process.py", line 461, in spawn
    _exec(
  File "/usr/lib/python3.11/site-packages/portage/process.py", line 842, in _exec
    s = subprocess.Popen(["mount", "--make-slave", "/proc"])
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1953, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'mount'
 * The ebuild phase 'die_hooks' has been aborted since PORTAGE_BUILDDIR
 * does not exist: '/var/tmp/portage/sys-devel/binutils-2.41-r5'

>>> Failed to emerge sys-devel/binutils-2.41-r5

 * Messages for package sys-devel/binutils-2.41-r5:


What can I do now?
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 4669
Location: Germany

PostPosted: Mon Apr 22, 2024 9:09 am    Post subject: Reply with quote

I think the problem now is your sys-apps/baselayout package is currently installed with -split-usr useflag - if so, this changed the path

As a workaround to fix it, i would try the following: Create temporary /etc/env.d/50baselayout-sbin file with
Code:
PATH="/usr/local/sbin:/usr/sbin"
ROOTPATH="/usr/local/sbin:/usr/sbin"
Then run
Code:
# /usr/sbin/env-update
$ source /etc/profile
Then rebuild sys-apps/baselayout (now with split-usr useflag enabled) - after this remove the /etc/env.d/50baselayout-sbin file.
After this your emerge should (hopefully) work again.
Back to top
View user's profile Send private message
t3k0
n00b
n00b


Joined: 27 Nov 2007
Posts: 59

PostPosted: Mon Apr 22, 2024 9:27 am    Post subject: Reply with quote

Hi Josef.95,

it doesn't work because of this BZIP2 error.

after your changes and running emerge -va1 sys-apps/baselayout

Code:

PORTAGE_BZIP2_COMMAND setting is invalid: 'bzip2'
PORTAGE_BZIP2_COMMAND setting from make.globals is invalid: 'bzip2'
!!! BINPKG_COMPRESS unsupported bzip2. Missing package: app-arch/bzip2

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 20.14 s (backtrack: 0/20).

[ebuild   R    ] sys-apps/baselayout-2.14-r2::gentoo  USE="(split-usr*) -build" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No]

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) sys-apps/baselayout-2.14-r2::gentoo
Warning: File compression unsupported bzip2. Missing package: app-arch/bzip2
[Errno 2] No such file or directory: 'mount':
   /bin/bash -c /usr/lib/portage/python3.11/ebuild.sh clean
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/portage/process.py", line 461, in spawn
    _exec(
  File "/usr/lib/python3.11/site-packages/portage/process.py", line 842, in _exec
    s = subprocess.Popen(["mount", "--make-slave", "/proc"])
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1953, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'mount'
 * The ebuild phase 'die_hooks' has been aborted since PORTAGE_BUILDDIR
 * does not exist: '/var/tmp/portage/sys-apps/baselayout-2.14-r2'

>>> Failed to emerge sys-apps/baselayout-2.14-r2

 * Messages for package sys-apps/baselayout-2.14-r2:



However, I cant merge app-arch/bzip2 either.
It results in following error:

Code:

PORTAGE_BZIP2_COMMAND setting is invalid: 'bzip2'
PORTAGE_BZIP2_COMMAND setting from make.globals is invalid: 'bzip2'
!!! BINPKG_COMPRESS unsupported bzip2. Missing package: app-arch/bzip2

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 8.10 s (backtrack: 0/20).

[ebuild   R    ] app-arch/bzip2-1.0.8-r5:0/1::gentoo  USE="static-libs -static -verify-sig" ABI_X86="32 (64) (-x32)" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No]

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) app-arch/bzip2-1.0.8-r5::gentoo
Warning: File compression unsupported bzip2. Missing package: app-arch/bzip2
[Errno 2] No such file or directory: 'mount':
   /bin/bash -c /usr/lib/portage/python3.11/ebuild.sh clean
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/portage/process.py", line 461, in spawn
    _exec(
  File "/usr/lib/python3.11/site-packages/portage/process.py", line 842, in _exec
    s = subprocess.Popen(["mount", "--make-slave", "/proc"])
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1953, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'mount'
 * The ebuild phase 'die_hooks' has been aborted since PORTAGE_BUILDDIR
 * does not exist: '/var/tmp/portage/app-arch/bzip2-1.0.8-r5'

>>> Failed to emerge app-arch/bzip2-1.0.8-r5

 * Messages for package app-arch/bzip2-1.0.8-r5:

Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 373

PostPosted: Mon Apr 22, 2024 11:10 am    Post subject: Reply with quote

It is failing because mount is not in your $PATH. Or at least not in portage's $PATH when it tries to execute mount --make-slave /proc.

So where is your mount command and can portage reach it?
Back to top
View user's profile Send private message
t3k0
n00b
n00b


Joined: 27 Nov 2007
Posts: 59

PostPosted: Mon Apr 22, 2024 12:20 pm    Post subject: Reply with quote

When I first open a new shell:

type mount says it is in /bin/mount

and echo $PATH says
Code:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/17/bin:/usr/lib/llvm/16/bin


It should be there.

After env-update && source /etc/profile
and echo $PATH says
Code:
/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/bin:/usr/sbin:/usr/lib/llvm/17/bin:/etc/eselect/wine/bin


I set now manually PATH to the first output.
After running emerge app-arch/bzip2
I still get the error

Code:

>>> Emerging (1 of 1) app-arch/bzip2-1.0.8-r5::gentoo
/usr/bin/env: ‘bash’: No such file or directory
 * The ebuild phase 'die_hooks' has been aborted since PORTAGE_BUILDDIR
 * does not exist: '/var/tmp/portage/app-arch/bzip2-1.0.8-r5'
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 373

PostPosted: Mon Apr 22, 2024 1:04 pm    Post subject: Reply with quote

Similar problem. Is bash in your $PATH?
Your profile is messed up. Read /etc/profile and fix $PATH there.
Then go back to profile 17.1.
Back to top
View user's profile Send private message
t3k0
n00b
n00b


Joined: 27 Nov 2007
Posts: 59

PostPosted: Mon Apr 22, 2024 1:21 pm    Post subject: Reply with quote

Doesn't work.

I switched back to default/linux/amd64/17.1/desktop using eselect

I edited manually /etc/profile with the line
Code:
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/17/bin:/usr/lib/llvm/16/bin"

and run env-update && source /etc/profile

Now, $PATH is as in the codeblock above and type mount or type bash works.

But I still cannot emerge.

I still end up with

Code:
>>> Emerging (1 of 1) app-arch/bzip2-1.0.8-r5::gentoo
/usr/bin/env: ‘bash’: No such file or directory
 * The ebuild phase 'die_hooks' has been aborted since PORTAGE_BUILDDIR
 * does not exist: '/var/tmp/portage/app-arch/bzip2-1.0.8-r5'
Back to top
View user's profile Send private message
t3k0
n00b
n00b


Joined: 27 Nov 2007
Posts: 59

PostPosted: Mon Apr 22, 2024 9:07 pm    Post subject: Reply with quote

Small update:

The command env-update seems to be the culprit.

After running it seems to overwrite both /etc/profile and /etc/profile.env and therefore the PATH variable I set manually.

Thus, instead of env-update && source /etc/profile I only did source /etc/profile and now at least emerge works again.

I'm trying now to rebuild my 17.1 profile and afterwards start over with upgrading to 23.

Let's see if it is successful.

By the way: What is the difference between /etc/profile and /etc/profile.env? First, I only set past in /etc/profile and wasn't even aware that there is /etc/profile.env. However it seems that PATH is read from the latter file.
Back to top
View user's profile Send private message
t3k0
n00b
n00b


Joined: 27 Nov 2007
Posts: 59

PostPosted: Tue Apr 23, 2024 5:25 am    Post subject: Reply with quote

Next update and question:

I'm now at the point, where I want to restart following the instructions to switch to 23.

Thus, I switched with eselect from default/linux/amd64/17.1/desktop to default/linux/amd64/23.0/split-usr/desktop.

But the issue is that env-update still creates an /etc/profile.env with a wrong PATH and I'm afraid that other variables might also be wrong.

I don't think it's a good idea to manually edit the PATH in /etc/profile.env. It should be correct directly after running env-update. Also I fear that if I now rebuild everything this issue might persist even after completion.

How can I first fix this?
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1919

PostPosted: Tue Apr 23, 2024 12:25 pm    Post subject: Reply with quote

t3k0 wrote:
But the issue is that env-update still creates an /etc/profile.env with a wrong PATH and I'm afraid that other variables might also be wrong.

I don't think it's a good idea to manually edit the PATH in /etc/profile.env. It should be correct directly after running env-update. Also I fear that if I now rebuild everything this issue might persist even after completion.

How can I first fix this?
All env-update does is compiles the settings in /etc/env.d into profile.env and ld.so.conf as needed.
Making changes in /etc/env.d is very much within reason.
Rebuilding sys-apps/baselayout on a correct profile should reset the default paths in /etc/env.d/50baselayout file
Back to top
View user's profile Send private message
t3k0
n00b
n00b


Joined: 27 Nov 2007
Posts: 59

PostPosted: Tue Apr 23, 2024 7:08 pm    Post subject: Reply with quote

Thank you. It seems rebuilding sys-apps/baselayout was the necessary trick.
I will now try to rebuild my system to complete migration to the 23 profile.
I will let you know, when it was successful.
Back to top
View user's profile Send private message
t3k0
n00b
n00b


Joined: 27 Nov 2007
Posts: 59

PostPosted: Mon Apr 29, 2024 11:02 am    Post subject: [solved] emerge broken during profile upgrade Reply with quote

Operation successful.
Thank you all for helping.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum