ubuntu: add instructions for updating package repositories
Add some warnings/recommendations for non-LTS Ubuntu releases, and provide instructions for updating the package repository after upgrading.
@usha-mandya @seemethere @StefanScherer ptal 🤗
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 < [email protected]> wrote:
@thaJeztah commented on this pull request.
In install/linux/docker-ce/ubuntu.md https://github.com/docker/docker.github.io/pull/10285#discussion_r378954682 :
+shows that
aptis configured to install packages for Ubuntudisco(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 theadd-apt-repository --removecommand:
+```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 https://github.com/docker/docker.github.io/pull/10285?email_source=notifications&email_token=AAM7HV2PW36NMTRAK37TVIDRCVVDBA5CNFSM4KUPFMLKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCVN5PIY#discussion_r378954682, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM7HV6WF3OTJDPNBQ66MILRCVVDBANCNFSM4KUPFMLA .
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)
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'
)
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
@thaJeztah I think we can close this PR considering its age. Wdyt?