Can't install pgaudit on Ubuntu - postgresql

Trying to do everything by instruction in git.
Clone the pgAudit extension:
git clone https://github.com/pgaudit/pgaudit.git
Change to pgAudit directory:
cd pgaudit
Checkout REL_13_STABLE branch (note that the stable branch may not exist for unreleased versions of PostgreSQL):
git checkout REL_13_STABLE
Build and install pgAudit:
make install USE_PGXS=1 PG_CONFIG=/usr/pgsql-13/bin/pg_config
BUT make commande doesn't work and shows:
make: *** No rule to make target 'install'. Stop.
Tried to update postgresql to 13 version, because there is version 12 in Ubuntu by default, but this didn't help.

Depending on the versions of Ubuntu and PostgreSQL you may not need to clone the Git repository of pgAudit and compile it from the sources.
For example, Ubuntu 20.04 has a package named postgresql-12-pgaudit which may be what you need. To install it, open your terminal and type
sudo apt-get install -y postgresql-12-pgaudit
into it. The package manager should take care of the rest. This assumes that you are still using PostgreSQL 12 and not version 13. Otherwise you may have to downgrade or check whether there is a corresponding package for your version of PostgreSQL.
The version in the package name may change for earlier or later versions of Ubuntu. For example, Ubuntu 21.04 uses postgresql-13-pgaudit while Ubuntu 18.04 still uses postgresql-10-pgaudit.

Related

Is there a problem with having 2 versions of postgres for Apache-Age

I installed the Apache-Age extension for postgres and this extension specifies that it works with postgres-11 or postgres-12. However I have already installed postgres-14 on my system. Am i gonna have a problem with that? And if I am how do i only uninstall the postgres-14 version?
I tried searching the deb packages installed to see if i find postgres-14 but i can't seem to find it
So mainly the apache-age extension works with PostgreSQL versions 11 and 12. It creates problems with different other versions of PostgreSQL.
In order to have a smooth installation follow the below steps:
uninstall PostgreSQL version 14
reinstall PostgreSQL version 11 or 12
Uninstalling PostgreSQL version 14:
For uninstalling the PostgreSQL from ubuntu:
sudo apt remove postgresql postgresql-contrib
The output would look something like this:
After uninstalling PostgreSQL, uninstall the dependencies
sudo apt autoremove
The output of the above command would look like this:
enter Y here and the PostgreSQL will be uninstalled.
Now reinstall the PostgreSQL version 11 or 12 using the below commands:
Download the files in any folder:
wget https://ftp.postgresql.org/pub/source/v11.18/postgresql-11.18.tar.gz && tar -xvf postgresql-11.18.tar.gz && rm -f postgresql-11.18.tar.gz
The command will download and extract the tar files for Linux users from Source in the working directory.
Installing PG:
Now we will move toward installing PG
cd postgresql-11.18
# configure by setting flags
./configure --enable-debug --enable-cassert --prefix=$(path) CFLAGS="-ggdb -Og
# now install
make install
References:
For more references you can also see:
https://dev.to/talhahahae/installation-of-apache-age-and-postgresql-from-source-in-linux-part-1-gka
https://www.commandprompt.com/education/how-to-uninstall-postgresql-from-ubuntu/#:~:text=Conclusion-,To%20uninstall%20Postgres%20from%20your%20Ubuntu%20operating%20system%2C%20open%20the,“sudo%20apt%20autoremove”%20command.
https://github.com/git-guides/install-git
https://age.apache.org/age-manual/master/intro/setup.html
https://www.postgresql.org/docs/current/install-procedure.html
Apache AGE only supports Postgres-11 and Postgres-12. You can follow the following to install Apache AGE with Postgres:
How to install AGE extension of postgresql from source code in ubuntu?
While Apache Age is designed to work with PostgreSQL 11 and 12, you can have multiple versions of PostgreSQL installed in your computer. However, the installations need to be in "different directories". Each version of PostgreSQL will have its own set of binaries and configuration files.
When you install multiple versions of PostgreSQL, it is important to ensure that each version is installed in a separate directory and that the ports used by each instance do not conflict with each other. Additionally, you may need to specify the correct version of PostgreSQL when running commands, by using the appropriate version-specific binary or setting the PATH environment variable to include the correct directory.

Ubuntu16.0.4 Postgresql9.4 offline install

I search url,they are for Linux centos,I don't know how to offline install it in ubuntu16.0.4 .
Any help will appreciated!
Method1:(no success)
set source.list,read readme( from https://apt.postgresql.org/pub/repos/apt/dists/xenial-pgdg/9.4/)
download deb package
copy them to the target computer
dpkg -i *.deb
Method2:(success)
https://techedemic.com/2014/10/01/offline-package-installs-using-dpkg-and-apt-get-ubuntudebianetc/
Ubuntu 16.04 came with postgresql 9.5, IIRC. So you will need to download the right debian packages (for example from the postgresql APT package repository), and transfer them to the target computer), and install them manually (dpkg -i all-dot-deb-files).
But i'd install some newer version of postgres. 9.4 will be end-of-life in one year.

