"How to fix 'mosquitto package' errors " on Amazon Linux - amazon-ec2

I am preferring this [link1] AWS doc to bridge my RPi3 as mqtt-IoT gateway with AWS IoT core.
But got these errors.
Error: Package: mosquitto-1.5.8-1.el7.x86_64 (epel)
Requires: libsystemd.so.0()(64bit)
Error: Package: mosquitto-1.5.8-1.el7.x86_64 (epel)
Requires: libsystemd.so.0(LIBSYSTEMD_209)(64bit)
Error: Package: mosquitto-1.5.8-1.el7.x86_64 (epel)
Requires: systemd
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
And I can't use "mosquitto" command after logged into Amazon Linux AMI. How to remove these errors?
I have already used thses two options.
--skip-broken
rpm -Va --nofiles --nodigest
But they didn't work for me.
I have also installed mosquitto package in my RPi3 board.
pi#rpi3:~ $ mosquitto -v
1558004586: mosquitto version 1.4.10 (build date Wed, 13 Feb 2019 00:45:38 +0000) starting
1558004586: Using default config.
1558004586: Opening ipv4 listen socket on port 1883.
1558004586: Error: Address already in use
It is working in it locally. But can't make a bridge with AWS.
In short in that whole doc, Due to mosquiotto package issue, only these two commands are not working properly for me.
sudo yum install mosquitto mosquitto-clients
sudo mosquitto -c /etc/mosquitto/conf.d/bridge.conf –d

Related

Error when trying to run Memgraph under Ubuntu on WSL: "System has not been booted with systemd as init system (PID 1). Can't operate."

My setup is Windows 11 with WSL2 and Ubuntu 22.04.1 LTS (GNU/Linux 5.15.79.1-microsoft-standard-WSL2 x86_64). I'm following the instructions for installing Memgraph on Ubuntu
but I keep getting the error:
mike#wks1:~$ wget https://download.memgraph.com/memgraph/v2.5.1/ubuntu-22.04/memgraph_2.5.1-1_amd64.deb
--2023-01-27 09:26:51-- https://download.memgraph.com/memgraph/v2.5.1/ubuntu-22.04/memgraph_2.5.1-1_amd64.deb
Resolving download.memgraph.com (download.memgraph.com)... 172.67.130.22, 104.21.7.96, 2606:4700:3034::6815:760, ...
Connecting to download.memgraph.com (download.memgraph.com)|172.67.130.22|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 17578738 (17M) [application/x-www-form-urlencoded]
Saving to: ‘memgraph_2.5.1-1_amd64.deb’
memgraph_2.5.1-1_amd64.deb 100%[=================================================>] 16.76M 18.3MB/s in 0.9s
2023-01-27 09:26:52 (18.3 MB/s) - ‘memgraph_2.5.1-1_amd64.deb’ saved [17578738/17578738]
mike#wks1:~$ sudo dpkg -i memgraph_2.5.1-1_amd64.deb
[sudo] password for mike:
Selecting previously unselected package memgraph.
(Reading database ... 24112 files and directories currently installed.)
Preparing to unpack memgraph_2.5.1-1_amd64.deb ...
Unpacking memgraph (2.5.1-1) ...
Setting up memgraph (2.5.1-1) ...
Don't forget to switch to the 'memgraph' user to use Memgraph
......+.....+.+........+......+...+...+.......+......+......+.........+.........+...+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*......+...+...+...+............+...+.......+...+...........+...+.+.........+...+...+...........+...+.......+...............+...+.....+......+.+...+......+..+...............+.............+..+....+...+.....+.+.....+.......+..............+.+...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..+.+........+......+.+........+............+.............+.............................+......+..........+......+......+........+......+...............+..........+...........+.........+...+.......+.....+...+................+.....+..........+......+....................+.+............+................................+...+.+..............+.+.....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
..............+..+......+....+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*...+....+.....+.......+............+...+........+.......+........+.........+...+...+.+.....+.............+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.+..+..........+...+......+...........+....+...............+.....+...+.......+.....+...+..........+...+............+........+.......+.....+.+.........+..+...+.+.....+..........+..+.........+............................+..+.+.....+........................+.+................................+...+...+.+........+.......+.........+.....+.+...+...........+............+.......+..+.+..+................+.........+......+...........+.+..+.............+..+.+..+........................+....+..+.......+........+....+........+.......+......+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
Created symlink /etc/systemd/system/multi-user.target.wants/memgraph.service → /lib/systemd/system/memgraph.service.
mike#wks1:~$ sudo journalctl --unit memgraph
No journal files were found.
-- No entries --
mike#wks1:~$ sudo systemctl start memgraph
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
I've tried all of the tips that I got by Googling, but non of them didn't work. When I dual boot into Ubuntu, I have no problems. What am I going wrong?
The procedure for installing Memgrap using WSL and Ubuntu is different than installing Memgraph directly onto Ubuntu. There is a notice in your output that says Don't forget to switch to the 'memgraph' user to use Memgraph.
The command for running Memgraph under WSL is:
sudo runuser -l memgraph -c '/usr/lib/memgraph/memgraph'
Take a look at the documentation on how to install MemgraphDB on Windows with WSL.

Visual Studio install issue

Trying to install the RHEL version of Visual Studio on one of my RHEL 7 Linux boxes.
Installation instructions state:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
I receive the following when doing so:
[root#desectlas014 ~]# rpm --import https://packages.microsoft.com/keys/microsoft.asc
curl: (7) Failed connect to packages.microsoft.com:443; Connection timed out error: https://packages.microsoft.com/keys/microsoft.asc: import read
failed(2).
Can you describe what the issue is?
Thanks
The reason of this message is your computer can't reach the host packages.microsoft.com on port 443
I meet the same problem, and didn't find out the reason. However, you can do a workaroud.
wget https://packages.microsoft.com/keys/microsoft.asc
rpm --import microsoft.asc

Azure VM with Docker failing to connect

I'm trying to write a Powershell script to create a VM in Azure with Docker installed. From everything I've read, I should be able to do the following:
$image = "b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04_3-LTS-amd64-server-20150908-en-us-30GB"
azure vm docker create -e 22 -l 'North Europe' --docker-cert-dir dockercert --vm-size Small <myvmname> $image $userName $password
docker --tls -H tcp://<myvmname>.cloudapp.net:4243 info
The vm creation works, however the docker command fails with the following error:
An error occurred trying to connect: Get https://myvmname.cloudapp.net:4243/v1.20/info: dial tcp 40.127.169.184:4243: ConnectEx tcp: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Some articles I've found refer to port 2376 - but that doesn't work either.
Logging onto Azure portal and viewing the created VM - the Docker VM Extension doesn't seem to have been added and there's no endpoints other than the default SSH one. I was expecting these to have been created by the azure vm docker create command. Although I could be wrong with that bit.
A couple of example article I've looked at are here:
https://azure.microsoft.com/en-gb/documentation/articles/virtual-machines-docker-with-xplat-cli/
http://blog.siliconvalve.com/2015/01/07/get-started-with-docker-on-azure/
However, there's plenty of other articles saying the same thing.
Does anyone know what I'm doing wrong?
I know you are doing nothing wrong. My azurecli-dockerhost connection had been working for months and failed recently. I re-created my docker host using "azure vm docker create" but it does not work any more.
I believe it is a bug that the azure-docker team has to fix.
For the time being, my solution is to:
1) Launch a Ubuntu VM WITHOUT using the Azure docker extension
2) SSH into the VM and install docker with these lines:
sudo su; apt-get -y update
apt-get install linux-image-extra-$(uname -r)
modprobe aufs
curl -sSL https://get.docker.com/ | sh
3) Run docker within this VM directly without relying on a "client" and in particular the azure cli.
If you insist on using the docker client approach, my alternative suggestion would be to update your azure-cli and try 'azure vm docker create' again. Let me know how it goes.
sudo su
apt-get update; apt-get -y install nodejs-legacy; apt-get -y install npm; npm install azure-cli --global
To add an additional answer to my question, it turns out you can do the same using the docker create command ...
docker-machine create $vmname --driver azure --azure-publish-settings-file MySubscription.publishsettings
This method works for me.

