problem after apt-get update command

9,246

Solution 1

For the GPG errors, run sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF0E1940624A220 40976EAF437D05B5 to import the keys.

For the MergeList problem, run sudo rm /var/lib/apt/lists/*.

Finally, run sudo apt-get update.

Solution 2

To summarise the instructions from saiarcot895 :

For an error like this

W: GPG error: http://archive.ubuntu.com trusty Release:
The following signatures were invalid: BADSIG [ some_number ] 
Ubuntu Archive Automatic Signing Key <[email protected]>

do this - preferably one instruction at a time -

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys [ some_number ]
cd /var/lib/apt
ls -la
sudo mv lists lists_bak
sudo mkdir -p lists/partial
apt-get update

which is roughly

  1. call gpg via apt-key via apt-get, to download a new key
  2. go to where apt keeps its data
  3. look at the data that apt has at the moment
  4. rename the apt cache directory to both back it up and clear the cache
  5. make a new apt cache directory
  6. update the cache of packages that apt knows about
Share:
9,246

Related videos on Youtube

user297975
Author by

user297975

Updated on September 18, 2022

Comments

  • user297975
    user297975 over 1 year

    Recently , i tried to install google earth from Ubuntu tweak . the programme asked me to add the repository of google earth . well,after i do the command i found that an error message that told me that i couldn't add the source and the system can't build packages tree.i run in terminal sudo apt-get update and i found following Errors:

    Fetched 143 kB in 3min 43s (637 B/s)                                           
    Reading package lists... Error!
    W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures were invalid: BADSIG 6AF0E1940624A220 Launchpad PPA for TualatriX
    W: GPG error: http://eg.archive.ubuntu.com trusty-backports Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <[email protected]>
    E: Encountered a section with no Package: header
    E: Problem with MergeList /var/lib/apt/lists/eg.archive.ubuntu.com_ubuntu_dists_trusty_multiverse_i18n_Translation-en%5fUS
    E: The package lists or status file could not be parsed or opened.
    

    I can't launch Ubuntu software center.and a minus mark appear in bar at the top of the screen . please tell me what should i do in steps please.i have Ubuntu 14.04 trusty tahr.

  • user297975
    user297975 almost 10 years
    i get this:E: GPG error: archive.canonical.com trusty InRelease: Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)
  • user297975
    user297975 almost 10 years
    and this:W: GPG error: eg.archive.ubuntu.com trusty-backports Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <[email protected]>
  • user297975
    user297975 almost 10 years
    do they the same solution or not?
  • user297975
    user297975 almost 10 years
    take that too W: Failed to fetch eg.archive.ubuntu.com/ubuntu/dists/trusty/multiverse/i18n/… Connection failed [IP: 91.189.91.13 80]
  • saiarcot895
    saiarcot895 almost 10 years
    @user297975: The GPG warning about the invalid signature should have been gone. For the failed to fetch warning, you can ignore that, since it's just a translation file. For the NODATA error, see here for a possible answer.
  • user297975
    user297975 almost 10 years
    thanks,but if i face another GpG error ,i should type the same command or i should change something.failed to fetch warning does it have any bad effects on the system i face it alot.
  • user297975
    user297975 almost 10 years
    sorry i have tired you. but the problem back again the red mark back ,ubuntu center doesnot work 'apt-get update'output is 'W: Failed to fetch gzip:/var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_d‌​ists_trusty-security‌​_main_source_Sources Hash Sum mismatch'sorryyy again for Disturbance
  • user297975
    user297975 almost 10 years
    gpg error again. it seems to be disease.
  • user297975
    user297975 almost 10 years
    the command about mergelist problem output this'rm: cannot remove ‘/var/lib/apt/lists/eg.archive.ubuntu.com_ubuntu_dists_trust‌​y_multiverse_i18n_Tr‌​anslation-en%5fUS’: No such file or directory'after doing the first command on your answer
  • user297975
    user297975 almost 10 years
    help me anybody.
  • user297975
    user297975 almost 10 years
    it doesn't work in terminal .i went to apt and found a file named lists should i remove all files on it. i can by giving the file the permission from this command chmod 0777 the directory i should remove files which written on html or remove any thing on this file
  • user297975
    user297975 almost 10 years
    i found this in terminal rm: cannot remove ‘/var/lib/apt/lists/partial’: Is a directory
  • saiarcot895
    saiarcot895 almost 10 years
    @user297975: First off, don't change permissions of directories unless you know why you're doing it and that you really need to do it. Second, I had a slight typo in the command I posted in my comment; it should be sudo rm /var/lib/apt/lists/*. Third, the error message is fine; the partial directory can stay.
  • user297975
    user297975 almost 10 years
    thanks , i gave up i install the system again.thanks again for your patience .
  • mc0e
    mc0e over 8 years
    Does downloading the gpg key without checking it open you up to man in the middle attacks? What sort of checking should be performed to be sure that the key you're adding is what it's supposed to be?
  • saiarcot895
    saiarcot895 over 8 years
    @mc0e: It might, under certain circumstances. If you specify only the last 8 hex characters of the key, and there happens to be a collision, you might get the wrong key. But even then, though, the repo will still be considered untrusted because the key you downloaded is a different key. I'm not a security expert, so take what I said with a grain of salt. Also, you might be better off asking/searching over on Information Security.