Completely uninstall Eclipse 4.7 version in RHEL 7.4 Maipo

I'm trying to uninstall the current version of Eclipse IDE in my RHEL machine by simply deleting all the files like:
sudo rm -rf ~/.eclipse
sudo rm -rf ~/eclipse-workspace
I also tried
sudo yum remove 'eclipse*'
However, these didn't seem to solve the purpose.
Any help will be appreciated, thanks!
Applications on Linux systems are most often installed using so-called packages, which are managed by a package management system. In the case of RHEL, packages use the RPM format, and the package manager of choice is a tool called yum.
Both installation and removal of software (packages) should be done using yum, so as to allow the package management system keep track of all installed files and current status. Therefore, you shouldn't try to remove software by simply deleting files from the file system. Instead, use the yum command. See the RHEL System Admin Guide for a detailed explanation of how to use yum to search, install, upgrade, and remove packages: Working with Packages.
You have tried the correct command (yum remove <package-name>), but you need to use the correct package name. On RHEL 7.4, the latest version of Eclipse is available as a part of the DevTools channel, and the package name is rh-eclipse47 (see Enabling the Red Hat Developer Tools Repositories). Note that you may have also installed an older version, which would be, for example, rh-eclipse46.
To find out what is the name of the package you have installed, you can run, for example, the following command:
yum list installed | grep eclipse
There is also the possibility that you installed the software not from an RPM package but manually, e.g. from a .tar.gz file distrubuted from eclipse.org. If that's the case, you will need to use the uninstaller program supplied with that distribution of the software.
Write command as:
rpm -qa|grep eclipse
This will give a list of installed packages. Remove all the packages by giving below command:
rpm -e *package-name*
Done!!!

How to install Postgis to a Keg installation of Postgres#9.6 using Homebrew?

I have installed Postgresql#9.6 and Postgis via Homebrew. However, installing Postgis via Homebrew installs the latest version of Postgresql at 10 as dependency and pinning Postgresql at 9.6.5 blocks the install of Postgis via Homebrew.
Performing 'CREATE EXTENSION postgis;' returns:
ERROR: could not open extension control file "/usr/local/Cellar/postgresql#9.6/9.6.5/share/postgresql#9.6/extension/postgis.control": No such file or directory
I've also tried uninstalling the Postgresql (at 10) and editing the Postgis formula to depend on Postgres#9.6 instead of Postgresql.
This is similar to How to install Postgis to a Keg installation of Postgres#9.5 using Homebrew? but with a later keg formula
I managed to do it after many combinations.
In a nutshell, solution is to install the old version of the original package postgres, switch to it, and install the old version of postgis.
Install postgres
1/ Install the current version of postgres (10.1 as speaking)
brew install postgres
2/ Install the old version of postgres using its old formula. Proper link can be found using github or git log on the Tap repo (/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/).
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/d014fa223f77bee4b4097c5e80faa0954e28182f/Formula/postgresql.rb
This will install the version 9.6.5 (last one before 10.x series).
3/ Switch to it so links are defaulted to postgres 9.6
brew switch postgres 9.6.5
Install postgis
4/ Install old version of postgis (2.3). This is using the same sha version of the Formula so everything is linked correctly (using the current postgis will expect postgresql 10, so it will end up to a version mismatch when initializing extension).
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/d014fa223f77bee4b4097c5e80faa0954e28182f/Formula/postgis.rb
Use them
5/ If required initialise the DB
initdb /usr/local/var/postgres
6/ Create and use your DB
createdb mydb
psql mydb
mydb=# CREATE EXTENSION postgis;
Installing PEX, a package manager for Postgresql allowed me to install Postgis for the keg version of Postgresql#9.6 and use CREATE EXTENSION postgis;
This isn't a Homebrew solution but after a lot of searching, it finally allowed me to use Postgis.
HelloI ran into this same problem of multiple implementation of pgsql versions including legacy ones. So after a bit of research I would like to share my solution.
Problem:
I am working on a macbook pro 2013 with 10.11 el capitan. I am GIS developer and extensive user of homebrew. I didn't pin the postgresql package for compatibility reasons. Thus, the package got updated to postgresql version 10.5 along other packages. This caused me to be unable to use postgresql version 9.4. The cleverest solution would have been to use a brew switch postgresql 9.4.19. Except that when compiling postgis 2.5.0 from osgeo/osgeo4mac it defautls (looks for) the postgresql binary folder to install the symlinked (or not) extensions. Here again another compatibility problem. One could tinker a bit with homebrew files and transfer files manually. That's ill advice...the package manager (homebrew) needs to stay a coherent ecosystem to provide for a stable workspace.
Proposed Solution:
Go here BigSQL and download the dmg of your chosen version
install the software where you want in your filesystem
within the installation folder you'll find a directory named pg9x ; x being the version number (e.g pg95 for postgresql 9.5 and so on...
in this folder you'll find a file named pg9x.env
source this file to your .profile with source /your/path/pg9x/pg9x.env line
in the main installation folder, for instance /your/path/pg9x/, you'll finde a python script called pgc, alias it to your .profile with alias pgc="your/path/pgc"
save your .profile and refresh your environment variable with source .profile on the command prompt
still within the command prompt, type pgc list, you'll get a list of installed packages. You'll see the version of postgesql you've downloaded
to install another version of postgresql, say 9.6, type pgc install pg96
to install postgis for pg95 type pgc install postgis22-pg95
to install postgis for pg96 type pgc install postgis23-pg96
now, after installation you'll need to initialize the downloaded component with pgc init pg96 or pgc init postgis23-pg96 etc...
to check if your daemon is running correctly type pgc status
to start a version daemon of your choice type for example pgc start pg95
to stop a version daemon of your choice type pgc stop pg95
the installation also comes with an LTS release of pgadmin3 that works fine with all versions (not the case of brew version of pgadmin3), this is very convenient
type pgc help for more options
Let the elephant dance^^
Hope this helps.
Spicy.
I faced a similar issue and what worked for me was to follow the instructions at https://github.com/CloverHealth/homebrew-tap, which seem similar in spirit to #Antwan's solution but with a few more clean up steps, also it gets slightly later versions: postgresql 9.6.10 and postgis 2.5.
My steps differed slightly from those at CloverHealth: My brew version no longer supports brew switch postgresql 9.6.10 and I tried first brew link postgresql#9.6.10 and then brew link postgresql#9.6 but both gave
Error: no such keg
Trying brew search postgresql showed a little green checkmark next to the cloverhealth Formulae, so I tried brew link cloverhealth/tap/postgresql and got
Warning: Already linked: /usr/local/Cellar/postgresql/9.6.10
So, ok it was already linked. Other than that my steps were the same as described at the CloverHealth page, and now I'm up and running again.