lxc-attach failed to enter the namespace - EC2 Instances

For some reason I cannot enter a docker container using Lxc-attach only on EC2 instances. This works on my local machine and on Digital Ocean (KVM) droplets but not on Amazon EC2 xen-paravirtualized Ubuntu12.04 instance. Here are the steps/errors:
root#ip-172-31-46-202:~/scalar/project/docker# lxc-ls
4074ebf985cfe09b2880a9eabbc7ad3e59283f425f64cfaa72f59f1f23661d18
root#ip-172-31-46-202:~/scalar/project/docker# lxc-attach -n 4074ebf985cfe09b2880a9eabbc7ad3e59283f425f64cfaa72f59f1f23661d18
lxc-attach: No such file or directory - failed to open '/proc/19731/ns/pid'
lxc-attach: failed to enter the namespace
Does anyone know if there is a way to resolve this issue? Here are my docker version details:
Client version: 0.7.6
Go version (client): go1.2
Git commit (client): bc3b2ec
Server version: 0.7.6
Git commit (server): bc3b2ec
Go version (server): go1.2
Last stable version: 0.7.6
Also:
lxc version: 0.7.5
What is your kernel version?
lxc-attach requires features that are not present in the native 12.04 kernel (3.5). You need at least 3.8 which IIRC is available in the backport.
As Creac suggested, the kernel was not of a high enough version. (and if I try re-deploying an AWS ubuntu image it still uses kernel 3.2)
To fix this issue, I ran the following command to get 3.8:
sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
or you can run the following command to get 3.5
sudo apt-get install linux-image-generic-lts-quantal linux-headers-generic-lts-quantal
Please note that these commands are Ubuntu specific (as per the question) and will install the "generic" kernel rather than the "virtual" kernel, but should work. [source]
Note that I tried to update Creac's original answer with this additional information but the edit was rejected so I felt the need to create a new answer for others to use if they want.
source of where I found the commands

knife-windows: Network Error: getaddrinfo: Name or service not known (windows:22)

I have an Ubuntu workstation and i'm trying to bootstrap a windows node. The windows node has ssh open on port 2222. I've been following http://docs.opscode.com/plugin_knife_windows.html.
ateetor#ateetor-virtual-machine:~/chef/chef-repo$ sudo gem install knife-windows --http-proxy=[REMOVED]
Successfully installed knife-windows-0.5.12
1 gem installed
Installing ri documentation for knife-windows-0.5.12...
Installing RDoc documentation for knife-windows-0.5.12...
ateetor#ateetor-virtual-machine:~/chef/chef-repo$ sudo knife bootstrap windows ssh 10.29.3.114 -x chef -P SSHuser1! -N test -p 2222 -VV
DEBUG: Looking for bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/bootstrap
DEBUG: Found bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/bootstrap
Bootstrapping Chef on windows
DEBUG: Adding windows
DEBUG: establishing connection to windows:2222
ERROR: Network Error: getaddrinfo: Name or service not known
Check your knife configuration and network settings
To me what that looks like is it's trying to use the word windows as part of the IP; however my syntax matches the guide so i don't know why. Does anyone have any ideas on how to fix this?
If you look at the output it's running the generic bootstrap template.
Looking for bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/bootstrap
Most likely there is an installation or ruby environment issue resolving the knife-windows gem.
When correctly configured you should see:
Looking for bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/knife-windows-0.5.12/lib/chef/knife/bootstrap
The only fix I have found is to use knife from a windows workstation instead of a linux one.
knife bootstrap windows winrm 111.22.33.44.compute-1.amazonaws.com -x Administrator -P "asdklfj329" -N "windows-2008-551"
Enjoy :)
I have faced the similar issue.One of the reasons for this might be you knife-windows gem package is not installed in expected location.
knife-windows resolves target hostname ,if its not properly installed winrm knife cant resolve targetname.So to overcome this install knife-windows as below
To install the knife windows plugin using RubyGems, run the following command:
$ /opt/chef/embedded/bin/gem install knife-windows
if properly installed you should be able to find knife-windows at
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/

Resources