GPG Error Updating Ubuntu/Debian Packages - linux

I am attempting to update my Ubuntu/Debian system and I am getting an error:
GPG error: http://deb.opera.com stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E585066A30C18A2B
What does it mean, and how can I resolve it?

Try following approach, is from there
The error NO_PUBKEY E585066A30C18A2B is the key for the Opera web
browser. To correct the error, run the following code.
wget -O - http://deb.opera.com/archive.key | apt-key add -

sudo wget -O - http://deb.opera.com/archive.key | apt-key add
--2016-09-24 09:42:48-- http://deb.opera.com/archive.key
Resolving deb.opera.com (deb.opera.com)... 185.26.183.130
Connecting to deb.opera.com (deb.opera.com)|185.26.183.130|:80... connected.
HTTP request sent, awaiting response... ERROR: This command can only be used by root.
200 OK
Length: 3152 (3,1K) [application/pgp-keys]
Saving to: ‘STDOUT’
- 0%[ ] 0 --.-KB/s in 0s
Cannot write to ‘-’ (Broken pipe).

Newer versions of apt also support
apt-key adv --fetch-keys https://deb.opera.com/archive.key
instead of
wget -qO - https://deb.opera.com/archive.key | apt-key add -
Additionally, you should always use https when loading the key.

Related

Why NGINX signature could not be verified? The following signatures couldn't be verified because the public key is not available

I tried
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
got error
W: GPG error: http://nginx.org/packages/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62
I added pub key still get the same
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ABF5BD827BD9BF62
Didn't help also
wget https://nginx.org/keys/nginx_signing.key -O - | sudo apt-key add -
--2022-05-10 08:02:28-- https://nginx.org/keys/nginx_signing.key
Resolving nginx.org (nginx.org)... 52.58.199.22, 3.125.197.172, 2a05:d014:edb:5702::6, ...
Connecting to nginx.org (nginx.org)|52.58.199.22|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1561 (1.5K) [application/octet-stream]
Saving to: ‘STDOUT’
Why?

Unable to update jenkins using yum in rhel8

