Ubuntu – Ubuntu 19.04 incorrect sources.list

19.04aptupgradewindows-subsystem-for-linux

I did an upgrade of Ubuntu on WSL from 18.10 to 19.04 with do-release-upgrade.

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="19.04 (Disco Dingo)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 19.04"
VERSION_ID="19.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=disco
UBUNTU_CODENAME=disco

But now I notice that repositories/sources.list are still pointing to cosmic.

$ grep -li cosmic /etc/apt/sources.list /etc/apt/sources.list* /etc/apt/sources.list*/*
/etc/apt/sources.list
/etc/apt/sources.list
grep: /etc/apt/sources.list.d: Is a directory
/etc/apt/sources.list.distUpgrade
/etc/apt/sources.list.save


$ grep -li disco /etc/apt/sources.list /etc/apt/sources.list* /etc/apt/sources.list*/*
grep: /etc/apt/sources.list.d: Is a directory 

So I guess something must have failed during the upgrade that I didn't notice.

How can I dig out any upgrade errors and fix them?
Where can I find the sources list for 19.04?

Best Answer

  • Where can I find the sources list for 19.04?

    Steps required:

    • Run these commands in WSL console only. Otherwise, the file/folder permissions will be incorrect. Also, use chmod to correct any file permission.
    • Open Ubuntu cloud image website: https://cloud-images.ubuntu.com/releases/19.04/release/
    • Download the ubuntu-19.04-server-cloudimg-amd64-root.TAR.XZ file. Because it is smaller than others ;)
    • Extract the /etc/apt folder with tar -xvf ubuntu-19.04-server-cloudimg-amd64-root.tar.xz etc/apt command. Do not add the leading slash in the folder path.
    • Now copy the sources.list file or any other required files as you need.
  • Related Question