Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Cannot apt update since upgrade to Stretch

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
amichaut
Posts: 6
Joined: 2017-06-20 22:24

Cannot apt update since upgrade to Stretch

#1 Post by amichaut »

Hi,

I am not quite new to Debian but it was my first major version upgrade. I didn't know what to do and I might have messed up with apt sources.
I upgraded by replacing jessie by strecth in /etc/apt/sources.list by running:

Code: Select all

sed -i 's|jessie|stretch|' /etc/apt/sources.list
apt update
apt full-upgrade
The upgrade was fine, however I can't run apt update anymore. I get the following error and the process gets stuck at 0% afterwards:

Code: Select all

Ign:2 http://ftp.us.debian.org/debian stretch InRelease
Get:3 http://ftp.us.debian.org/debian stretch-updates InRelease [88.5 kB]
Err:4 http://ftp.us.debian.org/debian stretch Release                    
  Bad header line Bad header data [IP: 64.50.233.100 80]
Get:5 http://security.debian.org stretch/updates InRelease [62.9 kB]
0% [Working]  
Here is my apt lists directory:

Code: Select all

amichaut@debian:/var/lib/apt/lists$ ll
total 108848
drwxr-xr-x 3 root root     4096 Jun 19 18:23 .
drwxr-xr-x 5 root root     4096 Jun 20 10:20 ..
-rw-r--r-- 1 root root      996 Jun 12 05:28 desktop-download.mendeley.com_download_apt_dists_stable_main_binary-amd64_Packages
-rw-r--r-- 1 root root     1934 Jun 12 05:28 desktop-download.mendeley.com_download_apt_dists_stable_Release
-rw-r--r-- 1 root root      490 Jun 12 05:28 desktop-download.mendeley.com_download_apt_dists_stable_Release.gpg
-rw-r--r-- 1 root root 38880082 Jun 17 04:23 ftp.us.debian.org_debian_dists_stretch_main_binary-amd64_Packages
-rw-r--r-- 1 root root  4723194 Jun 16 10:33 ftp.us.debian.org_debian_dists_stretch_main_dep11_Components-amd64.yml.gz
-rw-r--r-- 1 root root  6804014 Jun 16 10:32 ftp.us.debian.org_debian_dists_stretch_main_dep11_icons-64x64.tar.gz
-rw-r--r-- 1 root root 26436445 Jun 18 04:11 ftp.us.debian.org_debian_dists_stretch_main_i18n_Translation-en
-rw-r--r-- 1 root root 33712242 Jun 17 04:23 ftp.us.debian.org_debian_dists_stretch_main_source_Sources
-rw-r--r-- 1 root root   113425 Jun 17 04:46 ftp.us.debian.org_debian_dists_stretch_Release
-rw-r--r-- 1 root root     3108 Jun 17 05:45 ftp.us.debian.org_debian_dists_stretch_Release.gpg
-rw-r--r-- 1 root root    88481 Jun 19 16:48 ftp.us.debian.org_debian_dists_stretch-updates_InRelease
-rw-r----- 1 root root        0 Nov  4  2015 lock
-rw-r--r-- 1 root root    23521 Jun  7 20:13 packagecloud.io_slacktechnologies_slack_debian_dists_jessie_InRelease
-rw-r--r-- 1 root root    29879 Jun  7 20:13 packagecloud.io_slacktechnologies_slack_debian_dists_jessie_main_binary-amd64_Packages
drwx------ 2 _apt root     4096 Jun 20 19:05 partial
-rw-r--r-- 1 root root    62912 Jun 19 18:01 security.debian.org_dists_stretch_updates_InRelease
-rw-r--r-- 1 root root   213998 Jun 19 11:30 security.debian.org_dists_stretch_updates_main_binary-amd64_Packages
-rw-r--r-- 1 root root   119814 Jun 19 11:30 security.debian.org_dists_stretch_updates_main_i18n_Translation-en
-rw-r--r-- 1 root root   187277 Jun 19 11:30 security.debian.org_dists_stretch_updates_main_source_Sources
I can't find an helpful answer and I don't want to mess with it any further by mv some directories.

Thanks for your help!

User avatar
eor2004
Posts: 251
Joined: 2013-10-01 22:49
Location: Puerto Rico
Has thanked: 4 times
Been thanked: 5 times

Re: Cannot apt update since upgrade to Stretch

#2 Post by eor2004 »

Hi, your souces.list looks a little weird to me, this is how an official debian repos should look like:

debian:~$ inxi -r
Repos: Active apt sources in file: /etc/apt/sources.list
deb http://ftp.us.debian.org/debian/ stretch main contrib non-free
deb-src http://ftp.us.debian.org/debian/ stretch main contrib non-free
deb http://security.debian.org/ stretch/updates main contrib non-free
deb-src http://security.debian.org/ stretch/updates main contrib non-free
deb http://ftp.us.debian.org/debian/ stretch-updates main contrib non-free
deb-src http://ftp.us.debian.org/debian/ stretch-updates main contrib non-free

I think that maybe you have to fix your sources.list.
Debian 12 Gnome on a MSI H61M-P25 (B3) PC & on a Dell Latitude E6410 & HP EliteBook 8540p Laptops.
LMDE 6 on a Panasonic ToughBook CF-C1 Laptop.
Bodhi Linux 7 on a HP Compaq DC5750 Small Form Factor PC.
Windows 11 on a Intel DH55TC PC.

amichaut
Posts: 6
Joined: 2017-06-20 22:24

Re: Cannot apt update since upgrade to Stretch

#3 Post by amichaut »

Thanks for your help!

Changing my sources.list with your suggestion doesn't remove the error and it keeps on being blocked a bit further:

Code: Select all

Ign:1 http://ftp.us.debian.org/debian stretch InRelease
Get:2 http://ftp.us.debian.org/debian stretch-updates InRelease [88.5 kB]
Err:3 http://ftp.us.debian.org/debian stretch Release                          
  Bad header line Bad header data [IP: 64.50.236.52 80]
Get:5 http://security.debian.org stretch/updates InRelease [62.9 kB]       
Ign:6 http://security.debian.org stretch/updates/non-free Sources
Get:7 http://security.debian.org stretch/updates/non-free amd64 Packages [1,272 B]
Get:8 http://security.debian.org stretch/updates/non-free Translation-en [481 B]
Get:6 http://security.debian.org stretch/updates/non-free Sources [701 B]
0% [Working]   

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: Cannot apt update since upgrade to Stretch

#4 Post by stevepusser »

Maybe it's a subtle typo--can you cut and paste the example into your sources.list to see how it works?
MX Linux packager and developer

amichaut
Posts: 6
Joined: 2017-06-20 22:24

Re: Cannot apt update since upgrade to Stretch

#5 Post by amichaut »

That's what I did my /etc/apt/sources.list is now:

Code: Select all

deb http://ftp.us.debian.org/debian/ stretch main contrib non-free
deb-src http://ftp.us.debian.org/debian/ stretch main contrib non-free
deb http://security.debian.org/ stretch/updates main contrib non-free
deb-src http://security.debian.org/ stretch/updates main contrib non-free
deb http://ftp.us.debian.org/debian/ stretch-updates main contrib non-free
deb-src http://ftp.us.debian.org/debian/ stretch-updates main contrib non-free

User avatar
orythem27
Posts: 252
Joined: 2017-05-11 07:59
Location: P.R. China

Re: Cannot apt update since upgrade to Stretch

#6 Post by orythem27 »

Install apt-transport-https and switch to a mirror that actually support https (and use https after that), see if that helps. Don't know about ftp.us.debian.org, but in my country a number of mirrors support https.

amichaut
Posts: 6
Joined: 2017-06-20 22:24

Re: Cannot apt update since upgrade to Stretch

#7 Post by amichaut »

Sorry but I don't know what you mean by
switch to a mirror that actually support https
Thanks for the help!

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Cannot apt update since upgrade to Stretch

#8 Post by GarryRicketson »

They mean exactly what they said, use a mirror that supports https
If you do not undertsand or know the difference between http and https,
try :
what you mean by use https

User avatar
orythem27
Posts: 252
Joined: 2017-05-11 07:59
Location: P.R. China

Re: Cannot apt update since upgrade to Stretch

#9 Post by orythem27 »

amichaut wrote:Sorry but I don't know what you mean by switch to a mirror that actually support https
My speculation is that you are suffering from ISP caching/hijacking, if this is the case, use https could help.

It seems that "ftp.us.debian.org" supports https. (Not all mirrors do) You could follow these steps to switch:

1. Install the package apt-transport-https. If you are unable to use apt due to not being able to refresh package list, download the package manually and install manually.

2. Replace all "http://" with "https://" in /etc/apt/sources.list

3. Clear existing package lists in /var/lib/apt/lists/ and /var/lib/apt/lists/partial/

4. apt update

amichaut
Posts: 6
Joined: 2017-06-20 22:24

Re: Cannot apt update since upgrade to Stretch

#10 Post by amichaut »

Thanks!

I get the following new errors:

Code: Select all

Ign:1 https://ftp.us.debian.org/debian stretch InRelease
Ign:3 https://ftp.us.debian.org/debian stretch-updates InRelease
Err:4 https://ftp.us.debian.org/debian stretch Release
  gnutls_handshake() failed: The TLS connection was non-properly terminated.
Ign:5 https://security.debian.org stretch/updates InRelease
Err:6 https://ftp.us.debian.org/debian stretch-updates Release
  gnutls_handshake() failed: The TLS connection was non-properly terminated.
Ign:2 https://desktop-download.mendeley.com/download/apt stable InRelease
Get:7 https://desktop-download.mendeley.com/download/apt stable Release [1,934 B]
Get:8 https://desktop-download.mendeley.com/download/apt stable Release.gpg [490 B]
Err:9 https://security.debian.org stretch/updates Release
  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
Get:10 https://desktop-download.mendeley.com/download/apt stable/main amd64 Packages [598 B]
Get:11 https://packagecloud.io/slacktechnologies/slack/debian jessie InRelease [23.5 kB]
Get:12 https://packagecloud.io/slacktechnologies/slack/debian jessie/main amd64 Packages [6,946 B]
Reading package lists... Done
E: The repository 'https://ftp.us.debian.org/debian stretch Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://ftp.us.debian.org/debian stretch-updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://security.debian.org stretch/updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Wheelerof4te
Posts: 1454
Joined: 2015-08-30 20:14

Re: Cannot apt update since upgrade to Stretch

#11 Post by Wheelerof4te »

Please read this very carefully:

https://wiki.debian.org/SourcesList

Be sure to have your sources list clean. Debian is not Ubuntu, there are no PPA's for Debian. Third party repos are not supported.

amichaut
Posts: 6
Joined: 2017-06-20 22:24

Re: Cannot apt update since upgrade to Stretch

#12 Post by amichaut »

Many thanks!!
Switching from ftp.us.debian.org to deb.debian.org did the trick.
I don't know exactly why but this worked out!

Post Reply