Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thaJeztah
Copy link
Member

Add some warnings/recommendations for non-LTS Ubuntu releases, and provide instructions for updating the package repository after upgrading.

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>
@thaJeztah thaJeztah added the area/engine Issue affects Docker engine/daemon label Feb 13, 2020
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"
Copy link
Member Author

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.

Copy link
Contributor

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 😅😇).

Copy link
Member Author

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?

Copy link
Contributor

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).

@thaJeztah
Copy link
Member Author

@usha-mandya @seemethere @StefanScherer ptal 🤗

@seemethere
Copy link
Contributor

seemethere commented Feb 13, 2020 via email

@thaJeztah
Copy link
Member Author

Yes, I was surprised add-apt-repository doesn't do that (I found some posts indicating that that's what it would do as well)

@seemethere
Copy link
Contributor

seemethere commented Feb 13, 2020

Yeah the only file that needs to be changed is the /etc/apt/sources.list.d/docker.list

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

https://github.com/docker/docker-install/blob/3674c8a1294892f11798c857f46ed20baed37396/install.sh#L348-L358

			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'
			)

@docker-robott
Copy link
Collaborator

Thanks for the pull request. We'd like to make our product docs better, but haven’t been able to review all the suggestions.
As our docs have also diverged, we do not have the bandwidth to review and rebase old pull requests.

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 /remove-lifecycle stale comment.
If not, this pull request will be closed in 30 days. This helps our maintainers focus on the active pull requests.

Prevent pull requests from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/engine Issue affects Docker engine/daemon lifecycle/frozen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants