• 7
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Ubuntu14.04 - unable to apt-get update

sudo apt-get update

returns some erors :

W: Failed to fetch http:// archive.ubuntu.com/ubuntu/dists/trusty/Release Unable to find expected entry 'restricted/source/Sources' in Release file (Wrong sources.list entry or malformed file)

W: Failed to fetch http:// archive.ubuntu.com/ubuntu/dists/trusty-security/main/binary-amd64/Packages Hash Sum mismatch

W: Failed to fetch http:// archive.ubuntu.com/ubuntu/dists/trusty-security/universe/binary-amd64/Packages Hash Sum mismatch

W: Failed to fetch http:// archive.ubuntu.com/ubuntu/dists/trusty-security/main/binary-i386/Packages Hash Sum mismatch

W: Failed to fetch http:// archive.ubuntu.com/ubuntu/dists/trusty-security/main/i18n/Translation-en Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead.

it seems to happen with the ubuntu official repo. Any idea why ?

For information, my sources.list is the following :

#----------------------------------------------------------#
#      OFFICIAL UBUNTU REPO                                #
#----------------------------------------------------------#


###### Ubuntu Main Repos
deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse

###### Ubuntu Update Repos
deb http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse

###### Ubuntu Partner Repo
deb http://archive.canonical.com/ubuntu trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner

###### Ubuntu Extras Repo
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main

#------------------------------------------------------------------------------#
#                           UNOFFICIAL UBUNTU REPOS                            #
#------------------------------------------------------------------------------#


###### 3rd Party Binary Repos

#### MongoDB - http://www.mongodb.org/
## Run this command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen

The problem may comes from your /etc/resolv.conf file, check if you have some nameserver directives on it and try to ping archive.ubuntu.com

Here is my resolv.conf :

domain local
search local

nameserver 8.8.8.8
nameserver 8.8.4.4

I use Google's public dns (https://developers.google.com/speed/public-dns/)

Then try apt-get update

  • 3
Reply Report
    • For precision's sake, i didnt directly edited the resolv.conf file because, as mentionned on the top line for ubuntu14.04, this would have been overriden. I instead edited etc/resolvconf/resolv.conf.d/head then run the command sudo resolvconf -u
      • 2
    • I have looked for this solution across the internet, your way was the best, fastest and easiest. it is much appreciated from a very new linux guy

It detected some files it got were outdated or corrupted, so they were unusable. Remove cached files by rm -rf /var/lib/apt/lists/* and try again apt-get update.

If the problem persists, maybe a caching proxy somewhere are still holding old or broken content. apt-get update -o Acquire::http::No-Cache=True might help in this case.

  • 1
Reply Report

Are you behind proxy? If yes then you have to go to /etc/apt/apt.conf file and modify that file as follows.

Acquire::http::proxy "http://username:password@proxyaddress:portnumber/";
Acquire::https::proxy "https://username:password@proxyaddress:8080/";
  • 0
Reply Report

I was having the same problem, but the only solution work out in this problem for me is:

Backup your sources list sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

Open the sources file /etc/apt/sources.list and rename all the instances of us.archive from

http://us.archive.ubuntu.com/ubuntu/

to

http://old-releases.ubuntu.com/ubuntu/

Run sudo apt-get update after that.

  • 0
Reply Report

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags