Error when installing Google Cloud SDK on Ubuntu, how to fix? - google-cloud-sdk

I'm attempting to set up Google Cloud SDK CLI to manage some compute resources, and I'm just following a guide for this part. I ran this command and it installed lots of stuff successfully but ran into the problem below. Can anyone suggest a solution or how to debug?
$ sudo apt-get update && sudo apt-get install google-cloud-sdk
[sudo] password for #######:
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease [111 kB]
Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB]
Get:5 https://packages.cloud.google.com/apt cloud-sdk InRelease [6349 B]
Ign:6 http://packages.cloud.google.com/apt cloud-sdk-focal InRelease
Err:7 http://packages.cloud.google.com/apt cloud-sdk-focal Release
404 Not Found [IP: 216.58.204.238 80]
Get:8 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [255 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [7492 B]
Get:10 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [132 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [4732 B]
Reading package lists... Done
E: The repository 'http://packages.cloud.google.com/apt cloud-sdk-focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

I had the same issue with Ubuntu 20. The solution is to install using snap.
snap install google-cloud-sdk --classic
Make sure you have --classic at the end, otherwise you'll get this error:
error: This revision of snap "google-cloud-sdk" was published using classic confinement and thus
may perform arbitrary system changes outside of the security sandbox that snaps are usually
confined to, which may put your system at risk.
If you understand and want to proceed, repeat the command including --classic.

Looks like the problem is in not updated documentation on Google. I used this for creating Docker image but I believe it solved normal installation too:
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 467B942D3A79BD29
RUN apt-get update && apt-get install -y apt-transport-https ca-certificates curl gnupg
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | \
tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && apt-get update -y && apt-get install google-cloud-cli -y
keep attention on http://packages.cloud.google.com/apt cloud-sdk main. In Google website is http://packages.cloud.google.com/apt cloud-cli main so seems like name of package has been changed from cloud-cli to cloud-sdk.

In my case the solution was to install the earlier 18.04 LTS version of Ubuntu (uninstalling 20.04). Having done this the Google Cloud Compute SDK install steps worked successfully.
I found a similar problem / solution described here:
https://forums.fast.ai/t/platform-gcp/27375/716

I don't think it's possible to get gcloud on Ubuntu 20.04.3 with apt, at least not a recent version. I was tempted to get the latest through snap:
sudo snap install google-cloud-sdk --classic
But I can't think of a good reason for "arbitrary system changes outside of the security sandbox". By the way, there's the same warning for node so it's not that uncommon. Nonetheless, I prefer to run it in a container, which by the way, I also do for Node.js.
If you already run docker or podman, this could be another option. See an example shell session below, where I get version 360.0.0. I went for slim for now, because the default is around 1GB, but there are plenty of tags to choose.
docker pull google/cloud-sdk:360.0.0-slim
# run a dummy tail so the container does not exit
docker run --name gcloud -d google/cloud-sdk:360.0.0-slim tail -f /dev/null
# now get a shell into it
docker exec -ti gcloud /bin/bash
root#ff77152a65ee:/# gcloud --version
Google Cloud SDK 360.0.0
alpha 2021.10.04
beta 2021.10.04
bq 2.0.71
core 2021.10.04
gsutil 5.3
Alternatively, for a container that will stop when you exit the shell:
docker run -ti google/cloud-sdk:360.0.0-slim /bin/bash
There's detailed documentation on the official google cloud-sdk docker hub overview page.
I have the following on my ~/.bashrc for quick access into a "gcloud shell":
alias gcloudshell='docker start gcloud && docker exec -ti gcloud /bin/bash'
Note that it can be used multiple times, even if the container is already running.

Related

Can't install SQL Server command-line tools on Ubuntu due to `unmet dependencies`

After sucessfully installing Sql Server Following the docs, Failed to install SQL Server command-line tools on Ubuntu 20.04. Efforts led to below commands and results:
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
OK
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main
sudo apt-get update
Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Hit:3 http://x.archive.ubuntu.com/ubuntu focal InRelease
Hit:4 http://x.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:5 http://x.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:6 ... packages . microsoft . com/ubuntu/18.04/mssql-server-2019 bionic InRelease
Hit:7 ... packages . microsoft . com/ubuntu/20.04/prod focal InRelease
Hit:8 ... download . gocd . org InRelease
Hit:9 ... packages . microsoft . com/ubuntu/18.04/prod bionic InRelease
Get:10 ... security . ubuntu . com/ubuntu focal-security/main amd64 DEP-11 Metadata [21.3 kB]
Get:11 ... security . ubuntu . com/ubuntu focal-security/universe amd64 DEP-11 Metadata [31.5 kB]
Fetched 160 kB in 17s (9,288 B/s)
Reading package lists... Done
sudo apt-get install mssql-tools unixodbc-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
mssql-tools is already the newest version (17.5.2.1-1).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mssql-tools : Depends: msodbcsql17 (>= 17.3.0.0) but it is not going to be installed
unixodbc-dev : Depends: unixodbc (= 2.3.7)
Depends: odbcinst1debian2 (= 2.3.7) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I tried following the dependency failure tree to install unmet dependencies manually but in the final step failed to install:
sudo apt-get install multiarch-support
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package multiarch-support is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'multiarch-support' has no installation candidate
How would you solve these issues to finally install the Command line?
Using:
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
Instead of:
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
Solves the issue, The docs are out dated or maybe Ubuntu 20.04 is not officially supported yet...
Also I wasn't able to use curl https://... (Don't know why always peer closed my connection!) so I manually downloaded the link and paste the result to /etc/apt/sources.list.d/msprod.list

Installing Apache OpenWhisk using docker-compose on Amazon Linux instance gets stuck at "waiting for the Whisk invoker to come up..."

I am trying to install openwhisk for dev mode using docker compose on Amazon Linux EC2 Instance. I am following this link for doing so https://github.com/apache/incubator-openwhisk -> Get Started.
Although, it has worked for me before once, in this installation, I am facing an issue. These are the steps I followed:
sudo yum update -y
sudo yum install -y docker
sudo service docker start
sudo chkconfig docker on
sudo yum install -y python-pip
sudo pip install docker-compose
This step is because open whisk is using sudo for docker-compose, and based on previous steps, sudo docker-compose -v gives a command not found.
sudo cp /usr/local/bin/docker-compose /bin
sudo yum install -y git
cd ~
git clone https://github.com/apache/incubator-openwhisk-devtools.git
cd incubator-openwhisk-devtools/docker-compose
sudo make quick-start
Update: The problem is that the make command gets stuck at the stage where it is waiting for invokers.
I have not made any changes to any source code, nor I did any other steps before this on the instance. It was a freshly created instance.
Am I missing something in OpenWhisk or EC2 or the combination of both? Any help would be great.
Update: I tried the docker-compose method for installing open whisk on Amazon Linux 1, Amazon Linux 2, Ubuntu 16.04 as well as Ubuntu 14.04. On all platforms, it got stuck at sudo make quick-start where it is waiting for invokers.
Update: Instead of using python-pip for docker-compose installation, used the command from docker website as well.
sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
if docker-compose command is not found it means you didn't install docker-compose correctly.
I don't think you can install docker-compose as a python library using pip
See the instructions here https://docs.docker.com/compose/install/#install-compose
someting like
sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
Or take a look at https://medium.com/#khandelwal12nidhi/docker-setup-on-aws-ec2-instance-c670ff3d5f1b

JetBrains Rider EAP on Linux - Solution load failed: MsBuild not found

Just installed the latest version of Rider EAP (163.12057) and tried to create a new solution.
In my Solution Explorer its shows my Solution and (load failed).
In the Event Log window I get the error message:
Solution 'FirstSolution' load failed: MsBuild not found on this machine
Any ideas on how I can solve this loading problem?
Thanks in advance!
I managed to solve the loading error.
I was missing Mono and found out through this thread here that Rider currently needs Mono 4.6.2.
I followed this guide to install Mono.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get install mono-devel
sudo apt-get install mono-complete
I hope this will help someone else.
UPDATE: Asp.Net Core
if you'll be using Asp.Net Core, and encounter error about missing xsp.exe you might need to install mono-xsp4 with this command
sudo apt-get install mono-xsp4
Accepted answer led me to the official guide: Mono-project download
This can help with various other systems (different than Debian). It helped me to get through the process and resolved problem on Ubuntu 18.04.
For Ubuntu 18.04 it is, first Add the Mono repository to your system:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
then,
sudo apt install mono-devel
sudo apt install mono-complete
For Arch Linux and derivatives you'll need:
sudo pacman -S mono mono-tools msbuild
Invalidate caches & Restart on Jetbrains to apply

how to install mono latest Alpha version on Ubuntu 16.04

I tried to do the guide on the mono website, but I don't really understand it as I am not a linux guy and surely not an expert in servers.
I don't find anything on Google.
No matter what I do, when I use the "mono --version" command to see if the install was successful, I get Mono 4.6.1
If you are looking for alpha versions, you will want to setup your package manager to pull the Mono Continuous Integration packages as these are built for every commit to the repo at https://github.com/mono/mono.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://jenkins.mono-project.com/repo/debian sid main" | sudo tee /etc/apt/sources.list.d/mono-jenkins.list
sudo apt-get update
Ref: http://www.mono-project.com/docs/getting-started/install/linux/ci-packages/#debian-ubuntu-and-derivatives
Read the Usage section on how to select a build/package.

Compiling libapache2-svn for Apache 2.4.4

I want to use Apache 2.4.4 with SVN on Ubuntu server 12.04 (Precise Pangolin). But when I use
apt-get install libapache2-svn
I get the following dependencies error
The following packages have unmet dependencies:
libapache2-svn : Depends: apache2.2-common but it is not going to be installed
Googling around I got some suggestion about compiling from source by hand. I don't know how to do that. How can I do it?
I have two solutions:
Follow the instructions in this Server Fault Q&A.
*Note: Create another user if you're using a root account on the server.
I've asked Ondřej Surý on Launchpad to add Subversion to his Apache PPA. You can add Ondřej Surý's PPA to perform a normal update/upgrade.
You did ask Ondrej to include Subversion in his PPA launchpad. But I couldn't install the libapache2-svn package after adding Ondrej's PPA.
Somehow the instructions provided for compiling didn't work for me so here's an alternative way to get it working.
Reference:
(https://askubuntu.com/questions/312568/where-can-i-find-a-subversion-1-8-binary)
WANDisco has Subversion 1.8 for Ubuntu then:
sudo sh -c 'echo "# WANdisco Open Source Repo" >> /etc/apt/sources.list.d/WANdisco.list'
sudo sh -c 'echo "deb http://opensource.wandisco.com/ubuntu precise svn18" >> /etc/apt/sources.list.d/WANdisco.list'
wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- | sudo apt-key add -
sudo apt-get update
After that:
apt-cache show subversion | grep '^Version:'
And then you should be good to install normally:
sudo apt-get install subversion libapache2-svn