-2

While installing Apache AGE from master branch, on PostgreSQL 14, the following error appeared while issuing make install:

/usr/bin/install: cannot remove '/usr/local/pgsql/lib/age.so': Permission denied
make: \*\*\* \[/usr/local/pgsql/lib/pgxs/src/makefiles/../../src/Makefile.shlib:456: install-lib-shared\] Error 1

What should I do to fix this?

What I tried was using the command sudo chown <user> /usr/local/pgsql/. This didn't help and the error persisted. Any tips on solving this?

  • Usually `make install` is executed along with a delicate `sudo`. (If you are sure you want to install it into system directories) – skandigraun Aug 08 '23 at 13:06

17 Answers17

2

First of all you need to have the AGE compatible version of PostgreSQL. If versions are not compatible then make install is not gonna work. As you are working with PostgreSQL v14 you need to checkout to PG14 branch of AGE.

If you have installed compatible versions then its the issue with permissions. For that you have to be super user or you can use -R with the command. Its because -R changes the ownership of directory and all its content.

Zeeshan
  • 71
  • 2
0

Try using chown with the -R flag, so it will change the owner of all the files within the folder:

sudo chown -R <user> /usr/local/pgsql/

This may fix the issue.

Marco Souza
  • 296
  • 7
0

I hope sudo chown -R <user> /usr/local/pgsql/ has solved your problem.

As per official documentation, AGE doesn't support PostgreSQL-14 yet.

Reference

0

your libraries are not installed first do

sudo make clean

then do

brew install build-essential libreadline zlib flex bison

then install postgres 12 version after that do sudo make

0

First of all you need to run the commands of installation with sudo:

sudo make PG_CONFIG=/the/pg_config/path/of/postgres install

also make sure that the repositories of your postgres/bin have the correct permissions:

sudo chown -R <username> path/to/postgres/
0

To install in the system directory, simply run:

sudo make PG_CONFIG=/path/to/pg_config install

Then you dont have to use the -R flag for the following:

sudo chown <user> /usr/local/pgsql/
Tito
  • 289
  • 8
0

For issues with permission make sure to use 'sudo' before your commands for administrative permission.

If you are having trouble installing Apache age just follow these simple steps below. Apache Age will only work with postgres version 11,12 or 13.

If you face any trouble ask.

This is how i successfully did it.

Follow this. Ask if you have any question.

You should install Age version Compatible with your postgres version

1.Check your postgres version installed. 'V' in CAPITAL

psql -V

2.Clone Age Source code from Github.

git clone https://github.com/apache/age.git

3.CD into Age directory

cd age

4.Checkout to the branch of Age source corresponding to you postgres version. i.e if 12 checkout to 'PG12'

git checkout PG12

Note: There are three checkout option, make sure you spell them right. They include 'PG11' 'PG12' 'PG13' Otherwise the checkout will be invalid.

5.Install with administrative privileges using sudo

sudo make install

6.Confirm install

make installcheck

This should work

-1

you need to use the -R flag before username.

In this way you will apply the permissions for all the paths and files inside the respective directories

Marcos Silva
  • 115
  • 5
-1

I think you must be a super user to properly install AGE. Also use the proper vesions of AGE (PG 11,12,13). For starters try reinstalling your AGE and Before that use the command

sudo chown -R <user> /usr/local/pgsql/

Also use sudo with the make install command. Hope this helps

-1

Someone here has mentioned sudo chown -R <user> /usr/local/pgsql/ to recursively set the owner privileges.

But you can also try installing AGE directly into the system directory using sudo make PG_CONFIG=/path/to/pg_config install

Hassoo
  • 85
  • 11
-1

To solve this issue, first you need to run the installation command:

sudo make install

then you have to use chown command to change the owner of the file like:

sudo chown -R <user>/usr/local/pgsql
adil shahid
  • 125
  • 4
-1

As others have mentioned try using the -R flag. Also check the permissions the file has using ls -l and confirm it has the relevant permissions or not.

-1

When choosing the versions for both postgres and age, try using version 11 or version 12.PG11 and P12 have for LTS for age. See https://age.apache.org/age-manual/master/intro/setup.html

cmucheru
  • 1
  • 2
-1

First of all, make sure that the versions for both AGE and PostgreSQL are compatible with each other or not.

If the issue persists, it is more likely due to permissions.

Try running the following command:

sudo chown -R <user> /usr/local/pgsql/

Using the -R flag will let you have permissions for all files and paths in a directory.

Saif Ali
  • 53
  • 3
-1

You are using right command still it is not working, this may be because you are not using the -R flag. Rectify your command like this and then try to install.

sudo chown -R <user> /usr/local/pgsql/

Hope this will fix the issue

-1

The installation process is encountering an error due to a permission issue. It doesn't have the necessary permissions to replace the 'age.so' file with a new one. You can check ownership rights and permission using the following command and then make changes accordingly based on the necessary permissions: ls -ld /usr/local/pgsql/lib

-2

Use sudo with make install: Since you're modifying system-wide directories like /usr/local/pgsql, you might need superuser privileges. Try running the make install command using sudo:

sudo make install

This should execute the installation process with elevated permissions, allowing it to remove the old age.so and install the new one

Check Ownership and Permissions:

Since you've already tried changing ownership using sudo chown /usr/local/pgsql, but make sure you're using the correct username and that the ownership change was successful. Also, ensure that the permissions are set correctly on the lib directory and its contents.

sudo chown -R /usr/local/pgsql sudo chmod -R 755 /usr/local/pgsql

Replace the with your username

Remove the Existing File Manually: If you're still facing permission issues, you can try manually removing the existing age.so file before running make install.

sudo rm /usr/local/pgsql/lib/age.so

After removing the file, try running make install again.

Use make clean:

You can use make clean command to clean the build before trying the installation again. After that, try the installation process again using sudo make install.

Hope it helps!