How do I find out which version of Sensu I am using on linux box? - sensu

Is there a command I can type in linux that will show the current version of Sensu that is installed?

dpkg -s sensu worked for me (linux, used apt-get to install)

You haven't mentioned how you installed it or on what kind of OS you are so this might be a very general answer.
In CentOS/RHEL family OS you can use yum info sensu provided that you used yum to install it.
In Ubuntu you can use dpkg -s | grep <pkg_name>

Related

Cannot load VSCode

I cannot load VSCOde onto my old Toshiba laptop using Fedoa23. I follow the instructions from the web and finally get the message "No package code availale". I have previously installes VSCode on an old computer using Fedora23 but this time it does not work? Where do I go wrong?
Thanks.
Don't know, but this works for me.
You can use these step to install VSCode:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
Then update the package cache and install the package using dnf (Fedora 22 and above):
dnf check-update
sudo dnf install code
Or on older versions using yum:
yum check-update
sudo yum install code

Installing PostgreSQL Client v10 on AWS Amazon Linux (EC2) AMI

I have successfully launched new AWS RDS PostgreSQL v10 instance and need to install PostgreSQL v10 client on Amazon Linux EC2 instance.
I have tried to install it with yum, but it cant find the package for v10:
[ec2-user#ip-X-X-X-X ~]$ sudo yum install -y postgresql10
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main | 2.1 kB 00:00:00
amzn-updates | 2.5 kB 00:00:00
No package postgresql110 available.
Error: Nothing to do
Previously I managed to install PostgreSQL client v9.5 with:
[ec2-user#ip-X-X-X-X ~]$ sudo yum install -y postgresql95
I guess I need to add Postgres yum repository, as mentioned in https://www.postgresql.org/download/linux/redhat/. But what Platform should I choose for Amazon Linux? Red Hat?
You can try to run the following command on your Linux server:
sudo amazon-linux-extras install postgresql10
Packages/Repos which is designed to work of RedHat will work on Amazon Linux also, Amazon Linux is a minimal-install version of RHEL. You may run into compatibility issues if you select old version of Amazon Linux (Amazon linux 1) for the below steps, otherwise it should work fine in the latest version Amazon Linux 2.
Check Amazon Linux version
[ec2-user ~]$ cat /etc/system-release
Amazon Linux release 2.0 (2017.12) LTS Release Candidate
Install RHEL 7 yum repo for PostgreSQL
[ec2-user ~]$ sudo yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-redhat10-10-2.noarch.rpm
[ec2-user ~]$ sudo sed -i "s/rhel-\$releasever-\$basearch/rhel-latest-x86_64/g" "/etc/yum.repos.d/pgdg-10-redhat.repo"
Install PostgreSQL Client v10
[ec2-user ~]$ sudo yum install -y postgresql10
[ec2-user ~]$ psql --version
psql (PostgreSQL) 10.3
Read more about Amazon Linux 2
Note! Amazon Linux 2 provides additional package installation through Amazon Linux Extras Repository (amazon-linux-extras) ((client only)). Since postgresql10 is not yet available, adding extra yum repo is the only solution per today.
UDATE 2019May
those who see
Error: Package: pgdg-redhat-repo-42.0-4.noarch
(/pgdg-redhat-repo-latest.noarch)
Requires: /etc/redhat-release
may still install step by step all dependencies and the server with:
yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-latest-x86_64/postgresql10-libs-10.7-2PGDG.rhel7.x86_64.rpm
yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-latest-x86_64/postgresql10-10.7-2PGDG.rhel7.x86_64.rpm
yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-latest-x86_64/postgresql10-server-10.7-2PGDG.rhel7.x86_64.rpm
Since none of the previous answers worked for me, I'm adding a solution that let me install the postgresql10 client. We're using VERSION="2018.03" of Amazon Linux AMI in our pipelines.
Building from source:
Note: The link below points to postgresql 10.4, you may want to check for newer subversions
sudo yum install -y gcc readline-devel zlib-devel
wget https://ftp.postgresql.org/pub/source/v10.4/postgresql-10.4.tar.gz
tar -xf postgresql-10.4.tar.gz
cd postgresql-10.4
./configure
make -C src/bin
sudo make -C src/bin install
make -C src/include
sudo make -C src/include install
make -C src/interfaces
sudo make -C src/interfaces install
make -C doc
sudo make -C doc install
The new package should be installed with all its executables in here: /usr/local/pgsql/bin
Now, keep in mind that commands psql, pg_dump etc. still point to the old version of the psql client. You can run with the full executable paths (/usr/local/pgsql/bin/psql) or prepend the new directory at the beginning of your $PATH so that the system will look it up first:
Edit ~/.bash_profile adding this at the end:
export PATH="/usr/local/pgsql/bin:$PATH"
Then run:
source ~/.bash_profile
Now everything should be ready:
[ec2-user#ip-xx-x-x-xxx ~]$ psql --version
psql (PostgreSQL) 10.4
Adapting Haneef Mohammed's answer for Amazon Linux 1 (tested on 2018.03):
Go to the Postgres repositories page and grab the URL for 'Red Hat Enterprise Linux 6 - x86_64'. Install the PG repos and amend the entries, replacing '$releasever' with '6.9' (or newer?):
[ec2-user ~]$ sudo yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-6-x86_64/pgdg-redhat10-10-2.noarch.rpm
[ec2-user ~]$ sudo sed -i "s/rhel-\$releasever-\$basearch/rhel-6.9-x86_64/g" "/etc/yum.repos.d/pgdg-10-redhat.repo"
Second part is the same:
[ec2-user ~]$ sudo yum install -y postgresql10
[ec2-user ~]$ psql --version
psql (PostgreSQL) 10.3
PGDG repo is no longer available for Amazon Linux. So you can use amazon repo.
amazon-linux-extras install postgresql10 vim epel -y
Or follow this article
https://installvirtual.com/install-postgresql-10-on-amazon-ec2/
As of May 25th, 2019, the following direct RPM installation worked for me on Amazon Linux 1 2018.03 (latest Beanstalk platform version) to install PostgreSQL Client 10.7:
sudo rpm -ivh --force https://yum.postgresql.org/testing/10/redhat/rhel-6-x86_64/postgresql10-libs-10.7-2PGDG.rhel6.x86_64.rpm
sudo rpm -ivh --force https://yum.postgresql.org/testing/10/redhat/rhel-6-x86_64/postgresql10-10.7-2PGDG.rhel6.x86_64.rpm
PSql10.7 installation (08/20/2019)
Remove all of the older version Psql client and perform the below steps:
wget https://yum.postgresql.org/10/redhat/rhel-6.9-x86_64/postgresql10-libs-10.7-1PGDG.rhel6.x86_64.rpm
wget https://yum.postgresql.org/10/redhat/rhel-6.9-x86_64/postgresql10-10.7-1PGDG.rhel6.x86_64.rpm
sudo rpm -ivh postgresql10-libs-10.7-1PGDG.rhel6.x86_64.rpm
sudo rpm -ivh postgresql10-10.7-1PGDG.rhel6.x86_64.rpm
This my 2019 solution:
Just do
sudo amazon-linux-extras install postgresql9.6
You should not have to download it from any outside source, since it is already given to you by default from Amazon, all you have to do is install it.
The other solutions didnt work for me and I spent a good amount time banging my head against the wall trying to figure out why.
And surprisingly even though you install psql9.6 you get version 10.
The following works for psql v11 on Amazon Linux (v1)
wget https://yum.postgresql.org/11/redhat/rhel-6.9-x86_64/postgresql11-libs-11.8-1PGDG.rhel6.x86_64.rpm
wget https://yum.postgresql.org/11/redhat/rhel-6.9-x86_64/postgresql11-11.8-1PGDG.rhel6.x86_64.rpm
sudo yum clean all
sudo rpm -ivh postgresql11-libs-11.8-1PGDG.rhel6.x86_64.rpm
sudo rpm -ivh postgresql11-11.8-1PGDG.rhel6.x86_64.rpm
The way I resolved the issue was by running
yum clean all
before
yum install -y postgresql10
on Amazon Linux
for v11 on Amazon Linux 2 I had to do
yum -y install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm
sed -i "s/rhel-\$releasever-\$basearch/rhel-7-x86_64/g" "/etc/yum.repos.d/pgdg-11-centos.repo"

Uninstall older unixODBC completely and install 2.3.2 unixODBC in redhat 6.3

I am trying to install msodbcsql v13 in redhat 6.3. It shows dependency error for unixODBC(64 bit) >= 2.3.1 needs to be installed before installing msodbcsql.
I tried running below command,
odbcinst -j
It shows unixODBC 2.3.2 is installed.
Also i tried to some other way,
yum provides /usr/lib64/odbcinst.so.2.0.0
The above command shows, ODBC version 2.2 is installed.
Also if i run yum local install, it shows unixODBC 32 bit version available in machine.
To remove unixODBC, i tried the below commands. But not works out.
yum remove unixODBC
yum erase unixODBC
rpm -e unixODBC*
rpm rpm -qa | grep unixODBC
I want to remove all unixODBC available in the machine. And reinstall the actual version which we required.
Manual Installation
Remove any older installed version of unixODBC (for example, unixODBC 2.2.11). On Red Hat Enterprise Linux 5 or 6, execute the following command: yum remove unixODBC. On SUSE Linux Enterprise, zypper remove unixODBC.
Go to http://www.unixodbc.org. Click the Download link on the left side of the page to go to the download page. Then click the appropriate link to save the file unixODBC-2.3.0.tar.gz to your computer. UnixODBC-2.3.1 is not supported with this release of the Microsoft ODBC Driver 11 for SQL Server.
On your Linux computer, execute the command: tar xvzf unixODBC-2.3.0.tar.gz.
Change to the unixODBC-2.3.0 directory.
At a command prompt, execute the command: CPPFLAGS="-DSIZEOF_LONG_INT=8".
At a command prompt, execute the command: export CPPFLAGS.
At a command prompt, execute the command: "./configure --prefix=/usr --libdir=/usr/lib64 --sysconfdir=/etc --enable-gui=no --enable-drivers=no --enable-iconv --with-iconv-char-enc=UTF8 --with-iconv-ucode-enc=UTF16LE".
At a command prompt (logged in as root), execute the command: make.
At a command prompt (logged in as root), execute the command: make install.
For additional info - visit the site
To remove all unixODBC related packages, run:
sudo yum remove unixODBC*
To install newer version of unixODBC, try to install unixODBC-utf16 package.
Here are the suggested commands:
curl -s https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/msprod.repo
sudo yum update
sudo yum info unixODBC*
sudo yum install unixODBC-utf16
See also: Install the SQL Server command-line tools on Linux.
If above won't help, check: How to install Microsoft Drivers for PHP for SQL Server on Amazon Linux AMI.

How to start IDLE that comes with Python 3.6

I am using Linux Mint 18. I installed Python 3.5 and 3.6 using apt-get in the terminal. I can open IDLE of Python 2.7 and 3.5 using commands idle and idle3 respectively. How can I access IDLE that comes with Python 3.6?
Try the command idle3.6. python3 and idle3 are still associated with your system Python, which is 3.5.
Simply typing in idle3.6 should work just like carusot42 mentioned. If it doesn't work, perhaps you might want to see if everything else is installed correctly. Here are the steps I followed which worked perfectly fine for me. I am also running Linux Mint 18. The steps that I followed were:
Installed the prerequisites of Python. Do that by typing in the following commands -
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
Download Python using the following command and extract it (use your desired location) -
cd /usr/src
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
sudo tar xzf Python-3.6.0.tgz
The next step is to compile Python source. To do that type in the commands below-
cd Python-3.6.1
./configure
sudo make altinstall
make altinstall is used to prevent replacing the default Python binary
file /usr/bin/python
You should be good to go. You check your Python version by typing python3.6 -V in the terminal.
Once you do that, type in idle3.6 and then Python 3.6.1 shell should open for you.
The Software Manager in Linux Mint lists the Python Packages and IDLE Packages
separately. After you install Python, go look up the associated IDLE package in the Software Manager and install it. Reboot and it should work fine. It worked for me.

libicuuc.so.55: cannot open shared object file

While am compile using swift build, am getting following error in my Ubuntu machine
$swift build
/home/xxxxxxxxx/Downloads/swift-DEVELOPMENT-SNAPSHOT-2016-02-25-a-ubuntu15.10/us
r/bin/swift-build: error while loading shared libraries: libicuuc.so.55: cannot
open shared object file: No such file or directory
How can i fix this issue?
Thanks.
You can manually download the good .dep
wget http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu55_55.1-7_amd64.deb
Then you run:
sudo dpkg -i libicu55_55.1-7_amd64.deb
If it miss some dependency:
sudo apt-get -f install
It has worked for me.
Your can find the other architecture on the debian package website :
https://packages.debian.org/sid/libicu55
p.s: I know this is on SID, but this is the only version that I found
*note...packages may have been removed
Your system lacks a critical component for building Swift, libicu-dev.
Install this:
sudo apt-get install libicu-dev
But that was for building Swift from source. You were talking about building with Swift, my apologies.
Unfortunately it seems it won't work either: Swift for Linux only officially runs on Ubuntu 15.10 and 14.04, and you tell me in the comments that you're running 15.04.
I know there's tutorials on the web on how to make it work on Mint and other distros... But the best would be, if possible, that you update your install of course.
I searched on the net and find a list in debian packages that shows the libicuuc.so.55 file.
apt-get install libicu55
Will resolve the issue.
hallow_me's link to download libicu55_55.1-7_amd64.deb doesn't work.
Here are the latest links https://packages.debian.org/stretch/amd64/libicu57/download
Like
wget http://ftp.us.debian.org/debian/pool/main/i/icu/libicu55_55.1-7_amd64.deb
Then follow hallow_me's instruction to install it.
Try the followings lines
echo "deb http://security.ubuntu.com/ubuntu xenial-security main" | sudo tee --append /etc/apt/sources.list
sudo apt-get update
sudo apt-get install libicu55