I have installed the jenkins as per their documentation. And then when i try to update jenkins its giving these wierd errors. The ports 443 and 80 are open. Can any assist on this issues.
Logs:
[root#server ~]# cat /etc/yum.repos.d/jenkins.repo
[jenkins]
name=Jenkins-stable
baseurl=http://pkg.jenkins.io/redhat-stable
gpgcheck=1
[root#server ~]# cat /etc/yum.conf
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=True
skip_if_unavailable=False
ip_resolve=4
[root#mcdefrapl008 ~]#
[root#server ~]# yum update
Jenkins-stable 0.0 B/s | 0 B 00:00
Errors during downloading metadata for repository 'jenkins':
- Curl error (56): Failure when receiving data from the peer for http://pkg.jenkins.io/redhat-stable/repodata/repomd.xml [Recv fa
ilure: Connection reset by peer]
Error: Failed to download metadata for repo 'jenkins': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors
were tried
[root#server ~]# curl http://pkg.jenkins.io/redhat-stable/repodata/repomd.xml -v
* Trying 151.101.2.133...
* TCP_NODELAY set
* Connected to pkg.jenkins.io (151.101.2.133) port 80 (#0)
> GET /redhat-stable/repodata/repomd.xml HTTP/1.1
> Host: pkg.jenkins.io
> User-Agent: curl/7.61.1
> Accept: */*
>
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer
[root#mcdefrapl008 ~]#
Just to mention, when i open the url in the browser it is redirecting to https.
yum do not redirect to https automatically. So set in your repo https and try again.
[jenkins]
name=Jenkins-stable
baseurl=https://pkg.jenkins.io/redhat-stable
gpgcheck=1

mongo exception: connect failed on a fresh install

I've installed mongodb for the very first time on my Debian 8, following this mongodb install guide. The goal is to use mongodb for rocket.chat, for which I follow this guide.
So far, all I did was:
$sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
$echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
$sudo apt-get update
$sudo apt-get install mongodb-org
$sudo systemctl enable mongod
$sudo vi /etc/mongod.conf
<insert>
replication:
oplogSizeMB: 1
replSetName: rs0
$sudo systemctl restart mongod
$export LC_ALL=C
$sudo mongo
MongoDB shell version v3.4.0
connecting to: mongodb://127.0.0.1:27017
2016-12-14T10:21:55.356+0100 W NETWORK [main] Failed to connect to 127.0.0.1:27017 after 5000 milliseconds, giving up.
2016-12-14T10:21:55.356+0100 E QUERY [main] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect#src/mongo/shell/mongo.js:234:13
#(connect):1:6
exception: connect failed
I'm monitoring the log file, when attempting to access the mongo shell, but nothing shows up.
The mongod service is running, configured to listen on 127.0.0.1 and I'm working on the server locally.
How do I access the mongo shell from the localhost?
edit Solved. The issue was an iptables rule, that disallowed local connections to the mongodb.
Run the following command :
sudo rm /var/lib/mongodb/mongod.lock
sudo service mongod restart
Credit: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
You can access the mongodb shell by changing directory to your MongoDb installation and entering ./bin/mongo. See this guide: enter link description here
To recover from an unclean shutdown run these in a terminal
killall mongod
cd ~
./mongod --repair
rm -rfv data/mongod.lock
./mongod
If you want to remove the --httpinterface warning then run, try this :
echo 'mongod --bind_ip=$IP --dbpath=data --nojournal --rest --httpinterface "$#"' > mongod
(it only needs running once) before you run
./mongod
I hope this helps. Cheers!

install TOR on a centOS 7 server

I have tried downloading TOR by following this article but I am getting 503 errors. So is there no other way to download TOR? Please can someone help me as I have to do a research project on it.
I am using a centOS server: CentOS Linux release 7.3.1611 (Core)
but am getting the follwing errors,
[sam#xx etc]$ sudo yum install tor
[sudo] password for sam:
Loaded plugins: fastestmirror, langpacks
base | 3.6 kB 00:00
extras | 3.4 kB 00:00
http://deb.torproject.org/torproject.org/rpm/el/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://deb.torproject.org/torproject.org/rpm/el/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://deb.torproject.org/torproject.org/rpm/el/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://deb.torproject.org/torproject.org/rpm/el/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://deb.torproject.org/torproject.org/rpm/el/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://deb.torproject.org/torproject.org/rpm/el/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://deb.torproject.org/torproject.org/rpm/el/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://deb.torproject.org/torproject.org/rpm/el/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://deb.torproject.org/torproject.org/rpm/el/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
http://deb.torproject.org/torproject.org/rpm/el/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.
Tor no longer recommends using their repo for CentoOS and to instead use epel repos. You'll just end up with a very old version out of their repos.
Instead do:
yum install epel-release
yum install tor
This will get you a current version of Tor managed by a repo. This is perfectly fine.
For CentOS, I have been self-compiling for a while. I have a hacky shell script I'm not yet willing to post here ;) but really it's just compiling Tor and OpenSSL. I'd still recommend using the epel-release since its more tested.
To try building Tor statically linked to OpenSSL yourself, grab a recent copy of OpenSSL (e.g. 1.1.1x), then grab the version of Tor you want to build (e.g. 0.4.1.6).
First you will need to install some prerequisites:
yum install -y \
gcc gcc-c++ \
zlib-devel \
perl-Module-Load-Conditional perl-Test-Harness \
libevent-devel \
libzstd-devel xz-devel \
libscrypt-devel libseccomp-devel
From OpenSSL source dir:
./config --prefix=/opt/openssl --openssldir=/opt/openssl \
-fPIC zlib-dynamic no-shared enable-ec_nistp_64_gcc_128
make
make test
make install
OpenSSL 1.1.1 note: Remove the no-shared option when building OpenSSL, otherwise Tor configuration will fail with an error that it can't find a linkable OpenSSL even though it is being built statically. Tor will still link a static OpenSSL but it seems to require the shared libraries to work. This appears to be fixed in 1.1.1c and later.
This installs OpenSSL to /opt/openssl so it doesn't interfere or replace the system's OpenSSL.
Then, build Tor:
./configure --prefix=/opt/tor-VERSION --sysconfdir=/etc --localstatedir=/var \
--enable-static-openssl --with-openssl-dir=/opt/openssl \
--with-tor-user=tor --with-tor-group=tor \
--enable-lzma --enable-zstd
make
make test
make install
unlink /usr/bin/tor && ln -s /opt/tor-VERSION/bin/tor /usr/bin/tor
The systemd service file I use is:
[Unit]
Description=Anonymizing overlay network for TCP
After=syslog.target network.target nss-lookup.target
[Service]
Type=forking
PidFile=/var/run/tor/tor.pid
NotifyAccess=all
ExecStartPre=/usr/bin/tor -f /etc/tor/torrc --verify-config
ExecStart=/usr/bin/tor -f /etc/tor/torrc --RunAsDaemon 1
ExecReload=/bin/kill -HUP ${MAINPID}
KillSignal=SIGINT
TimeoutStartSec=120
TimeoutStopSec=60
Restart=on-failure
LimitNOFILE=65536
# Hardening
PrivateTmp=yes
PrivateDevices=yes
ProtectHome=yes
ProtectSystem=full
ReadOnlyDirectories=/
ReadWriteDirectories=-/var/lib/tor
ReadWriteDirectories=-/var/log/tor
NoNewPrivileges=yes
CapabilityBoundingSet=CAP_SETUID CAP_SETGID CAP_NET_BIND_SERVICE CAP_DAC_OVERRIDE CAP_CHOWN CAP_FOWNER
[Install]
WantedBy=multi-user.target

wget not downloading from authentic https url vaultpress

I'm using VaultPress to take my WordPress blog's backup
https://dashboard.vaultpress.com/
After clicking the download backup button, this site sends me a link from where I can download. When I click on this link, it starts downloading my backup in the browser, and that's perfect. But I'm trying to download this in my Ubuntu system using wget or curl but no success till now. Here is what the download URL looks like:
https://dashboard.vaultpress.com/12345/restore/?step=4&job=12345678&check=.
eric#eric:~# wget https://dashboard.vaultpress.com/12345/restore/?step=4&job=12345678&check=<somehashedvalue>
[5] 2229
[6] 2230
[6] Done job=12345678
eric#eric:~# --2015-02-08 02:25:07-- https://dashboard.vaultpress.com/12345/restore/?step=4
Resolving dashboard.vaultpress.com (dashboard.vaultpress.com)... 192.0.96.249, 192.0.96.250
Connecting to dashboard.vaultpress.com (dashboard.vaultpress.com)|192.0.96.249|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: / [following]
--2015-02-08 02:25:09-- https://dashboard.vaultpress.com/
Reusing existing connection to dashboard.vaultpress.com:443.
HTTP request sent, awaiting response... 302 Found
Location: /account/login/ [following]
--2015-02-08 02:25:09-- https://dashboard.vaultpress.com/account/login/
Reusing existing connection to dashboard.vaultpress.com:443.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html?step=4’
[ <=> ] 7,709 --.-K/s in 0s
2015-02-08 02:25:09 (20.9 MB/s) - ‘index.html?step=4’ saved [7709]
PS: The file size is almost 1 GB.
Then I used user/pass:
eric#eric:~# wget --user <myusername> --password <mypassword> https://aboveurl
I even used --ask-password:
eric#eric:~# wget --user <myusername> --ask-password https://aboveurl
But in this case, instead of asking password it completes the action and then asks for the password in another shell (I don't know the exact term), something like this:
eric#eric:~# wget --user <myusername> --ask-password https://dashboard.vaultpress.com/12345/restore/?step=4&job=12345678&check=<hashedvalue>
[1] 1979
[2] 1980
eric#eric:~# Password for user ‘<myusername>’: <mypassword-here>
<mypassword>: command not found
And then finally, I gave a try to curl:
eric#eric:~# curl -u <myusername>:<mypassword> https://dashboard.vaultpress.com/12345/restore/?step=4&job=12345678&check=<hashedvalue>
[5] 2010
[6] 2011
eric#eric:~#
I don't know what's happening? What are those [5] 2010 [6] 2011 or [5] 2229
This solution is also not working:
wget with authentication
The ampersands in your URL make Linux create new processes running in the background. The PID is printed out behind the number in the square brackets.
Write the URL within double quotes and try again:
wget "https://dashboard.vaultpress.com/12345/restore/?step=4&job=12345678&check=<somehashedvalue>"

Resources