How to replace part of URL without knowing it beforehand using sed/awk? - regex

How do I replace part of url string without knowing beforehand what the string would be ? For example below is Ubuntu mirror. I want to set mirror to my liking.
Basically, I want replace (jp, us provided as an example, I think for every country they have their own ubuntu mirrors).
deb http://us.archive.ubuntu.com/ubuntu/ focal multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal multiverse
deb http://us.archive.ubuntu.com/ubuntu/ focal-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal-updates multiverse
deb http://jp.archive.ubuntu.com/ubuntu/ focal multiverse
# deb-src http://jp.archive.ubuntu.com/ubuntu/ focal multiverse
deb http://jp.archive.ubuntu.com/ubuntu/ focal-updates multiverse
# deb-src http://jp.archive.ubuntu.com/ubuntu/ focal-updates multiverse
deb http://archive.ubuntu.com/ubuntu focal multiverse
# deb-src http://archive.ubuntu.com/ubuntu focal multiverse
deb http://archive.ubuntu.com/ubuntu focal-updates multiverse
# deb-src http://archive.ubuntu.com/ubuntu focal-updates multiverse
To following.
deb http://mirror.sg.gs/ubuntu focal multiverse
# deb-src http://mirror.sg.gs/ubuntu focal multiverse
deb http://mirror.sg.gs/ubuntu focal-updates multiverse
# deb-src http://mirror.sg.gs/ubuntu focal-updates multiverse
deb http://mirror.sg.gs/ubuntu focal multiverse
# deb-src http://mirror.sg.gs/ubuntu focal multiverse
deb http://mirror.sg.gs/ubuntu focal-updates multiverse
# deb-src http://mirror.sg.gs/ubuntu focal-updates multiverse
deb http://mirror.sg.gs/ubuntu focal multiverse
# deb-src http://mirror.sg.gs/ubuntu focal multiverse
deb http://mirror.sg.gs/ubuntu focal-updates multiverse
# deb-src http://mirror.sg.gs/ubuntu focal-updates multiverse
Possibly with sed, awk.

An easy solution for perl:
perl -pe 's/([^\s\/]+\.)?archive\.ubuntu\.com/mirror.sg.gs/g'
Explanation: This replaces an optional part of (non-space and non-slashes followed by a .) before archive.ubuntu.com by mirror.sg.gs.
If you prefer sed:
sed -E 's#(https?://)[^/]*archive.ubuntu.com#\1mirror.sg.gs#'
Explanation: This sed command replaces everything between http:// or https://, followed by an optional part (of no slashes), ending with archive.ubuntu.com with your host.
Here are the two examples updating /etc/apt/sources.list in-place:
perl -i -pe 's/([^\s\/]+\.)?archive\.ubuntu\.com/mirror.sg.gs/g' /etc/apt/sources.list
sed -Ei 's#(https?://)[^/]*archive.ubuntu.com#\1mirror.sg.gs#' /etc/apt/sources.list
I would however replace everything incl. the URL scheme (http/https/ftp). That's also easier to read:
perl -pe 's/\s.*archive\.ubuntu\.com/ http:\/\/mirror.sg.gs/g'

Using any sed:
$ sed 's#\([^ ]* http://\)[^ ]*#\1mirror.sg.gs/ubuntu#' file
deb http://mirror.sg.gs/ubuntu focal multiverse
# deb-src http://mirror.sg.gs/ubuntu focal multiverse
deb http://mirror.sg.gs/ubuntu focal-updates multiverse
# deb-src http://mirror.sg.gs/ubuntu focal-updates multiverse
deb http://mirror.sg.gs/ubuntu focal multiverse
# deb-src http://mirror.sg.gs/ubuntu focal multiverse
deb http://mirror.sg.gs/ubuntu focal-updates multiverse
# deb-src http://mirror.sg.gs/ubuntu focal-updates multiverse
deb http://mirror.sg.gs/ubuntu focal multiverse
# deb-src http://mirror.sg.gs/ubuntu focal multiverse
deb http://mirror.sg.gs/ubuntu focal-updates multiverse
# deb-src http://mirror.sg.gs/ubuntu focal-updates multiverse

This solution replaces everything between the "\" and the first "" (not including these three ""s), then replaces the first 3 ""s (the "\" and the first "") with temporary "~"s, then removes the remaining "/"s, then replaces the three temporary "~"s with ""s:
cat input2.txt | sed 's/\(^.*\/\/\)\([^/]*\)\(.*$\)/\1mirror.sg.gs\3/' | sed 's/\//~/' | sed 's/\//~/' | sed 's/\//~/' | sed 's/\///g' | sed 's/~/\//g'

