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.
I am new to gitlab runners and trying to automate my project so that whenever a new tag is released, it should build a new deb package. PS: I am using mac and
following this official link by gitlab to get my task done
My first gitlab-ci.yml file was(which is just given there on the official link of gitlab I provided above):
# Is performed before the scripts in the stages step
before_script:
- source /etc/profile
# Defines stages which are to be executed
stages:
- build
# Stage "build"
run-build:
stage: build
script:
- apt-get install -y libncurses5-dev libglib2.0-dev libgeoip-dev libtokyocabinet-dev zlib1g-dev libncursesw5-dev libbz2-dev
- autoreconf -fvi
- cp COPYING debian/copyright
- dpkg-buildpackage -us -uc
- mkdir build
- mv ../goaccess*.deb build/
# This stage is only executed for new tags
only:
- tags
# The files which are to be made available in GitLab
artifacts:
paths:
- build/*
The problem I initially getting with the above gitlab-ci.yml file was:
Output 1:
Fetching changes with git depth set to 20...
Reinitialized existing Git repository in /home/gitlab-runner/builds/GJ7z2Aym/0/edge_release_management/.git/
Checking out 3d71402b as tag1-test...
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:00
$ source /etc/profile
$ apt-get install -y libncurses5-dev libglib2.0-dev libgeoip-dev libtokyocabinet-dev zlib1g-dev libncursesw5-dev libbz2-dev
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit status 1
which says E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
So to resolve the above issue, I thought to change the brefore_script part with this
# Is performed before the scripts in the stages step
before_script:
- source /etc/profile
- echo "Hello, $GITLAB_USER_LOGIN!"
- echo "Hello, $GITLAB_USER_PASSWORD"
# - sudo rm /var/cache/apt/archives/lock
# - sudo rm /var/lib/dpkg/lock
- sudo su
Where I am trying to remove /var/cache/apt/archives/lock and /var/lib/dpkg/lock, as this is what I found on Google. When it didn't work, I tried sudo su. But with the above change, I started to get this issue.
Output 2:
Getting source from Git repository
00:00
Fetching changes with git depth set to 20...
Reinitialized existing Git repository in /home/gitlab-runner/builds/GJ7z2Aym/0/edge_release_management/.git/
Checking out 7fbaaf4f as testing4...
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:00
$ source /etc/profile
$ sudo rm /var/cache/apt/archives/lock
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit status 1
It says sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper sudo: a password is required
So, to resolve this, I used sudo -S su < $password_secret as shown:
# Is performed before the scripts in the stages step
before_script:
- source /etc/profile
- echo "Hello, $GITLAB_USER_LOGIN!"
- echo "Hello, $GITLAB_USER_PASSWORD"
# - sudo rm /var/cache/apt/archives/lock
# - sudo rm /var/lib/dpkg/lock
# - sudo su
- sudo -S su < $password_secret
Please note: I have saved $password_secret in Gitlab variables and it's value is $password.secret as someone on google said this can be it's value. I am not sure how true it is.
And now it is giving me this error:
Output 3:
Fetching changes with git depth set to 20...
Reinitialized existing Git repository in /home/gitlab-runner/builds/GJ7z2Aym/0/edge_release_management/.git/
Checking out 0b8ab538 as 26...
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:02
$ source /etc/profile
$ echo "Hello, $GITLAB_USER_LOGIN!"
Hello, user!
$ echo "Hello, $GITLAB_USER_PASSWORD"
Hello,
$ sudo -S su < $password_secret
[sudo] password for gitlab-runner: Sorry, try again.
[sudo] password for gitlab-runner:
sudo: no password was provided
sudo: 1 incorrect password attempt
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit status 1
Please note: I have also used the way which is mentioned here
But, I found that usermod is not there for macOS. So I tried using another way which is mentioned here using dscl. But it still showing me the Output 3 only
Now I am fed up and unable to think of any other possible ways to fix this. I think I have tried almost everything released to this issue(which might not be true at all, as there must be some solution for this, I believe). Can anyone please help me with this?
Summary: Basically my main problem is shown in the first output which says E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?. Rest everything I am doing is to resolve it only.
I am new to gitlab runners and trying to automate my project so that whenever a new tag is released, it should build a new deb package. PS: I am using mac and
following this official link by gitlab to get my task done
My first gitlab-ci.yml file was(which is just given there on the official link of gitlab I provided above):
# Is performed before the scripts in the stages step
before_script:
- source /etc/profile
# Defines stages which are to be executed
stages:
- build
# Stage "build"
run-build:
stage: build
script:
- apt-get install -y libncurses5-dev libglib2.0-dev libgeoip-dev libtokyocabinet-dev zlib1g-dev libncursesw5-dev libbz2-dev
- autoreconf -fvi
- cp COPYING debian/copyright
- dpkg-buildpackage -us -uc
- mkdir build
- mv ../goaccess*.deb build/
# This stage is only executed for new tags
only:
- tags
# The files which are to be made available in GitLab
artifacts:
paths:
- build/*
The problem I initially getting with the above gitlab-ci.yml file was:
Output 1:
Fetching changes with git depth set to 20...
Reinitialized existing Git repository in /home/gitlab-runner/builds/GJ7z2Aym/0/edge_release_management/.git/
Checking out 3d71402b as tag1-test...
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:00
$ source /etc/profile
$ apt-get install -y libncurses5-dev libglib2.0-dev libgeoip-dev libtokyocabinet-dev zlib1g-dev libncursesw5-dev libbz2-dev
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit status 1
which says E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
So to resolve the above issue, I thought to change the brefore_script part with this
# Is performed before the scripts in the stages step
before_script:
- source /etc/profile
- echo "Hello, $GITLAB_USER_LOGIN!"
- echo "Hello, $GITLAB_USER_PASSWORD"
# - sudo rm /var/cache/apt/archives/lock
# - sudo rm /var/lib/dpkg/lock
- sudo su
Where I am trying to remove /var/cache/apt/archives/lock and /var/lib/dpkg/lock, as this is what I found on Google. When it didn't work, I tried sudo su. But with the above change, I started to get this issue.
Output 2:
Getting source from Git repository
00:00
Fetching changes with git depth set to 20...
Reinitialized existing Git repository in /home/gitlab-runner/builds/GJ7z2Aym/0/edge_release_management/.git/
Checking out 7fbaaf4f as testing4...
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:00
$ source /etc/profile
$ sudo rm /var/cache/apt/archives/lock
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit status 1
It says sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper sudo: a password is required
So, to resolve this, I used sudo -S su < $password_secret as shown:
# Is performed before the scripts in the stages step
before_script:
- source /etc/profile
- echo "Hello, $GITLAB_USER_LOGIN!"
- echo "Hello, $GITLAB_USER_PASSWORD"
# - sudo rm /var/cache/apt/archives/lock
# - sudo rm /var/lib/dpkg/lock
# - sudo su
- sudo -S su < $password_secret
Please note: I have saved $password_secret in Gitlab variables and it's value is $password.secret as someone on google said this can be it's value. I am not sure how true it is.
And now it is giving me this error:
Output 3:
Fetching changes with git depth set to 20...
Reinitialized existing Git repository in /home/gitlab-runner/builds/GJ7z2Aym/0/edge_release_management/.git/
Checking out 0b8ab538 as 26...
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:02
$ source /etc/profile
$ echo "Hello, $GITLAB_USER_LOGIN!"
Hello, user!
$ echo "Hello, $GITLAB_USER_PASSWORD"
Hello,
$ sudo -S su < $password_secret
[sudo] password for gitlab-runner: Sorry, try again.
[sudo] password for gitlab-runner:
sudo: no password was provided
sudo: 1 incorrect password attempt
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit status 1
Please note: I have also used the way which is mentioned here
But, I found that usermod is not there for macOS. So I tried using another way which is mentioned here using dscl. But it still showing me the Output 3 only
Now I am fed up and unable to think of any other possible ways to fix this. I think I have tried almost everything released to this issue(which might not be true at all, as there must be some solution for this, I believe). Can anyone please help me with this?
Summary: Basically my main problem is shown in the first output which says E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?. Rest everything I am doing is to resolve it only.
So i mistakenly deleted the freeradius directory in "/etc/freeradius/3.0" on Ubuntu 20.04. After re-installing version 3.0.23 from tar file in freeradius website. I noticed directory structure is totally different and main files are in "[/etc/freeradius/installation directory/etc/raddb]" instead of just "/etc/freeradius/3.0". But i can still run freeradius in debugmode and all but after doing some configurations on clients.conf file and restarting the server i get the error Job for freeradius.service failed because the control process exited with error code.
See "systemctl status freeradius.service" and "journalctl -xe" for details. and when i run the journalctl -xe command.I get the error.
freeradius error . But as i can see its looking for the radiusd.conf file in the wrong directory structure even thou i compiled and installed from source tar file.
Try this site:
https://phoenixnap.com/kb/uninstall-packages-programs-ubuntu#:~:text=To%20remove%20an%20application%2C%20highlight%20it%20%3E%20right-click,to%20Remove%20Package%20on%20Ubuntu%20From%20Command%20Line
I did the
dpkg-query -l | grep radius
Returned with:
rc freeradius 3.0.20+dfsg-3build1 amd64 high-performance and highly configurable RADIUS server
rc freeradius-common 3.0.20+dfsg-3build1 all FreeRADIUS common files
rc freeradius-config 3.0.20+dfsg-3build1 amd64 FreeRADIUS default config files
Then for each of the three I did
apt-get remove --purge freeradius
apt-get remove --purge freeradius-common
apt-get remove --purge freeradius-config
Then
apt install freeradius freeradius-mysql freeradius-utils
And the default directories returned in the /etc/freeradius/3.0/ directory.
Happy I am!
I am having a problem while trying to decrypt some keys using GPG. The following output is given to me:
gpg: can't connect to the agent: IPC connect call failed
I already edited some files, pointed in this tutorial: https://michaelheap.com/gpg-cant-connect-to-the-agent-ipc-connect-call-failed/ but with no success.
Possible reasons for that?
Even I had the above issue in Ubuntu 20 WSL, I tried all the below | above suggestions, but none worked for me.
root#7400-9888K13:/mnt/c/Users/PKammari# wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
gpg: can't connect to the agent: IPC connect call failed
What did I do to resolve the issue?
remove gpg
install other version of gpg.
How do I do it?
apt remove gpg ( follow the instructions)
apt install gnupg1 (follow the instructions)
Option 2.
sudo apt update --y
`sudo apt remove gpg`
`sudo apt-get update -y`
`sudo apt-get install -y gnupg1`
Proof. (refer to the screenshot):
There is probably already a gpg-agent running on the system, which your gpg command is unable to connect to.
If you do a pkill -9 gpg-agent and then source <(gpg-agent --daemon) to restart the agent, you should be able to connect to the pinentry-curses for inputting your password.
In my case the agent wasn't even started. This is what I did to resolve:
C:\Program Files (x86)\gnupg\bin>gpg-connect-agent -v
gpg-connect-agent: no running gpg-agent - starting 'C:\Program Files (x86)\gnupg\bin\gpg-agent.exe'
gpg-connect-agent: waiting for the agent to come up ... (5s)
gpg-connect-agent: connection to agent established
> ^Z
Afterwards the commands to the agent started working.
To hopefully add to preetam's excellent answer above for those very new to this.
To install gnupg1 - if you get the error "Package gnupg1 is not available, but referenced....."
sudo apt remove gpg
sudo apt-get update -y
sudo apt-get install -y gnupg1
For me, previous responses worked, but partially, what made the magic in my case was a combination of all, see the commands below.
If you get error add-apt-repository: command not found, then, install package software properties common.
sudo apt remove gpg
sudo apt-get update -y
sudo apt-get install -y gnupg1
# In case of Error when adding "ppa" with message: add-apt-repository: command not found
sudo apt-get install software-properties-common
# Now, the hack
sudo add-apt-repository ppa:rafaeldtinoco/lp1871129
sudo apt update
wget https://launchpad.net/~rafaeldtinoco/+archive/ubuntu/lp1871129/+files/libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb
sudo dpkg --install libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb
sudo apt-mark hold libc6 #to avoid further update
# Edit: /var/lib/dpkg/info/libc6:amd64.postinst and remove the sleep 1 that is in nearly the last line.
apt-get install -y gnupg gnupg1
cp -a /usr/bin/gpg /usr/bin/gpg2
ln -sf /usr/bin/gpg1 /usr/bin/gpg
apt-key worked for me after executing those commands.
I'm WSL 2.0 with Ubuntu 20.04 (Windows 10 Build 2004).
Reason:
uninstalling gnupg (2.x) also uninstalls gpg-agent, which is required.
installing gnupg1 (1.x) will install only gpg binary, not gpg-agent.
Both are required to work, but we want gnupg1 (1.x) to be the default "gpg" command (despite working with 2.x support-tools).
Based upon other behaviors in my Windows 10 system and through experimentation, I believe sometimes Windows Defender blocks gpg-agent from running because of a Windows Defender bug that slows the system trying to access low-level CPU counters.
Read Windows Defender can Significantly Impact Intel CPU Performance, We have the Fix. Work around the issue by downloading Counter Control from TECHPOWERUP and clicking "Reset Counters" when this problem arises. (See below.)
In my case I would frequently get the following error while trying to sign JAR files for deployment to Maven Central.
gpg: can't connect to the gpg-agent: IPC connect call failed
gpg: keydb_search failed: No agent running
gpg: skipped "…": No agent running
gpg: signing failed: No agent running
Sometimes if I kept trying over and over and over, eventually it would succeed.
Based on other answers, when this happened I trying manually connecting to the gpg-agent, but even that would time out:
> gpg-connect-agent --verbose
gpg-connect-agent: no running gpg-agent - starting 'C:\\Program Files (x86)\\GnuPG\\bin\\gpg-agent.exe'
gpg-connect-agent: waiting for the agent to come up ... (5s)
gpg-connect-agent: waiting for the agent to come up ... (4s)
gpg-connect-agent: waiting for the agent to come up ... (3s)
gpg-connect-agent: waiting for the agent to come up ... (2s)
gpg-connect-agent: waiting for the agent to come up ... (1s)
gpg-connect-agent: can't connect to the gpg-agent: IPC connect call failed
gpg-connect-agent: error sending standard options: No agent running
Because I've been experiencing similar slowdown issues on my machine seemingly related to Windows Defender, I ran "Counter Control" and sure enough, it showed that Windows Defender was maxing out the counter access as described in the article above. (Image embedded from the article.)
I tried to manually connect to gpg-agent again, but this time I hit "Reset Counters" in the utility just as gpg-connect-agent was retrying. When I did this, it immediately connected!
> gpg-connect-agent --verbose
gpg-connect-agent: no running gpg-agent - starting 'C:\\Program Files (x86)\\GnuPG\\bin\\gpg-agent.exe'
gpg-connect-agent: waiting for the agent to come up ... (5s)
gpg-connect-agent: connection to the agent established
This seems unlikely to be a coincidence that it would connect at just the moment I reset the counters. Moreover Windows Defender has been causing other slowdown problems on my machine.
I believe that buggy behavior of Windows Defender is causing this problem on my machine. Please investigate and report if you can reproduce this workaround. (Note that, as per the article, this problem only affects certain generations of Intel CPUs.)
Update: Upon further testing, I'm still getting can't connect to the gpg-agent even if I've already reset counters to prevent Windows Defender from hogging the CPU as explained above. For some reason I normally still have to manually run gpg-connect-agent. Now it may be that resetting the counters while gpg-agent was trying to connect allowed it to connect. And it could still be be that Windows Defender is stopping gpg-agent from connecting when my system starts up. But at this moment all I know is that 1) gpg-agent isn't starting up automatically, 2) I have to run gpg-connect-agent manually, and 3) even running gpg-connect-agent will time out unless I reset the CPU counters to stop Windows Defender from hogging the CPU.
Mine is a windows machine, and when I do git commit I get the following message. I have already configured gpg keys on my machine.
gpg: can't connect to the gpg-agent: IPC connect call failed
gpg: keydb_search failed: No agent running
gpg: skipped "BBB42EB62E25E8EB33AE2E65F40A504840B1C66B": No agent running
gpg: signing failed: No agent running
error: gpg failed to sign the data
fatal: failed to write commit object
Will Buffington answer worked for me.
I had to apply the command
gpg-connect-agent -v
repeatedly as shown below. And it worked in the third attempt.
Once the I get the message connection to agent established, I now ran the commit command again. Now its successful. Note the -S flag to sign my commits.
Update
This morning, it did not start even after 3 attempts. I had to double click the exe from its installed location.
I had the same problem. In my case, the gpg config files were somehow corrupted. To solve it, I have removed all the configurations inside ~/.gnupg (make sure to backup any keys that you still need). Then I have reinstalled gpg and everything worked well.
On WSL1 Ubuntu 20.04 following workaround available: https://github.com/microsoft/WSL/issues/5125#issuecomment-619097534
sudo add-apt-repository ppa:rafaeldtinoco/lp1871129
sudo apt update
sudo apt install libc6=2.31-0ubuntu8+lp1871129~1 -y
sudo apt-mark hold libc6
I had to use:
sudo apt autoremove gpg gnupg1 gnupg2
In windows subsystem Ubuntu 20 works these steps:
sudo apt remove gpg
sudo apt-get update -y
sudo apt-get install -y gnupg1
After that steps appear "Ok"
I had the same problem when I killed the agent. It was not able to connect to agent again. So I had to remove all gpg gpg-related packages, and reinstall. I had to remove gpg-agent as well.
so what I did
sudo apt remove gpg gpg-agent
sudo apt-get install -y gpg
I was able to connect without installing new software. In my case the issue was that the IPC file wasn't in the expected position.
Check if gpg-agent with ps -eaf | grep gpg is running and kill it if it is running with killall gpg-agent
Start gpg-agent with verbose
$ gpg-agent --daemon -v
...
GPG_AGENT_INFO=/tmp/.../S.gpg-agent; export GPG_AGENT_INFO
copy-paste the GPG_AGENT_INFO line, including the export, in the shell where you need the agent.