Score:0

apt-get update giving error in Ubuntu 18.04

cn flag

I am new to Linux, using Ubuntu 18.04. Whenever I try sudo apt-get update, I get these errors: (Btw I referred to this link - apt-get update says E: Sub-process returned an error code , and tried the suggestions but that didnt work for me. Please help me resolve this.

Hit:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]                                                                                                   
Hit:3 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease                                                                                                           
Ign:4 http://ppa.launchpad.net/kazam-team/stable-series/ubuntu bionic InRelease                                                                                                
Hit:5 http://download.virtualbox.org/virtualbox/debian bionic InRelease                                                                                                        
Get:6 https://repo.skype.com/deb stable InRelease [4,502 B]                                                                                                                    
Hit:7 http://archive.canonical.com/ubuntu bionic InRelease                                                                                                                     
Hit:8 http://dl.google.com/linux/chrome/deb stable InRelease                                                                                                                   
Hit:9 https://linux.teamviewer.com/deb stable InRelease                                                                                                                        
Get:10 http://in.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [1,309 kB]                                                                                        
Get:11 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2,126 kB]                                                                                       
Get:12 http://in.archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [421 kB]                                                                                         
Get:13 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [294 kB]                                                                         
Get:14 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,738 kB]                                                                          
Get:14 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,738 kB]                                                                          
Get:14 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,738 kB]                                                                                   
Hit:17 http://ppa.launchpad.net/rednotebook/stable/ubuntu bionic InRelease                                                                                                     
Hit:18 https://packages.microsoft.com/repos/ms-teams stable InRelease                                                                                                          
Hit:19 http://security.ubuntu.com/ubuntu bionic-security InRelease                                                                                                             
Err:6 https://repo.skype.com/deb stable InRelease                                                                                                                              
  The following signatures were invalid: EXPKEYSIG 1F3045A5DF7587C3 Skype Linux Client Repository <[email protected]>
Err:14 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages                                                                                              
  Hash Sum mismatch
  Hashes of expected file:
   - Filesize:1738296 [weak]
   - SHA256:b5b33b5f2f03553cfed3fdc4b49de56337e3478683084543e41c4c454ce33b83
   - SHA1:b73196ca99d1b4fc678e0cf813e25afaf9a84b11 [weak]
   - MD5Sum:384518af35538afb3103cb07b3c18b71 [weak]
  Hashes of received file:
   - SHA256:47fc2f4ec9c048bba09b6874b8b4d5602ba5248897a6c349e8b0338be8023929
   - SHA1:aff42a04536ae004cf2b5b66eb2f9f112ee13add [weak]
   - MD5Sum:b6d999f607cb1426fb1c590a6bc353bb [weak]
   - Filesize:1738296 [weak]
  Last modification reported: Sat, 26 Jun 2021 00:41:53 +0000
  Release file created at: Sat, 26 Jun 2021 00:41:00 +0000
Get:20 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [1,568 kB]                                                                                    
Err:21 http://ppa.launchpad.net/kazam-team/stable-series/ubuntu bionic Release                                                         
  404  Not Found [IP: 91.189.95.85 80]
Err:20 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages                                                    
  
Hit:23 https://packagecloud.io/slacktechnologies/slack/debian jessie InRelease                                                      
Get:22 https://packagecloud.io/shiftkey/desktop/any any InRelease [23.2 kB]
Err:22 https://packagecloud.io/shiftkey/desktop/any any InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7E65990E879472F
sh: 1: /usr/lib/cnf-update-db: not found
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://repo.skype.com/deb stable InRelease: The following signatures were invalid: EXPKEYSIG 1F3045A5DF7587C3 Skype Linux Client Repository <[email protected]>
E: The repository 'http://ppa.launchpad.net/kazam-team/stable-series/ubuntu bionic 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.
W: GPG error: https://packagecloud.io/shiftkey/desktop/any any InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7E65990E879472F
E: The repository 'https://packagecloud.io/shiftkey/desktop/any any InRelease' is not signed.
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: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code
Score:0
zw flag

You have to fix several issues:

  • Hash sum mismatch is fixable by

    sudo rm -rf /var/lib/apt/lists/*
    
  • Skype GPG key should be updated by

    sudo apt-key del 1F3045A5DF7587C3
    wget https://repo.skype.com/data/SKYPE-GPG-KEY -O - | sudo apt-key add -
    
  • Kazam PPA does not publish packages for Ubuntu 18.04 LTS (bionic), so should be disabled by

    sudo apt-get update
    sudo apt-get install software-properties-common
    sudo add-apt-repository -r ppa:kazam-team/stable-series
    
  • Packagecloud GPG should be updated by

    wget https://packagecloud.io/shiftkey/desktop/gpgkey -O - | sudo apt-key add -
    
  • Broken /usr/lib/cnf-update-db, reinstall it with

    sudo apt-get install --reinstall command-not-found
    sudo apt-get install -f
    sudo dpkg --configure -a
    

Then finally run sudo apt-get update and it should work.

Tanushree Banerjee avatar
cn flag
@NOrbert thanks for the reply. It worked fine till the curl line. For Kazam, when I try to disable I get this sudo: unable to execute /usr/bin/add-apt-repository: No such file or directory. Similarly updating GPG key didnt work. It says : . 'Connecting to packagecloud.io (packagecloud.io)|54.183.216.24|:443... connected. HTTP request sent, awaiting response... 401 Unauthorized Username/Password Authentication Failed.' gpg: no valid OpenPGP data found.
N0rbert avatar
zw flag
Answer updated.
Tanushree Banerjee avatar
cn flag
Thanks for the update, I tried from the beginning again, all commands. Typing the 3rd line for Skype GPG key.. GPG key is done --'2021-06-26 14:38:46 (125 MB/s) - ‘SKYPE-GPG-KEY’ saved [1787/1787] But at the end it says 'gpg: no valid OpenPGP data found'
Tanushree Banerjee avatar
cn flag
Therefore next when I do sudo-apt-get update, automatically I get the same error again ---> E: Sub-process returned an error code @N0rbert
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.