apt-get upgrade: giving 403 Forbidden error for almost all the links

20,102

Solution 1

You need to fix source.list and switch to country's default repository mirror as it is not permitting you to download packages without authentication. You need to edit file /etc/apt/source.list

sudo nano /etc/apt/source.list

Replace content with following content

###### Ubuntu Main Repos
deb http://in.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse 

###### Ubuntu Update Repos
deb http://in.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse 
deb http://in.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse 

After that you will be able to update and upgrade system

sudo apt update && sudo apt upgrade

Solution 2

  1. Open (or go to) Software & Updates
  2. Click or expand Download from
  3. Choose Other...
  4. Click on Select Best Server - you will see "Testing download servers..."
  5. After it finishes, click on Choose server
  6. Close
  7. Reload
  8. That's it.

Go ahead and run sudo apt-get update.

Share:
20,102

Related videos on Youtube

Pearl Yadav
Author by

Pearl Yadav

Updated on September 18, 2022

Comments

  • Pearl Yadav
    Pearl Yadav over 1 year

    I am a college student and I am getting this error almost for a month. I first thought it was a server error,but I am pretty sure now that it has nothing to do with server as I have tried every server and none of it was profitable.I am using Ubuntu 18.04 LTS for months but this error only presented itself now. Here is my Output for sudo apt-get update :

        Hit:1 http://la-mirrors.evowise.com/ubuntu bionic InRelease                                                                                          
        Ign:2 http://dl.google.com/linux/chrome/deb stable InRelease                                                                                         
        Hit:3 http://ppa.launchpad.net/webupd8team/atom/ubuntu bionic InRelease                                                                              
        Hit:4 https://packages.microsoft.com/repos/vscode stable InRelease                                                                                   
        Hit:5 http://dl.google.com/linux/chrome/deb stable Release                                                                                           
        Hit:6 http://archive.canonical.com/ubuntu zesty InRelease                                                           
        Hit:7 http://dl.winehq.org/wine-builds/ubuntu artful InRelease                                     
        Get:8 http://la-mirrors.evowise.com/ubuntu bionic-updates InRelease [88.7 kB]
        Get:10 http://la-mirrors.evowise.com/ubuntu bionic-backports InRelease [74.6 kB]
        Get:11 http://la-mirrors.evowise.com/ubuntu bionic-security InRelease [83.2 kB]
        Get:12 http://la-mirrors.evowise.com/ubuntu bionic-updates/main i386 Packages [397 kB]                                                               
        Get:13 http://la-mirrors.evowise.com/ubuntu bionic-updates/main amd64 Packages [454 kB]                                                              
        Get:14 http://la-mirrors.evowise.com/ubuntu bionic-updates/main Translation-en [169 kB]                                                              
        Get:15 http://la-mirrors.evowise.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [234 kB]                                                       
        Get:16 http://la-mirrors.evowise.com/ubuntu bionic-updates/main DEP-11 48x48 Icons [52.2 kB]                                                         
        Get:17 http://la-mirrors.evowise.com/ubuntu bionic-updates/main DEP-11 64x64 Icons [99.1 kB]                                                         
        Get:18 http://la-mirrors.evowise.com/ubuntu bionic-updates/universe amd64 Packages [588 kB]                                                          
        Get:19 http://la-mirrors.evowise.com/ubuntu bionic-updates/universe i386 Packages [581 kB]                                                           
        Get:20 http://la-mirrors.evowise.com/ubuntu bionic-updates/universe Translation-en [161 kB]                                                          
        Get:21 http://la-mirrors.evowise.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [195 kB]                                                   
        Get:22 http://la-mirrors.evowise.com/ubuntu bionic-updates/universe DEP-11 48x48 Icons [187 kB]                                                      
        Get:23 http://la-mirrors.evowise.com/ubuntu bionic-updates/universe DEP-11 64x64 Icons [323 kB]                                                      
        Get:24 http://la-mirrors.evowise.com/ubuntu bionic-updates/multiverse amd64 Packages [6,372 B]                                                       
        Get:25 http://la-mirrors.evowise.com/ubuntu bionic-updates/multiverse i386 Packages [6,524 B]                                                        
        Get:26 http://la-mirrors.evowise.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,464 B]                                                
        Get:27 http://la-mirrors.evowise.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [5,812 B]                                                
        Get:28 http://la-mirrors.evowise.com/ubuntu bionic-security/main i386 Packages [168 kB]                                                              
        Get:29 http://la-mirrors.evowise.com/ubuntu bionic-security/main amd64 Packages [218 kB]                                                             
        Get:30 http://la-mirrors.evowise.com/ubuntu bionic-security/main Translation-en [84.0 kB]                                                            
        Get:31 http://la-mirrors.evowise.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [204 B]                                                       
        Get:32 http://la-mirrors.evowise.com/ubuntu bionic-security/universe amd64 Packages [101 kB]                                                         
        Get:33 http://la-mirrors.evowise.com/ubuntu bionic-security/universe i386 Packages [99.8 kB]                                                         
        Get:34 http://la-mirrors.evowise.com/ubuntu bionic-security/universe Translation-en [56.5 kB]                                                        
        Get:35 http://la-mirrors.evowise.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [10.6 kB]                                                 
        Get:36 http://la-mirrors.evowise.com/ubuntu bionic-security/universe DEP-11 48x48 Icons [9,088 B]                                                    
        Get:37 http://la-mirrors.evowise.com/ubuntu bionic-security/universe DEP-11 64x64 Icons [20.1 kB]                                                    
        Get:38 http://la-mirrors.evowise.com/ubuntu bionic-security/multiverse i386 Packages [1,608 B]                                                       
        Get:39 http://la-mirrors.evowise.com/ubuntu bionic-security/multiverse amd64 Packages [1,440 B]                                                      
        Fetched 4,479 kB in 47s (96.3 kB/s)                                                                                                                                         
        Reading package lists... Done
    

    sudo apt-get upgrade :

    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Calculating upgrade... Done
    The following packages have been kept back:
      libgnome-desktop-3-17 linux-generic linux-headers-generic linux-image-generic netplan.io nodejs nodejs-dev wireshark-common wireshark-qt
    The following packages will be upgraded:
      libssh-4 libssh-gcrypt-4 nplan ubuntu-keyring
    4 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
    Need to get 364 kB of archives.
    After this operation, 5,120 B of additional disk space will be used.
    Ign:1 http://la-mirrors.evowise.com/ubuntu bionic-updates/main amd64 ubuntu-keyring all 2018.09.18.1~18.04.0
    Ign:2 http://la-mirrors.evowise.com/ubuntu bionic-updates/main amd64 nplan all 0.40.1~18.04.3
    Ign:3 http://la-mirrors.evowise.com/ubuntu bionic-updates/main amd64 libssh-4 amd64 0.8.0~20170825.94fa1e38-1ubuntu0.2
    Ign:4 http://la-mirrors.evowise.com/ubuntu bionic-updates/main amd64 libssh-gcrypt-4 amd64 0.8.0~20170825.94fa1e38-1ubuntu0.2
    Err:1 http://la-mirrors.evowise.com/ubuntu bionic-updates/main amd64 ubuntu-keyring all 2018.09.18.1~18.04.0
      403  Forbidden [IP: 104.19.137.75 80]
    Err:2 http://la-mirrors.evowise.com/ubuntu bionic-updates/main amd64 nplan all 0.40.1~18.04.3
      403  Forbidden [IP: 104.19.137.75 80]
    Err:3 http://la-mirrors.evowise.com/ubuntu bionic-updates/main amd64 libssh-4 amd64 0.8.0~20170825.94fa1e38-1ubuntu0.2
      403  Forbidden [IP: 104.19.137.75 80]
    Err:4 http://la-mirrors.evowise.com/ubuntu bionic-updates/main amd64 libssh-gcrypt-4 amd64 0.8.0~20170825.94fa1e38-1ubuntu0.2
      403  Forbidden [IP: 104.19.137.75 80]
    E: Failed to fetch http://la-mirrors.evowise.com/ubuntu/pool/main/u/ubuntu-keyring/ubuntu-keyring_2018.09.18.1~18.04.0_all.deb  403  Forbidden [IP: 104.19.137.75 80]
    E: Failed to fetch http://la-mirrors.evowise.com/ubuntu/pool/main/n/netplan.io/nplan_0.40.1~18.04.3_all.deb  403  Forbidden [IP: 104.19.137.75 80]
    E: Failed to fetch http://la-mirrors.evowise.com/ubuntu/pool/main/libs/libssh/libssh-4_0.8.0~20170825.94fa1e38-1ubuntu0.2_amd64.deb  403  Forbidden [IP: 104.19.137.75 80]
    E: Failed to fetch http://la-mirrors.evowise.com/ubuntu/pool/main/libs/libssh/libssh-gcrypt-4_0.8.0~20170825.94fa1e38-1ubuntu0.2_amd64.deb  403  Forbidden [IP: 104.19.137.75 80]
    E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
    

    Sources.list :

    ###### Ubuntu Main Repos
    deb http://in.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse 
    
    ###### Ubuntu Update Repos
    deb http://in.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse 
    deb http://in.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
    

    ls /etc/apt/sources.list.d

    $ ls
    fossproject-ubuntu-ppa-artful.list              pbek-ubuntu-qownnotes-artful.list.distUpgrade  webupd8team-ubuntu-brackets-bionic.list.save
    fossproject-ubuntu-ppa-artful.list.distUpgrade  pbek-ubuntu-qownnotes-artful.list.save         webupd8team-ubuntu-java-artful.list
    fossproject-ubuntu-ppa-artful.list.save         vscode.list                                    webupd8team-ubuntu-java-artful.list.distUpgrade
    google-chrome.list                              vscode.list.save                               webupd8team-ubuntu-java-artful.list.save
    google-chrome.list.distUpgrade                  webupd8team-ubuntu-atom-bionic.list            wireshark-dev-ubuntu-stable-zesty.list
    google-chrome.list.save                         webupd8team-ubuntu-atom-bionic.list.save       wireshark-dev-ubuntu-stable-zesty.list.distUpgrade
    pbek-ubuntu-qownnotes-artful.list               webupd8team-ubuntu-brackets-bionic.list        wireshark-dev-ubuntu-stable-zesty.list.save
    

    I have tried almost everything but nothing helped. I am not dual booting or anything my normal OS is Ubuntu.Please help me...

    • Soren A
      Soren A over 5 years
      Have you tried to select some other repository ?
    • Pearl Yadav
      Pearl Yadav over 5 years
      I am using la-mirrors.evowise.com because in the software centre when i chose Best Server this server shows up. But i Have tried Main Server. I dont have a proxy in apt.conf. I also deleted partially downloaded files but nothing's happening.
    • Pearl Yadav
      Pearl Yadav over 5 years
      How can i select other repos??
    • abu-ahmed al-khatiri
      abu-ahmed al-khatiri over 5 years
      did you update and upgrade your apt, after you edited the list? , if you did it, based from your new sources.list the list of sources.list.d not like that!!!
    • Pearl Yadav
      Pearl Yadav over 5 years
      I have tried to update and upgrade after moving the files of sources.list.d to a temporary location,,,but still no updates on the error.
    • user535733
      user535733 over 5 years
      You are a college student...are you using a school network? If so, looks like you perhaps are not signed in to that network, or are not using that network's required proxy. If so, those would be questions for your network provider (not Ubuntu). If it's a laptop, connect to an off-campus network and see if you get a different result.
    • abu-ahmed al-khatiri
      abu-ahmed al-khatiri over 5 years
    • Pearl Yadav
      Pearl Yadav over 5 years
      No, that method didn't worked for me
    • abu-ahmed al-khatiri
      abu-ahmed al-khatiri over 5 years
      what the output of cat /etc/hosts && cat /etc/resolv.conf
    • Pearl Yadav
      Pearl Yadav over 5 years
      cat /etc/hosts : 127.0.0.1 localhost 127.0.1.1 p3l # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters
    • Pearl Yadav
      Pearl Yadav over 5 years
      cat /etc/resolv.conf : # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN # 127.0.0.53 is the systemd-resolved stub resolver. # run "systemd-resolve --status" to see details about the actual nameservers. nameserver 127.0.0.53 nameserver 8.8.8.8 nameserver 8.8.4.4
    • abu-ahmed al-khatiri
      abu-ahmed al-khatiri over 5 years
      i think that's problem, try to remove your 8.8.8.8 and 8.8.4.4 saved and restart your OS!!
    • Rafael Barros
      Rafael Barros about 5 years
      In my case, my infra admin was blocking the mirror host.
  • Pearl Yadav
    Pearl Yadav over 5 years
    Sorry, not working,Still same errors been showing...
  • Darryl Williams
    Darryl Williams over 5 years
    You should remove other source lists
  • Pearl Yadav
    Pearl Yadav over 5 years
    Where can i Find them?
  • abu-ahmed al-khatiri
    abu-ahmed al-khatiri over 5 years
    @PearlYadav you still have Zesty Repository. change it from deb http://in.archive.ubuntu.com/ubuntu/ zesty main to deb http://in.archive.ubuntu.com/ubuntu/ bionic mainand remove the 3rd-party repository like as mentioned of @KetanPatel
  • Pearl Yadav
    Pearl Yadav over 5 years
    I did...Nothing Happened.
  • Darryl Williams
    Darryl Williams over 5 years
    Check and remove every file which is content in /etc/apt/source.list.d/ directory.
  • Pearl Yadav
    Pearl Yadav over 5 years
    Still..Nothing Changed...
  • Darryl Williams
    Darryl Williams over 5 years
    Can you list content of /etc/apt/source.list and every file of /etc/apt/source.list.d/ directory ?
  • Pearl Yadav
    Pearl Yadav over 5 years
    check my question i edited
  • Darryl Williams
    Darryl Williams over 5 years
    remove each and every third party source list sudo rm -f /etc/apt/source.list.d/*