GIT-SVN Issue on Mac

I am in the process of getting git-svn working on my Mac. I am currently on Lion (but I had similar results when testing on Snow Leopard. I seem to be one of the few people having this issue. This is different from the issue I see that some people had with just including SVN/Core.pm.
Below is an attempt to do a git svn clone on a vanille repository (obviously the host and directory details have been changed for posting):
Macbook-Pro:git david$ git svn clone https://somesite.com/SVN/someRepo/
Initialized empty Git repository in /Projects/git/MyWorkspace/.git/
Can't load '/System/Library/Perl/Extras/5.12/darwin-thread-multi-2level/auto/SVN/_Core/_Core.bundle' for module SVN::_Core: dlopen(/System/Library/Perl/Extras/5.12/darwin-thread-multi-2level/auto/SVN/_Core/_Core.bundle, 1): Library not loaded: /usr/lib/libsvn_client-1.0.dylib
Referenced from: /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level/auto/SVN/_Core/_Core.bundle
Reason: image not found at /System/Library/Perl/5.12/darwin-thread-multi-2level/DynaLoader.pm line 204.
at /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level/SVN/Base.pm line 59
BEGIN failed--compilation aborted at /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level/SVN/Core.pm line 5.
Compilation failed in require at /Developer/usr/libexec/git-core/git-svn line 58.
In my case, simply installing git via Macports solved my problem. I believe this problem was probably caused by older installs (maybe the Mac OS X Git Installer). If you are in this scenario, first install Macports:
http://www.macports.org/install.php
Then, once Macports is installed (with the correct version for your OS), then run:
sudo port install git-core +svn
After this, I just had to use the git at the new location installed by Macports:
/opt/local/bin/git
I modified my PATH variable so that this was the git used by default.
I took a slightly-different approach to this problem (as I am running a beta of XCode 4.2 as well):
Install the Collabnet Subversion package. I downloaded the OSX 10.7 version as I am running Lion on my Mac.
Create a symlink of all /opt/subversion/libsvn_* files in /usr/lib/
I spent a copious amount of time trying to get this fixed. None of the approaches above helped. What really fixed the issue was to remove the following line from my ~/.zshrc (.bash_profile, if you use bash.)
export VERSIONER_PERL_PREFER_32_BIT=yes;