-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ubuntu: add instructions for updating package repositories #10285
base: main
Are you sure you want to change the base?
ubuntu: add instructions for updating package repositories #10285
Conversation
Add some warnings/recommendations for non-LTS Ubuntu releases, and provide instructions for updating the package repository after upgrading. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
in `/etc/apt/sources.list`, or use the `add-apt-repository --remove` command: | ||
|
||
```bash | ||
sudo add-apt-repository --remove "deb {{ download-url-base }} disco stable" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seemethere @tianon wondering if there's a way to remove all download.docker.com
(using a wildcard?) references, and if we should add such a step to the get.docker.com
installation script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we should just make sure get.docker.com
always uses the same filename, which solves the issue in a simpler way for folks who use the script.
We could do something clever here with find
+sed
to remove all references, but I think just an example grep
to help them find the offending entries would be cleaner (and puts the onus of accidentally screwing up sources.list
on the user instead 😅😇).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we should just make sure get.docker.com always uses the same filename, which solves the issue in a simpler way for folks who use the script.
You mean; instead of having separate directories/repositories for each version of the distro (disco
, xenial
, ..), have all packages in the same location (not exactly sure how the indexes work internally for .deb
repositories 😅)? Or do you mean; make sure we always write the repository to a file inside /etc/apt/sources.list.d
instead of append it to /etc/apt/sources.list/
?
We could do something clever here with find+sed to remove all references, but I think just an example grep to help them find the offending entries would be cleaner (and puts the onus of accidentally screwing up sources.list on the user instead
Yes, so that was my main train of thought with using the add-apt-repository --remove
utility to just remove it (assuming that's relatively safe, and wouldn't do harm to other repositories), followed by adding the new / right repository.
I could have a look at providing a grep
example, or just keep it at "do whatever you usually do, but you likely want to be looking in this file" (as I have currently tried to write it); wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or do you mean; make sure we always write the repository to a file inside
/etc/apt/sources.list.d
instead of append it to/etc/apt/sources.list/
?
Yeah, I just mean /etc/apt/sources.list.d/docker.list
consistently like @seemethere mentioned. 👍
I could have a look at providing a
grep
example, or just keep it at "do whatever you usually do, but you likely want to be looking in this file" (as I have currently tried to write it); wdyt?
Yeah, my thought was something as simple as grep -rnF 'docker.com' /etc/apt/sources.list*
, which should tell them where they've got an entry for it already:
$ grep -rnF 'docker.com' /etc/apt/sources.list*
/etc/apt/sources.list.d/docker.list:1:deb [ arch=amd64 ] https://download.docker.com/linux/debian buster stable
I'm definitely a fan of avoiding add-apt-repository
because IMO it's extraneous (and isn't installed in minimal systems).
iirc get.docker.com always puts the apt repos into
/etc/apt/sources.list.d/docker.list
…On Thu, Feb 13, 2020 at 8:00 AM Sebastiaan van Stijn < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In install/linux/docker-ce/ubuntu.md
<#10285 (comment)>
:
> +shows that `apt` is configured to install packages for Ubuntu `disco` (19.04):
+
+```bash
+apt-cache policy | grep docker
+
+ 500 https://download.docker.com/linux/ubuntu disco/stable amd64 Packages
+ origin download.docker.com
+```
+
+If the Ubuntu version in the output does not match the version you have installed,
+the repository URL needs to be updated. To update the package repository to match
+your current version, either removing all lines containing `download.docker.com`
+in `/etc/apt/sources.list`, or use the `add-apt-repository --remove` command:
+
+```bash
+sudo add-apt-repository --remove "deb {{ download-url-base }} disco stable"
IMO we should just make sure get.docker.com always uses the same
filename, which solves the issue in a simpler way for folks who use the
script.
You mean; instead of having separate directories/repositories for each
version of the distro (disco, xenial, ..), have all packages in the same
location (not exactly sure how the indexes work internally for .deb
repositories 😅)? Or do you mean; make sure we always write the
repository to a file inside /etc/apt/sources.list.d instead of append it
to /etc/apt/sources.list/ ?
We could do something clever here with find+sed to remove all references,
but I think just an example grep to help them find the offending entries
would be cleaner (and puts the onus of accidentally screwing up
sources.list on the user instead
Yes, so that was my main train of thought with using the add-apt-repository
--remove utility to just remove it (assuming that's relatively safe, and
wouldn't do harm to other repositories), followed by adding the new / right
repository.
I could have a look at providing a grep example, or just keep it at "do
whatever you usually do, but you likely want to be looking in this file"
(as I have currently tried to write it); wdyt?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10285>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAM7HV6WF3OTJDPNBQ66MILRCVVDBANCNFSM4KUPFMLA>
.
|
Yes, I was surprised |
Yeah the only file that needs to be changed is the We should probably just change the installation instructions to actually just point users to do the same echo command we use in get.docker.com apt_repo="deb [arch=$(dpkg --print-architecture)] $DOWNLOAD_URL/linux/$lsb_dist $dist_version $CHANNEL"
(
if ! is_dry_run; then
set -x
fi
$sh_c 'apt-get update -qq >/dev/null'
$sh_c "DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $pre_reqs >/dev/null"
$sh_c "curl -fsSL \"$DOWNLOAD_URL/linux/$lsb_dist/gpg\" | apt-key add -qq - >/dev/null"
$sh_c "echo \"$apt_repo\" > /etc/apt/sources.list.d/docker.list"
$sh_c 'apt-get update -qq >/dev/null'
) |
Thanks for the pull request. We'd like to make our product docs better, but haven’t been able to review all the suggestions. If the updates are still relevant, review our contribution guidelines and rebase your pull request against the latest version of the docs, then mark it as fresh with a Prevent pull requests from auto-closing with a /lifecycle stale |
Add some warnings/recommendations for non-LTS Ubuntu releases, and provide instructions for updating the package repository after upgrading.