Related

The repository ... does not have a Release file (Maxmind)

I am following this tutorial: Maxmind GeoLite2 & GeoIP Database Auto-Update | 2020
I launched an Ec2 AWS instance with the mautic application (debian 10).
I'm trying to install Geolip Maximind on my instance but without success.
Here are the problems:
When I execute the command add-apt-repository ppa:maxmind/ppa
I get the result:
More info: https://launchpad.net/~maxmind/+archive/ubuntu/ppa
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keybox '/tmp/tmpxsjdtonq/pubring.gpg' created
gpg: /tmp/tmpxsjdtonq/trustdb.gpg: trustdb created
gpg: key DE1997DCDE742AFA: public key "Launchpad PPA for MaxMind" imported
gpg: Total number processed: 1
gpg: imported: 1
gpg: no valid OpenPGP data found.
When I execute the command apt update
I get the result:
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://cdn-aws.deb.debian.org/debian buster InRelease
Hit:3 http://cdn-aws.deb.debian.org/debian buster-updates InRelease
Hit:4 http://cdn-aws.deb.debian.org/debian buster-backports InRelease
Ign:5 http://ppa.launchpad.net/maxmind/ppa/ubuntu impish InRelease
Err:6 http://ppa.launchpad.net/maxmind/ppa/ubuntu impish Release
404 Not Found [IP: 91.189.95.85 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/maxmind/ppa/ubuntu impish 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 didn't think it was useful to continue the tutorial because of these errors. I need your precious help to correct them.
If you are running Debian then you just have to install geoip-bin and geoip-database and for the updates you install geoipupdate. They are all in the standard apt repository.
You do not need to add the maxmind repository.
apt install geoip-bin geoip-database geoipupdate
Note that depending what you plan to do you may need also other packages for your perl php lua apache lighttp etc ... Since you don't want to tell us what you have in mind, I can't tell you more than that.
There are several packages there ...
root#linux:~# apt policy geoipupdate
geoipupdate:
Installiert: 3.1.1-1
Installationskandidat: 3.1.1-1
Versionstabelle:
*** 3.1.1-1 500
500 http://ftp.debian.org/debian buster/contrib amd64 Packages
100 /var/lib/dpkg/status
2.5.0-1~bpo9+1 100
100 http://ftp.debian.org/debian stretch-backports/contrib amd64 Packages
2.3.1-1 500
500 http://ftp.debian.org/debian stretch/contrib amd64 Packages
The standard apt repositories are :
deb http://ftp.debian.org/debian/ buster main contrib non-free
deb-src http://ftp.debian.org/debian/ buster main non-free
deb http://security.debian.org/debian-security buster/updates main contrib non-free
deb-src http://security.debian.org/debian-security buster/updates main non-free
deb http://ftp.debian.org/debian buster-backports main contrib
deb-src http://ftp.debian.org/debian buster-backports main contrib
add them to your /etc/apt/sources.list and then try again

Installing Google SDK in Debian 10?

I am following instructions here to install Google Cloud SDK:
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
sudo apt-get install apt-transport-https ca-certificates gnupg
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update && sudo apt-get install google-cloud-sdk
but in updating APT such that
$ sudo apt update
Hit:1 http://ftp.debian.org/debian unstable InRelease
Hit:2 http://deb.debian.org/debian experimental InRelease
Hit:3 https://updates.signal.org/desktop/apt xenial InRelease
Get:5 https://packages.cloud.google.com/apt cloud-sdk InRelease [6,337 B]
Err:5 https://packages.cloud.google.com/apt cloud-sdk InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB
Hit:4 https://packages.cloud.google.com/apt kubernetes-xenial InRelease
Reading package lists... Done
W: GPG error: https://packages.cloud.google.com/apt cloud-sdk InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB
E: The repository 'https://packages.cloud.google.com/apt cloud-sdk InRelease' is not signed.
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.
and in adding the key
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
with Debian version
$ cat /etc/issue
Debian GNU/Linux 10 \n \l
How can I properly install Google Cloud SDK in Debian 10?
PO's Google support manual here is outdated. The new thread here fixed the issue:
# Add the Cloud SDK distribution URI as a package source
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
# Import the Google Cloud Platform public key
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
# Update the package list and install the Cloud SDK
sudo apt-get update && sudo apt-get install google-cloud-sdk
The easiest way (from within debian VM or container):
apt-get update && apt-get install -y curl python
curl sdk.cloud.google.com -L | bash
Exit the VM (or container) and access it again.
gcloud init
And you are done.

E: Malformed entry 1 in list file /etc/apt/sources.list.d/docker.list (URI parse), E:The list of sources could not be read

I am using Ubuntu 16.04 but I'm not a computing professinal at all and I'm trying to resolve an issue I have since several months know. It is know becoming a real problem for me as I'd like to install new packages.
3 months ago, I did some manipulations in my terminal. I don't even remember what I was trying to do but it had something to do with implementing a database dump for one of my applications.
Here is the history of the commands I've run and that ruined everything:
1072 sudo apt-get update
1073 deb http://ppa.launchpad.net/jonls/redshift-ppa/ubuntu 16.04 main
1074 sudo apt-get install redshift
1075 sudo apt install redshift
1076 sudo apt install redshift-gtk
1077 HiSuite
1078 sudo apt-get update
1079 sudo apt-get install fakeroot
1080 sudo apt-get build-essential
1081 deb http://de.archive.ubuntu.com/ubuntu/ saucy-updates main restricted
1082 sudo apt-get build-essential
1083 sudo apt-get update
1084 sudo apt-get build-essential
1085 sudo vi /etc/apt/sources.list
1086 deb http://ftp.debian.org/debian wheezy main
1087 echo "deb http://ftp.debian.org/debian wheezy main" | sudo tee /etc/apt/sources.list.d/docker.list
1088 echo "deb deb-src http://ftp.debian.org/debian wheezy main" | sudo tee /etc/apt/sources.list.d/docker.list
1089 sudo apt-get update
1090 sudo apt-get build-essential
1091 echo "deb http://ftp.debian.org/debian wheezy main"
1092 echo "deb deb-src http://ftp.debian.org/debian wheezy main"
1093 sudo apt-get update
1094 apt-get
1095 sudo apt-get update
1096 cat -n /etc/apt/sources.list | grep "55"
1097 cat -n /etc/apt/sources.list
1098 lsb_release -c -s
1099 sudo rm /etc/apt/sources.list
1100 sudo -i software-properties-gtk
1101 sudo sed -i "s/xenial/$(lsb_release -c -s)/" /etc/apt/sources.list
1102 sudo -i software-properties-gtk
1103 sudo sed -i "s/xenial/$(lsb_release -c -s)/" /etc/apt/sources.list
1104 sudo mv /etc/apt/sources.list /etc/apt/sources.list.old
1105 sudo apt-get install gksu
1106 sudo sed -i "s/xenial/$(lsb_release -c -s)/" /etc/apt/sources.list
1107 sudo rm /etc/apt/sources.list
1108 sudo sed -i "s/xenial/$(lsb_release -c -s)/" /etc/apt/sources.list
1109 sudo -i software-properties-gtk
1110 /etc/apt/
1111 ls
1112 source
1113 ..
1114 sudo cp /etc/apt/sources.list /etc/apt/sources.list.old
1115 sudo gedit /etc/apt/sources.list
1116 ls
1117 cd home
1118 ls
1119 cd kenza
1120 ls
1121 sudo apt-get update
1122 cat -n /etc/apt/sources.list
1123 sudo -i software-properties-gtk
1124 sudo apt-get update
1125 ..
1126 /etc/apt/
1127 source
1128 sudo gedit /etc/apt/sources.list
1129 ..
1130 cd home/kenza
1131 sudo apt-get update
1132 apt-get
1133 sudo apt-get uprade
1134 /etc/apt/
1135 ls
1136 sudo gedit /etc/apt/sources.list.old
1137 sudo gedit /etc/apt/sources.list.save
1138 ..
1139 cd home/kenza
1140 curl https://repogen.simplylinux.ch/txt/xenial/sources_ae6942a4ca69e6ca95d89a755f6959aa12396478.txt | sudo tee /etc/apt/sources.list
1141 sudo apt-get update
1142 sudo gedit /etc/apt/sources.list
1143 sudo gedit /etc/apt/sources.list.d/docker.list
1144 sudo apt-get update
1145 sudo gedit /etc/apt/sources.list.d/docker.list
Now each time I try to run an apt-get command I have this result :
E: Malformed entry 1 in list file /etc/apt/sources.list.d/docker.list (URI parse)
E: The list of sources could not be read.
At the moment, I need to install libsqlite3-dev which is impossible.
Thanks a lot for your help!
I met the same problem when I was installing Bazel.
And I found it was because I missed a space when typing the following command
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
When running apt-get update or apt-get upgrade, the sources enumerated in /etc/apt/sources.list are read. It will show the error which you mentioned above.
Hope this will help.
reference
I use after sudo apt update && sudo apt install -y bazel-1.2.1

Google Compute Engine Ubuntu 17.04 zesty does no longer have a Release file

I have just created a new Google Cloud Compute Engine server using Ubuntu 17.04 as the boot disk:
Ubuntu 17.04
amd64 zesty image built on 2017-12-08
Before doing anything else, if I try to run sudo apt-get update I receive the following errors:
Ign:1 http://europe-west1.gce.archive.ubuntu.com/ubuntu zesty InRelease
Ign:2 http://europe-west1.gce.archive.ubuntu.com/ubuntu zesty-updates
InRelease
Ign:3 http://europe-west1.gce.archive.ubuntu.com/ubuntu zesty-backports InRelease
Ign:4 http://security.ubuntu.com/ubuntu zesty-security InRelease
Err:5 http://europe-west1.gce.archive.ubuntu.com/ubuntu zesty Release
404 Not Found [IP: 35.195.241.40 80]
Err:6 http://europe-west1.gce.archive.ubuntu.com/ubuntu zesty-updates Release
404 Not Found [IP: 35.195.241.40 80]
Err:7 http://europe-west1.gce.archive.ubuntu.com/ubuntu zesty-backports Release
404 Not Found [IP: 35.195.241.40 80]
Err:8 http://security.ubuntu.com/ubuntu zesty-security Release
404 Not Found [IP: 91.189.88.161 80]
Hit:9 http://archive.canonical.com/ubuntu zesty InRelease
Reading package lists... Done
E: The repository 'http://europe-west1.gce.archive.ubuntu.com/ubuntu zesty Release' does no longer 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.
E: The repository 'http://europe-west1.gce.archive.ubuntu.com/ubuntu zesty-updates Release' does no longer 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.
E: The repository 'http://europe-west1.gce.archive.ubuntu.com/ubuntu zesty-backports Release' does no longer 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.
E: The repository 'http://security.ubuntu.com/ubuntu zesty-security Release' does no longer 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.
Looking at http://europe-west1.gce.archive.ubuntu.com/ubuntu/ I can see updates from today less than an hour ago.
Is this an error on Google's side or have I done something wrong?
I confirm that "E: The repository 'http://ru.archive.ubuntu.com/ubuntu zesty Release' does no longer have a Release file."
Solved as proposed before by heroin in the recipe https://smyl.es/how-to-fix-ubuntudebian-apt-get-404-not-found-package-repository-errors-saucy-raring-quantal-oneiric-natty/ .
Run this command below on your server and it will replace all of the archive.ubuntu.com and security.ubuntu.com package repository URLs with old-releases.ubuntu.com
sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
Unfortunately this sed command will not work for you if you have selected a national mirror (like us.archive.ubuntu.com for updates. Then one can update strings in the file /etc/apt/sources.list changing all entries like http://*.archive.ubuntu.com and http://*.security.ubuntu.com to the http://old-releases.ubuntu.com manually in a text editor,
sudo nano /etc/apt/sources.list
or
sudo vi /etc/apt/sources.list
For example, your http://europe-west1.gce.archive.ubuntu.com/ubuntu zesty InRelease become http://old-releases.ubuntu.com/ubuntu zesty InRelease and so on.
Here is my updated file /etc/apt/sources.list:
# deb cdrom:[Kubuntu 17.04 _Zesty Zapus_ - Release amd64 (20170412)]/ zesty main multiverse restricted universe
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://old-releases.ubuntu.com/ubuntu/ zesty main restricted
# deb-src http://old-releases.ubuntu.com/ubuntu/ zesty main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://old-releases.ubuntu.com/ubuntu/ zesty-updates main restricted
# deb-src http://old-releases.ubuntu.com/ubuntu/ zesty-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://old-releases.ubuntu.com/ubuntu/ zesty universe
# deb-src http://old-releases.ubuntu.com/ubuntu/ zesty universe
deb http://old-releases.ubuntu.com/ubuntu/ zesty-updates universe
# deb-src http://old-releases.ubuntu.com/ubuntu/ zesty-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://old-releases.ubuntu.com/ubuntu/ zesty multiverse
# deb-src http://old-releases.ubuntu.com/ubuntu/ zesty multiverse
deb http://old-releases.ubuntu.com/ubuntu/ zesty-updates multiverse
# deb-src http://old-releases.ubuntu.com/ubuntu/ zesty-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://old-releases.ubuntu.com/ubuntu/ zesty-backports main restricted universe multiverse
# deb-src http://old-releases.ubuntu.com/ubuntu/ zesty-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu zesty partner
# deb-src http://archive.canonical.com/ubuntu zesty partner
deb http://old-releases.ubuntu.com/ubuntu zesty-security main restricted
# deb-src http://old-releases.ubuntu.com/ubuntu zesty-security main restricted
deb http://old-releases.ubuntu.com/ubuntu zesty-security universe
# deb-src http://old-releases.ubuntu.com/ubuntu zesty-security universe
deb http://old-releases.ubuntu.com/ubuntu zesty-security multiverse
# deb-src http://old-releases.ubuntu.com/ubuntu zesty-security multiverse
17.04 is now end of life as of January 13, 2018. You will need to move to a newer version or use a long term stable version:
https://wiki.ubuntu.com/Releases
Zesty does no longer have a release file, indeed "END OF LIFE CYCLE "
I had the same problem, the solution is in this link, it works for me...
https://help.ubuntu.com/community/EOLUpgrades
Hope my answer would help.
The issue seems to be not with a Google's side, but with the fact that you are trying to get updates from HTTP and not HTTPS.
Try to use this option of apt-get:
--allow-unauthenticated
Ignore if packages can't be authenticated and don't prompt about it. This can be useful while working with local repositories, but is a huge security risk if data authenticity isn't ensured in another way by the
user itself. The usage of the Trusted option for sources.list(5) entries should usually be preferred over this global override. Configuration Item: APT::Get::AllowUnauthenticated.

Stackdriver agent installation failed

I am trying to install Stackdriver Agent. I am using the Google cloud instance (os Ubuntu) and followed the instruction given at google cloud docs for monitoring. Here, are the logs from my server console.
root#instance-1:~/opt# sudo bash stack-install.sh --write-gcm
Installing agents for Debian or Ubuntu.
curl: (22) The requested URL returned error: 404 Not Found
OK
Hit:1 http://asia-east1.gce.archive.ubuntu.com/ubuntu yakkety InRelease
Hit:2 http://asia-east1.gce.archive.ubuntu.com/ubuntu yakkety-updates InRelease
Get:3 http://asia-east1.gce.archive.ubuntu.com/ubuntu yakkety-backports InRelease [102 kB]
Ign:4 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 InRelease
Hit:5 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release
Hit:6 http://security.ubuntu.com/ubuntu yakkety-security InRelease
Hit:8 http://archive.canonical.com/ubuntu yakkety InRelease
Hit:9 https://deb.nodesource.com/node_6.x yakkety InRelease
Fetched 102 kB in 0s (111 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package stackdriver-agent
Installation failed.
root#instance-1:~/opt#
According to the list of documented OSs, the following are supported at present:
LTS 12.04 "Precise"
LTS 14.04 "Trusty"
LTS 16.04 "Xenial"
And it appears that only LTS releases are supported.
First you need to type this:
sudo apt-cache madison stackdriver-agent
To show the list of available versions of the agent in order to select which version to install.
Results:
stackdriver-agent | 6.0.2-1.bionic |
http://packages.cloud.google.com/apt
google-cloud-monitoring-bionic-all/main amd64 Packages
stackdriver-agent | 6.0.1-1.bionic |
http://packages.cloud.google.com/apt
google-cloud-monitoring-bionic-all/main amd64 Packages
stackdriver-agent | 6.0.0-1.bionic |
http://packages.cloud.google.com/apt
google-cloud-monitoring-bionic-all/main amd64 Packages
stackdriver-agent | 5.5.2-1002.bionic |
http://packages.cloud.google.com/apt
google-cloud-monitoring-bionic-all/main amd64 Packages
stackdriver-agent | 5.5.2-1001.bionic |
http://packages.cloud.google.com/apt
google-cloud-monitoring-bionic-all/main amd64 Packages
Then:
sudo apt-get install -y 'stackdriver-agent=[MAJOR_VERSION].*'
For example, to pin to the 6.0.2-1 bionic of the agent, run:
sudo apt-get install -y 'stackdriver-agent=6.0.2-1.bionic*'