apt-get update error - Could not handshake

Asked by Daniel Groff

vagrant@controlplane:~$ ubuntu-support-status || ubuntu-security-status

cat /etc/dpkg/dpkg.cfg.d/multiarch

dpkg --print-foreign-architectures

sudo grep -R roxy /etc/apt/*

grep roxy /etc/environment

echo $http_proxy

echo $ftp_proxy

grep roxy /etc/bash.bashrc

grep roxy ~/.bashrc

cat /etc/apt/apt.conf

sudo fuser -vvv /var/lib/dpkg/lock

sudo fuser -vvv /var/cache/apt/archives/lock

cat /etc/lsb-release

uname -a

sudo rm /var/lib/apt/lists/lock

sudo dpkg --auditme '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;etatus.0 /var/lib/dpkg/stat
ubuntu-support-status: command not found
This command has been replaced with 'pro security-status'.
589 packages installed:
    0 packages from Ubuntu Main/Restricted repository
    589 packages no longer available for download

To get more information about the packages, run
    pro security-status --help
for a list of available options.

This machine is receiving security patching for Ubuntu Main/Restricted
repository until 2027.
This machine is NOT attached to an Ubuntu Pro subscription.

Ubuntu Pro with 'esm-infra' enabled provides security updates for
Main/Restricted packages until 2032.

Try Ubuntu Pro with a free personal subscription on up to 5 machines.
Learn more at https://ubuntu.com/pro

cat: /etc/dpkg/dpkg.cfg.d/multiarch: No such file or directory
i386

cat: /etc/apt/apt.conf: No such file or directory
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.4 LTS"
Linux controlplane 5.15.0-119-generic #129-Ubuntu SMP Fri Aug 2 19:25:20 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
cp: cannot stat '/var/lib/dpkg/status-old': No such file or directory
cp: cannot stat '/var/backups/dpkg.status.0': No such file or directory
cp: cannot stat '/var/lib/dpkg/available-old': No such file or directory
Reading package lists... Error!
E: flAbsPath on /var/lib/dpkg/status failed - realpath (2: No such file or directory)
W: Target Packages (stable/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list:1 and /etc/apt/sources.list.d/docker.list:1
W: Target Packages (stable/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list:1 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (stable/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list:1 and /etc/apt/sources.list.d/docker.list:1
W: Target CNF (stable/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list:1 and /etc/apt/sources.list.d/docker.list:1
W: Target CNF (stable/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list:1 and /etc/apt/sources.list.d/docker.list:1
E: Could not open file - open (2: No such file or directory)
E: Problem opening
E: The package lists or status file could not be parsed or opened.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Ign:1 https://download.docker.com/linux/ubuntu jammy InRelease
Ign:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:1 https://download.docker.com/linux/ubuntu jammy InRelease
Ign:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:1 https://download.docker.com/linux/ubuntu jammy InRelease
Ign:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Err:1 https://download.docker.com/linux/ubuntu jammy InRelease
  Could not handshake: The TLS connection was non-properly terminated. [IP: 65.9.112.80 443]
Err:2 http://archive.ubuntu.com/ubuntu jammy InRelease
  Connection failed [IP: 185.125.190.82 80]
Err:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
  Connection failed [IP: 91.189.91.82 80]
Err:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
  Connection failed [IP: 91.189.91.81 80]
Err:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
  Connection failed [IP: 185.125.190.83 80]
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease Connection failed [IP: 185.125.190.82 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease Connection failed [IP: 91.189.91.81 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease Connection failed [IP: 185.125.190.83 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease Connection failed [IP: 91.189.91.82 80]
W: Failed to fetch https://download.docker.com/linux/ubuntu/dists/jammy/InRelease Could not handshake: The TLS connection was non-properly terminated. [IP: 65.9.112.80 443]
W: Some index files failed to download. They have been ignored, or old ones used instead.
W: Target Packages (stable/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list:1 and /etc/apt/sources.list.d/docker.list:1
W: Target Packages (stable/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list:1 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (stable/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list:1 and /etc/apt/sources.list.d/docker.list:1
W: Target CNF (stable/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list:1 and /etc/apt/sources.list.d/docker.list:1
W: Target CNF (stable/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list:1 and /etc/apt/sources.list.d/docker.list:1
Ign:1 https://download.docker.com/linux/ubuntu jammy InRelease
Ign:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:1 https://download.docker.com/linux/ubuntu jammy InRelease
Ign:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:1 https://download.docker.com/linux/ubuntu jammy InRelease
Ign:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Get:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB]
Ign:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Err:1 https://download.docker.com/linux/ubuntu jammy InRelease
  Could not handshake: Error in the pull function. [IP: 65.9.112.80 443]
Err:2 http://archive.ubuntu.com/ubuntu jammy InRelease
  Connection failed [IP: 185.125.190.83 80]
Err:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
  Connection failed [IP: 91.189.91.82 80]
Err:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
  Connection failed [IP: 91.189.91.81 80]
Err:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
  Error reading from server - read (104: Connection reset by peer) [IP: 185.125.190.83 80]
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease Connection failed [IP: 185.125.190.83 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease Connection failed [IP: 91.189.91.81 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease Error reading from server - read (104: Connection reset by peer) [IP: 185.125.190.83 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease Connection failed [IP: 91.189.91.82 80]
W: Failed to fetch https://download.docker.com/linux/ubuntu/dists/jammy/InRelease Could not handshake: Error in the pull function. [IP: 65.9.112.80 443]
W: Some index files failed to download. They have been ignored, or old ones used instead.
W: Target Packages (stable/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list:1 and /etc/apt/sources.list.d/docker.list:1
W: Target Packages (stable/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list:1 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (stable/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list:1 and /etc/apt/sources.list.d/docker.list:1
W: Target CNF (stable/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list:1 and /etc/apt/sources.list.d/docker.list:1
W: Target CNF (stable/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list:1 and /etc/apt/sources.list.d/docker.list:1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

/etc/apt/sources.list.d/docker.list

     1 deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu jammy stable

/etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list

     1 deb [arch=amd64] https://download.docker.com/linux/ubuntu jammy stable
     2 # deb-src [arch=amd64] https://download.docker.com/linux/ubuntu jammy stable

/etc/apt/sources.list.d/passbolt.list

     1

/etc/apt/sources.list

     1 ## Note, this file is written by cloud-init on first boot of an instance
     2 ## modifications made here will not survive a re-bundle.
     3 ## if you wish to make changes you can:
     4 ## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
     5 ## or do the same in user-data
     6 ## b.) add sources in /etc/apt/sources.list.d
     7 ## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl
     8
     9 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
    10 # newer versions of the distribution.
    11 deb http://archive.ubuntu.com/ubuntu jammy main restricted
    12 # deb-src http://archive.ubuntu.com/ubuntu jammy main restricted
    13
    14 ## Major bug fix updates produced after the final release of the
    15 ## distribution.
    16 deb http://archive.ubuntu.com/ubuntu jammy-updates main restricted
    17 # deb-src http://archive.ubuntu.com/ubuntu jammy-updates main restricted
    18
    19 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    20 ## team. Also, please note that software in universe WILL NOT receive any
    21 ## review or updates from the Ubuntu security team.
    22 deb http://archive.ubuntu.com/ubuntu jammy universe
    23 # deb-src http://archive.ubuntu.com/ubuntu jammy universe
    24 deb http://archive.ubuntu.com/ubuntu jammy-updates universe
    25 # deb-src http://archive.ubuntu.com/ubuntu jammy-updates universe
    26
    27 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    28 ## team, and may not be under a free licence. Please satisfy yourself as to
    29 ## your rights to use the software. Also, please note that software in
    30 ## multiverse WILL NOT receive any review or updates from the Ubuntu
    31 ## security team.
    32 deb http://archive.ubuntu.com/ubuntu jammy multiverse
    33 # deb-src http://archive.ubuntu.com/ubuntu jammy multiverse
    34 deb http://archive.ubuntu.com/ubuntu jammy-updates multiverse
    35 # deb-src http://archive.ubuntu.com/ubuntu jammy-updates multiverse
    36
    37 ## N.B. software from this repository may not have been tested as
    38 ## extensively as that contained in the main release, although it includes
    39 ## newer versions of some applications which may provide useful features.
    40 ## Also, please note that software in backports WILL NOT receive any review
    41 ## or updates from the Ubuntu security team.
    42 deb http://archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse
    43 # deb-src http://archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse
    44
    45 deb http://security.ubuntu.com/ubuntu jammy-security main restricted
    46 # deb-src http://security.ubuntu.com/ubuntu jammy-security main restricted
    47 deb http://security.ubuntu.com/ubuntu jammy-security universe
    48 # deb-src http://security.ubuntu.com/ubuntu jammy-security universe
    49 deb http://security.ubuntu.com/ubuntu jammy-security multiverse
    50 # deb-src http://security.ubuntu.com/ubuntu jammy-security multiverse

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Solved by:
Daniel Groff
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

sudo rm /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-jammy.list
sudo apt update

Does this help?

Revision history for this message
Daniel Groff (daniigrof) said (last edit ):
#2

Still no.

Revision history for this message
Bernard Stafford (bernard010) said (last edit ):
#3

Have you tried: sudo apt autoremove

Or change update server from the main to united states server ?
Software & Updates icon

Revision history for this message
Daniel Groff (daniigrof) said :
#4

Yes this is fix the issue.

Solution:
    1. sudo vi /etc/apt/sources.list
    2. Change all http://archive.ubuntu.com/ubuntu to http://us.archive.ubuntu.com/ubuntu.
       (Don't touch http://security.ubuntu.com/ubuntu links)

Thank You very match.