Skip to content

Impossible to install postgresql snap to CentOS 9 #26

@taurus-forever

Description

@taurus-forever

Steps to reproduce

  1. launch new VM: lxc launch --vm images:centos/9-Stream -c limits.cpu=6 -c limits.memory=16GiB -d root,size=100GiB # lxc exec $new-lxd bash
  2. Follow https://snapcraft.io/install/postgresql/centos to install snapd
  3. sudo snap install postgresql

Expected behavior

Successful installation, like sudo snap install opensearch

Actual behavior

Error:

[root@advanced-polecat ~]# sudo snap install postgresql
2025-06-13T14:00:37Z INFO Waiting for automatic snapd restart...
error: cannot perform the following tasks:
- Run install hook of "postgresql" snap if present (run hook "install": 
-----
cmd_run.go:450: restoring default SELinux context of /root/snap
chown: cannot access '/var/snap/postgresql/62/*': No such file or directory
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_US.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Error: The locale requested by the environment is invalid:
  LANG: en_US.utf8
-----)
[root@advanced-polecat ~]# 

Versions

Operating system:

CentOS 9-Stream amd64
lxc image list e5a08905b975
+-------+--------------+--------+---------------------------------------+--------------+-----------------+-----------+------------------------------+
| ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCHITECTURE | TYPE | SIZE | UPLOAD DATE |
+-------+--------------+--------+---------------------------------------+--------------+-----------------+-----------+------------------------------+
| | e5a08905b975 | no | CentOS 9-Stream amd64 (20250613_0032) | x86_64 | VIRTUAL-MACHINE | 902.88MiB | Jun 13, 2025 at 1:45pm (UTC) |
+-------+--------------+--------+---------------------------------------+--------------+-----------------+-----------+------------------------------+

Log output

See above. Extra:

[root@advanced-polecat ~]# snap changes
ID   Status  Spawn               Ready               Summary
...
9    Error   today at 14:15 UTC  today at 14:15 UTC  Install "postgresql" snap

[root@advanced-polecat ~]# snap change 9
Status  Spawn               Ready               Summary
Done    today at 14:15 UTC  today at 14:15 UTC  Ensure prerequisites for "postgresql" are available
Undone  today at 14:15 UTC  today at 14:15 UTC  Download snap "postgresql" (62) from channel "16/stable"
Done    today at 14:15 UTC  today at 14:15 UTC  Fetch and check assertions for snap "postgresql" (62)
Undone  today at 14:15 UTC  today at 14:15 UTC  Mount snap "postgresql" (62)
Undone  today at 14:15 UTC  today at 14:15 UTC  Copy snap "postgresql" data
Undone  today at 14:15 UTC  today at 14:15 UTC  Setup snap "postgresql" (62) security profiles
Undone  today at 14:15 UTC  today at 14:15 UTC  Make snap "postgresql" (62) available to the system
Undone  today at 14:15 UTC  today at 14:15 UTC  Automatically connect eligible plugs and slots of snap "postgresql"
Undone  today at 14:15 UTC  today at 14:15 UTC  Set automatic aliases for snap "postgresql"
Undone  today at 14:15 UTC  today at 14:15 UTC  Setup snap "postgresql" aliases
Error   today at 14:15 UTC  today at 14:15 UTC  Run install hook of "postgresql" snap if present
Hold    today at 14:15 UTC  today at 14:15 UTC  Run default-configure hook of "postgresql" snap if present
Hold    today at 14:15 UTC  today at 14:15 UTC  Start snap "postgresql" (62) services
Hold    today at 14:15 UTC  today at 14:15 UTC  Run configure hook of "postgresql" snap if present
Hold    today at 14:15 UTC  today at 14:15 UTC  Run health check of "postgresql" snap
Undone  today at 14:15 UTC  today at 14:15 UTC  Connect postgresql:network to snapd:network
Undone  today at 14:15 UTC  today at 14:15 UTC  Connect postgresql:network-bind to snapd:network-bind
Undone  today at 14:15 UTC  today at 14:15 UTC  Connect postgresql:shared-memory to snapd:shared-memory
Undone  today at 14:15 UTC  today at 14:15 UTC  Setup snap "postgresql" (62) security profiles for auto-connections

......................................................................
Run install hook of "postgresql" snap if present

2025-06-13T14:15:33Z ERROR run hook "install": 
-----
chown: cannot access '/var/snap/postgresql/62/*': No such file or directory
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_US.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Error: The locale requested by the environment is invalid:
  LANG: en_US.utf8
-----

[root@advanced-polecat ~]# 

P.S. do not reboot CentOS LXC VM with snapd: https://bugs.launchpad.net/snapd/+bug/2136699

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working as expected

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions