Kali Linux Rolling - apt-get upgrade: failed to fetch 404 not found

I'm trying to update my linux packages but I get the following error:

# apt-get update
Ign:1 http://ftp.be.debian.org/debian wheezy InRelease
Hit:2 http://ftp.be.debian.org/debian wheezy Release
Hit:4 http://ftp2.nluug.nl/os/Linux/distr/kali kali-rolling InRelease
Reading package lists... Done
# apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  cadaver cups-bsd cups-client curl empathy exim4-daemon-light gir1.2-networkmanager-1.0
  gir1.2-totem-1.0 glib-networking iptables ldap-utils libavformat-ffmpeg56 libct4 libcups2
  libcupsimage2 libcurl3-gnutls libgadu3 libgnomevfs2-0 libgnustep-base1.24 libgnutls-openssl27
  libimobiledevice6 libldap-2.4-2 libmagickcore-6.q16-2-extra libneon27-gnutls libnm-gtk-common
  libnm-gtk0 libnm-util2 libnm0 libopencv-calib3d2.4v5 libopencv-contrib2.4v5 libopencv-core2.4v5
  libopencv-features2d2.4v5 libopencv-flann2.4v5 libopencv-highgui2.4v5 libopencv-imgproc2.4v5
  libopencv-legacy2.4v5 libopencv-ml2.4v5 libopencv-objdetect2.4v5 libopencv-video2.4v5
  libpython3-stdlib librtmp1 libsybdb5 libvncclient1 libvte-2.91-0 libvte-2.91-common
  libwireshark6 libzmq3 netsniff-ng network-manager network-manager-gnome ntfs-3g pack
  python-netlib python-pycurl python3 python3-minimal telepathy-gabble telepathy-salut totem
  totem-plugins tshark vino vlc vlc-nox vpnc wget wireshark-common wireshark-qt
  xserver-xorg-video-all
The following packages will be upgraded:
  gir1.2-packagekitglib-1.0 gnuplot5-data gnuplot5-qt libpackagekit-glib2-18 nano packagekit
  packagekit-tools set xserver-common xserver-xephyr xserver-xorg-core xserver-xorg-input-evdev
  xserver-xorg-input-mouse xserver-xorg-input-synaptics xserver-xorg-input-vmmouse
  xserver-xorg-input-wacom xserver-xorg-legacy xserver-xorg-video-ati xserver-xorg-video-fbdev
  xserver-xorg-video-intel xserver-xorg-video-nouveau xserver-xorg-video-qxl
  xserver-xorg-video-radeon xserver-xorg-video-vesa xserver-xorg-video-vmware xwayland
26 upgraded, 0 newly installed, 0 to remove and 69 not upgraded.
Need to get 55.1 MB/58.6 MB of archives.
After this operation, 108 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Err:1 http://http.kali.org/kali kali-rolling/main amd64 nano amd64 2.5.1-1
  404  Not Found
Err:2 http://http.kali.org/kali kali-rolling/main amd64 libpackagekit-glib2-18 amd64 1.0.11-2
  404  Not Found
Err:3 http://http.kali.org/kali kali-rolling/main amd64 gir1.2-packagekitglib-1.0 amd64 1.0.11-2
  404  Not Found
Err:4 http://http.kali.org/kali kali-rolling/main amd64 gnuplot5-qt amd64 5.0.2+dfsg1-2
  404  Not Found
Err:5 http://http.kali.org/kali kali-rolling/main amd64 gnuplot5-data all 5.0.2+dfsg1-2
  404  Not Found
Err:6 http://http.kali.org/kali kali-rolling/main amd64 packagekit-tools amd64 1.0.11-2
  404  Not Found
Err:7 http://http.kali.org/kali kali-rolling/main amd64 packagekit amd64 1.0.11-2
  404  Not Found
Err:8 http://http.kali.org/kali kali-rolling/main amd64 xserver-common all 2:1.18.0-3
  404  Not Found
Err:9 http://http.kali.org/kali kali-rolling/main amd64 xserver-xephyr amd64 2:1.18.0-3
  404  Not Found
Err:10 http://http.kali.org/kali kali-rolling/main amd64 xserver-xorg-legacy amd64 2:1.18.0-3
  404  Not Found
Err:11 http://http.kali.org/kali kali-rolling/main amd64 xserver-xorg-core amd64 2:1.18.0-3
  404  Not Found
Err:12 http://http.kali.org/kali kali-rolling/main amd64 xwayland amd64 2:1.18.0-3
  404  Not Found
Err:13 http://http.kali.org/kali kali-rolling/main amd64 set all 7.0.3.3-0kali1
  404  Not Found
E: Failed to fetch http://http.kali.org/kali/pool/main/n/nano/nano_2.5.1-1_amd64.deb  404  Not Found

E: Failed to fetch http://http.kali.org/kali/pool/main/p/packagekit/libpackagekit-glib2-18_1.0.11-2_amd64.deb  404  Not Found

E: Failed to fetch http://http.kali.org/kali/pool/main/p/packagekit/gir1.2-packagekitglib-1.0_1.0.11-2_amd64.deb  404  Not Found

E: Failed to fetch http://http.kali.org/kali/pool/main/g/gnuplot5/gnuplot5-qt_5.0.2+dfsg1-2_amd64.deb  404  Not Found

E: Failed to fetch http://http.kali.org/kali/pool/main/g/gnuplot5/gnuplot5-data_5.0.2+dfsg1-2_all.deb  404  Not Found

E: Failed to fetch http://http.kali.org/kali/pool/main/p/packagekit/packagekit-tools_1.0.11-2_amd64.deb  404  Not Found

E: Failed to fetch http://http.kali.org/kali/pool/main/p/packagekit/packagekit_1.0.11-2_amd64.deb  404  Not Found

E: Failed to fetch http://http.kali.org/kali/pool/main/x/xorg-server/xserver-common_1.18.0-3_all.deb  404  Not Found

E: Failed to fetch http://http.kali.org/kali/pool/main/x/xorg-server/xserver-xephyr_1.18.0-3_amd64.deb  404  Not Found

E: Failed to fetch http://http.kali.org/kali/pool/main/x/xorg-server/xserver-xorg-legacy_1.18.0-3_amd64.deb  404  Not Found

E: Failed to fetch http://http.kali.org/kali/pool/main/x/xorg-server/xserver-xorg-core_1.18.0-3_amd64.deb  404  Not Found

E: Failed to fetch http://http.kali.org/kali/pool/main/x/xorg-server/xwayland_1.18.0-3_amd64.deb  404  Not Found

E: Failed to fetch http://http.kali.org/kali/pool/main/s/set/set_7.0.3.3-0kali1_all.deb  404  Not Found

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

I tried the following commands in this order but it didn't help.

  • sudo apt-get clean
  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get update --fix-broken
  • sudo apt-get dist-upgrade

sources.list:

# 

# deb cdrom:[Debian GNU/Linux 2016.1 _Kali-rolling_ - Official Snapshot amd64 LIVE/INSTALL Binary 2$

# deb cdrom:[Debian GNU/Linux 2016.1 _Kali-rolling_ - Official Snapshot amd64 LIVE/INSTALL Binary 2$

deb http://http.kali.org/kali kali-rolling main non-free contrib

deb-src http://http.kali.org/kali kali-rolling main non-free contrib

deb http://ftp.be.debian.org/debian/ wheezy main

Also my key list is up to date (as far as I can see).

# apt-key list
/etc/apt/trusted.gpg
--------------------
pub   4096R/1804772E 2014-11-24
uid                  Emdebian Toolchain Archive (signing key)

/etc/apt/trusted.gpg.d/debian-archive-jessie-automatic.gpg
----------------------------------------------------------
pub   4096R/2B90D010 2014-11-21 [expires: 2022-11-19]
uid                  Debian Archive Automatic Signing Key (8/jessie) <[email protected]>

/etc/apt/trusted.gpg.d/debian-archive-jessie-security-automatic.gpg
-------------------------------------------------------------------
pub   4096R/C857C906 2014-11-21 [expires: 2022-11-19]
uid                  Debian Security Archive Automatic Signing Key (8/jessie) <[email protected]>

/etc/apt/trusted.gpg.d/debian-archive-jessie-stable.gpg
-------------------------------------------------------
pub   4096R/518E17E1 2013-08-17 [expires: 2021-08-15]
uid                  Jessie Stable Release Key <[email protected]>

/etc/apt/trusted.gpg.d/debian-archive-squeeze-automatic.gpg
-----------------------------------------------------------
pub   4096R/473041FA 2010-08-27 [expires: 2018-03-05]
uid                  Debian Archive Automatic Signing Key (6.0/squeeze) <[email protected]>

/etc/apt/trusted.gpg.d/debian-archive-squeeze-stable.gpg
--------------------------------------------------------
pub   4096R/B98321F9 2010-08-07 [expires: 2017-08-05]
uid                  Squeeze Stable Release Key <[email protected]>

/etc/apt/trusted.gpg.d/debian-archive-wheezy-automatic.gpg
----------------------------------------------------------
pub   4096R/46925553 2012-04-27 [expires: 2020-04-25]
uid                  Debian Archive Automatic Signing Key (7.0/wheezy) <[email protected]>

/etc/apt/trusted.gpg.d/debian-archive-wheezy-stable.gpg
-------------------------------------------------------
pub   4096R/65FFB764 2012-05-08 [expires: 2019-05-07]
uid                  Wheezy Stable Release Key <[email protected]>

/etc/apt/trusted.gpg.d/kali-archive-keyring.gpg
-----------------------------------------------
pub   4096R/7D8D0BF6 2012-03-05 [expires: 2018-02-02]
uid                  Kali Linux Repository <[email protected]>
sub   4096R/FC0D0DCB 2012-03-05 [expires: 2018-02-02]

Everything was working fine but today randomly when trying to upgrade packages it gives that error. I can still install other software though. Does anyone knows how I can fix this?


Solution 1:

I used

deb http://repo.kali.org/kali kali-rolling main non-free contrib

deb-src http://repo.kali.org/kali kali-rolling main non-free contrib

for sources instead of the original ones. It worked like a charm.

Solution 2:

According to the Kali Linux Official Documentation, the sources.list file should contain the following line(s):

deb http://http.kali.org/kali kali-rolling main contrib non-free
# For source package access, uncomment the following line
# deb-src http://http.kali.org/kali kali-rolling main contrib non-free

(changing/updating my sources.list file accordingly, fixed this issue for me)