My Oracle Support Banner

pkg commands may fail with file protocol error: code: E_HTTP_NOT_FOUND (22) or code: 22 (Doc ID 2959982.1)

Last updated on JULY 21, 2024

Applies to:

Solaris Operating System - Version 11.0 to 11.4 [Release 11.0]
Information in this document applies to any platform.

Symptoms

 When running commands like 'pkg set-publisher', 'pkg update', 'pkg install', 'pkg list', 'pkg search', 'pkgrepo list' or other pkg commands, it may fail with: file protocol error: code: E_HTTP_NOT_FOUND (22) or file protocol error: code: 22, as seen in examples below.
Your actual repository can be /net, file:/// or /some_dir_or_mount-point. If the valid repository is not found for any reasons, the same E_HTTP_NOT_FOUND error is displayed. Your repository does not need to begin with http:// or https://.

# pkg set-publisher -g file:///var/share/pkg solaris
The origin URIs for 'solaris' do not appear to point to a valid pkg repository.
Please verify the repository's location and the client's network configuration.
Additional details:

Unable to contact valid package repository
Encountered the following error(s):
Transport errors encountered when trying to contact repository.
Reported the following errors:
file protocol error: code: E_HTTP_NOT_FOUND (22) reason: The path '/var/share/pkg' does not contain a valid package repository.
Repository URL: 'file:///var/share/pkg'.

 

 Solaris 11.3

# pkg set-publisher -g file:///var/share/pkg solaris
pkg set-publisher: The origin URIs for 'solaris' do not appear to point to a valid pkg repository.
Please verify the repository's location and the client's network configuration.
Additional details:

Unable to contact valid package repository
Encountered the following error(s):
Unable to contact any configured publishers.
This is likely a network configuration problem.
file protocol error: code: 22 reason: The path '/var/share/pkg' does not contain a valid package repository.
Repository URL: 'file:///var/share/pkg'.

 

 Solaris 11.2

root@solaris:/root# pkg list -g /temppool/testrepo entire

Errors were encountered while attempting to retrieve package or file data for
the requested operation.
Details follow:

file protocol error: code: 22 reason: The path '/temppool/testrepo' does not contain a valid package repository.
Repository URL: 'file:///temppool/testrepo'.

 

 pkgrepo(1) command can also fail with the same error.

# pkgrepo info -s /var/share/pkg
pkgrepo: file protocol error: code: E_HTTP_NOT_FOUND (22) reason: The path '/var/share/pkg' does not contain a valid package repository.
Repository URL: 'file:///var/share/pkg'.

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.