MacPorts: The Xcode Command Line Tools package appears to be installed, but its receipt appears to be missing.

root's picture

I was installing something today and I got an error. Looking closer I found there is a warning in the output:
Warning: The Xcode Command Line Tools package appears to be installed, but its receipt appears to be missing.

In this article, we will focus on that and fix it, of course!

The error

fmbp16:~ florian$ sudo port -v install xmms2
Warning: The Xcode Command Line Tools package appears to be installed, but its receipt appears to be missing.
Warning: The Command Line Tools may be outdated, which can cause problems.
Warning: Please see: <https://trac.macports.org/wiki/ProblemHotlist#reinstall-clt>
Warning: The Xcode Command Line Tools package appears to be installed, but its receipt appears to be missing.
Warning: The Command Line Tools may be outdated, which can cause problems.
Warning: Please see: <https://trac.macports.org/wiki/ProblemHotlist#reinstall-clt>

[... output removed ...]

Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_ffmpeg/ffmpeg/work/ffmpeg-4.4.4" && ./configure --prefix=/opt/local --cc="/usr/bin/clang" --mandir=/opt/local/share/man --enable-audiotoolbox --disable-indev=jack --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --enable-opencl --disable-outdev=xv --enable-sdl2 --disable-securetransport --enable-videotoolbox --enable-avfilter --enable-avresample --enable-fontconfig --enable-gnutls --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libzimg --enable-libzvbi --enable-lzma --enable-pthreads --enable-shared --enable-swscale --enable-zlib --enable-libaom --enable-libsvtav1 --arch=x86_64 --enable-x86asm --enable-gpl --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-postproc --enable-libfdk-aac --enable-nonfree 
Exit code: 1
Error: Failed to configure ffmpeg: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_ffmpeg/ffmpeg/main.log for details.
Error: Unable to execute port: upgrade ffmpeg failed

Let's focus on the warning:

Warning: The Xcode Command Line Tools package appears to be installed, but its receipt appears to be missing.
Warning: The Command Line Tools may be outdated, which can cause problems.
Warning: Please see: <https://trac.macports.org/wiki/ProblemHotlist#reinstall-clt>

Consulting the page I arrived to this command and the missing output means "If it doesn't print anything, you don't have a receipt and should reinstall the Command Line Tools as follows."

fmbp16:~ florian$ pkgutil --pkg-info=com.apple.pkg.{CLTools_Executables,CLTools_Base,DeveloperToolsCLI,DeveloperToolsCLILeo} 2>/dev/null | sed -n 's/^version: //p'
fmbp16:~ florian$

Not sure if it was related but "port diagnose" revealed also this error:

fmbp16:~ florian$ port diagnose
Error: The installed version of Xcode, 15.0.1, is not supported by MacPorts. For your currently installed system, the following versions of Xcode are supported: 15.0 14.3.1 14.3 14.2 14.1

NOTE: read until the end, this error is still there after the fix so it doesn't matter. Most probably this macports version does not have 15.0.1 listed but it is supported apparently.

The solution

Now, force software update to list and make command line tools available for update:

fmbp16:~ florian$ sudo touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
fmbp16:~ florian$ softwareupdate --list
Software Update Tool

Finding available software
Software Update found the following new or updated software:
* Label: Command Line Tools for Xcode-14.2
	Title: Command Line Tools for Xcode, Version: 14.2, Size: 687573KiB, Recommended: YES, 
* Label: Command Line Tools for Xcode-14.3
	Title: Command Line Tools for Xcode, Version: 14.3, Size: 711895KiB, Recommended: YES, 
* Label: Command Line Tools for Xcode-15.0
	Title: Command Line Tools for Xcode, Version: 15.0, Size: 721962KiB, Recommended: YES, 
* Label: Safari17.1VenturaAuto-17.1
	Title: Safari, Version: 17.1, Size: 162133KiB, Recommended: YES, 
* Label: macOS Ventura 13.6.1-22G313
	Title: macOS Ventura 13.6.1, Version: 13.6.1, Size: 465912KiB, Recommended: YES, Action: restart, 
* Label: macOS Sonoma 14.1-23B73
	Title: macOS Sonoma 14.1, Version: 14.1, Size: 4460807KiB, Recommended: YES, Action: restart, 
fmbp16:~ florian$

Install command line tools for your xcode version. In my case is 15.0:

fmbp16:~ florian$ softwareupdate -i "Command Line Tools for Xcode-15.0"
Software Update Tool

Finding available software

Downloading Command Line Tools for Xcode
Downloaded Command Line Tools for Xcode
Installing Command Line Tools for Xcode
Done with Command Line Tools for Xcode
Done.
fmbp16:~ florian$

Check again and if you get an output, this means everything is fine so delete the temporary file created earlier else software update will ALWAYS update the command line tools:

fmbp16:~ florian$ pkgutil --pkg-info=com.apple.pkg.{CLTools_Executables,CLTools_Base,DeveloperToolsCLI,DeveloperToolsCLILeo} 2>/dev/null | sed -n 's/^version: //p'
15.0.0.0.1.1694021235
fmbp16:~ florian$ sudo rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
Password:
fmbp16:~ florian$

No more clang error!

The output of xmms2 installation was too long but at least I can show you the last lines:

--->  Computing dependencies for xmms2..............
The following dependencies will be installed: 
 fftw-3-single
 libao
 libcddb
 libcdio
 libcdio-paranoia
 libdiscid
 libmad
 libmms
 libmpcdec
 libshout2
 mpg123
 py27-pyrex
 wavpack
Continue? [Y/n]: y

Also, as mentioned in some note above, the error about unsupported xcode version is not valid because I no longer have any error and is still present:

fmbp16:~ florian$ sudo port diagnose
Error: The installed version of Xcode, 15.0.1, is not supported by MacPorts. For your currently installed system, the following versions of Xcode are supported: 15.0 14.3.1 14.3 14.2 14.1

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.

Recent content

root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root