ლ(ಠ益ಠლ)

Gentoo Depclean Nano Removal and Econf Failure

Following a Gentoo server @world update, a depclean operation was issued, warning that app-editors/nano would be removed from the system profile.

Update the portage tree:

1
2
# how long since the last sync? emerge --info
$ emerge --sync

First things first, update portage:

1
$ emerge -av portage

After portage is updated, let’s proceed with a full update–naturally dependency resolution will depend on several variables, not limited to, the packages currently installed, the contents of make.conf, etc.:

1
2
3
4
5
6
7
8
9
10
# emerge -avNDup

# --ask (-a), require user interaction to proceed
# --verbose (-v), run in verbose mode
# --newuse (-N), include installed packages where USE flags have changed since compilation
# --deep (-D), check entire dependency tree of packages, rather than checking immediate package dependencies
# --update (-u), update packages to "best" version available
# --pretend (-p), don't actually perform the merge, show what "would" be installed

$ emerge -av --newuse --deep --update --pretend @world

Notice we used the –pretend option. Once you’re satisfied with the results of the system update. Remove the –pretend:

1
2
# emerge -avNDu
$ emerge -av --newuse --deep --update @world

I see Python 3.0+ was pulled in for a merge along with some perl packages–quite important, take heed. Issue the following after the update has completed:

1
2
3
# perl-cleaner -- Find & rebuild packages and Perl header files broken due to a perl upgrade
# --all          Short for --modules --libperl --phall
$ perl-cleaner --all
1
$ python-updater all

After a successful update, you’ll most likely need to merge the new config files. Make any necessary backups and, once ready, issue an etc-update:

1
2
3
# I generally use -5
# -5 to auto-merge AND not use 'mv -i'
$ etc-update

Config files are now merged. You’ll want to revert or update any of your config files. Also, not a bad idea to review the rest of the update notes–keep an eye out for updates relating to openrc, udev, and sshd.

Finally, I decided to run a ‘–depclean’, to remove packages that are not associated with explicitly merged packages. Depclean is intelligent enough to not remove any packages unless all dependencies have been resolved. Don’t skip around–you definitely want to run the ‘emerge -avNDu @world’ prior to a depclean:

1
2
# --depclean (-c), Cleans the system by removing packages that are not associated with explicitly merged packages.
$ emerge -av --depclean

It will crunch– please thoroughly review the warnings. I noticed it pulled in app-editors/nano:

1
2
3
4
5
6
!!! 'app-editors/nano' is part of your system profile.
!!! Unmerging it may be damaging to your system.
 app-editors/nano
    selected: 2.3.1
   protected: none
     omitted: none

Well that’s pretty disturbing and sounds important. This has been, in fact, thoroughly discussed on the Gentoo bugzilla.

I decided to let it remove it during the depclean operation and simply add it back afterwards:

1
$ emerge -av --depclean

Re-add nano:

1
$ emerge -av nano
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
configure: error: C compiler cannot create executables
See `config.log' for more details

checking whether the C compiler works... no
configure: error: in `/var/tmp/portage/app-editors/nano-2.3.1-r2/work/nano-2.3.1':
configure: error: C compiler cannot create executables
See `config.log' for more details

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/app-editors/nano-2.3.1-r2/work/nano-2.3.1/config.log
ERROR: app-editors/nano-2.3.1-r2 failed (configure phase):
  econf failed

If you need support, post the output of `emerge --info '=app-editors/nano-2.3.1-r2'`,
the complete build log and the output of `emerge -pqv '=app-editors/nano-2.3.1-r2'`.
The complete build log is located at '/var/tmp/portage/app-editors/nano-2.3.1-r2/temp/build.log'.
The ebuild environment file is located at '/var/tmp/portage/app-editors/nano-2.3.1-r2/temp/environment'.
Working directory: '/var/tmp/portage/app-editors/nano-2.3.1-r2/work/nano-2.3.1'
S: '/var/tmp/portage/app-editors/nano-2.3.1-r2/work/nano-2.3.1'

Oops, that was unexpected. The important clues:

  • configure: error: C compiler cannot create executables
  • The complete build log is located at '/var/tmp/portage/app-editors/nano-2.3.1-r2/temp/build.log'.

So something happened to gcc during our update(s) and the depclean. Let’s look at the build log:

1
$ less /var/tmp/portage/app-editors/nano-2.3.1-r2/temp/build.log

The important contents:

1
2
3
4
5
6
7
8
9
10
11
configure:3284: checking for C compiler version
configure:3293: x86_64-pc-linux-gnu-gcc --version >&5
 * gcc-config: Active gcc profile is invalid!
gcc-config: error: could not run/locate 'x86_64-pc-linux-gnu-gcc'
configure:3304: $? = 1
configure:3324: checking whether the C compiler works
configure:3346: x86_64-pc-linux-gnu-gcc -march=native  -Wl,-O1 -Wl,--as-needed conftest.c  >&5
 * gcc-config: Active gcc profile is invalid!
gcc-config: error: could not run/locate 'x86_64-pc-linux-gnu-gcc'
configure:3350: $? = 1
configure:3388: result: no

Alright, now we see the issue, what does gcc-config say?

1
2
3
4
# gcc-config -l
 * gcc-config: Active gcc profile is invalid!

 [1] x86_64-pc-linux-gnu-4.7.3

Set the gcc-config profile, reload profile:

1
$ gcc-config 1 && source /etc/profile

Merge nano:

1
$ emerge -av nano

Happy compiling!

Comments