Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

This has happened quite recently. I'm new with Ubuntu, and I'm not using dual boot so my PC only running on Ubuntu. I don't really notice what caused this.

First I can't get complete update, it says here, some index files failed to download. They have been ignored, or old ones used instead.

And then after I install Handbrake using its repository, I get this when I try to update with terminal, I don't remember but something about /etc/lock. I try to look it up but didn't dare to try the methods as they're suggested to kill the lock.

Today I try to update again and I got this:

W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ precise-security/restricted i386 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_precise-security_restricted_binary-i386_Packages)

So what should I do? Whenever I try to update, I get different responses; the lock problem, fail to download some index files, and just now this.

Besides, a few days recently whenever I turn on my PC, the screen says cannot write bytes.

But then the login screen appears and I can use my pc as usual. So is it really bad if i can't update my pc forever? Because I can work without any problem.

share|improve this question

marked as duplicate by Avinash Raj, blade19899, Mitch Feb 27 at 15:38

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
run sudo apt-get update and try again installing handbrake. –  Registered User Feb 27 at 11:56

3 Answers 3

I am sending you the sorces.list file

# deb cdrom:[Ubuntu 12.04.1 LTS _Precise Pangolin_ - Release amd64 (20120823.1)]/ dists/precise/main/binary-i386/

# deb cdrom:[Ubuntu 12.04.1 LTS _Precise Pangolin_ - Release amd64 (20120823.1)]/ dists/precise/restricted/binary-i386/
# deb cdrom:[Ubuntu 12.04.1 LTS _Precise Pangolin_ - Release amd64 (20120823.1)]/ precise main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://in.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://in.archive.ubuntu.com/ubuntu/ precise main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://in.archive.ubuntu.com/ubuntu/ precise-updates main restricted
deb-src http://in.archive.ubuntu.com/ubuntu/ precise-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://in.archive.ubuntu.com/ubuntu/ precise universe
deb-src http://in.archive.ubuntu.com/ubuntu/ precise universe
deb http://in.archive.ubuntu.com/ubuntu/ precise-updates universe
deb-src http://in.archive.ubuntu.com/ubuntu/ precise-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://in.archive.ubuntu.com/ubuntu/ precise multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ precise multiverse
deb http://in.archive.ubuntu.com/ubuntu/ precise-updates multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ precise-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://in.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu precise-security main restricted
deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
deb http://security.ubuntu.com/ubuntu precise-security universe
deb-src http://security.ubuntu.com/ubuntu precise-security universe
deb http://security.ubuntu.com/ubuntu precise-security multiverse
deb-src http://security.ubuntu.com/ubuntu precise-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu precise partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu precise main
deb http://old-releases.ubuntu.com/ubuntu hardy main multiverse
deb-src http://old-releases.ubuntu.com/ubuntu hardy main multiverse
deb http://old-releases.ubuntu.com/ubuntu hardy-updates main multiverse
deb-src http://old-releases.ubuntu.com/ubuntu hardy-updates main multiverse
deb http://archive.canonical.com/ lucid partner
deb-src http://archive.canonical.com/ lucid partner
deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main

first login as super user then go to

cd /etc/apt/

there you will get a file named sources.list then type

vi sources.list

pess Esc and write 2000 dd this will remove all the content of the file and then copy the above content and press ctrl+Shift+c then press Esc :qw and hit enter. now you can easyly upgrade your pc.

share|improve this answer

I saw this in the forums with someone else who was having this issue, almost near the bottom is what he tried and he said it worked.

http://ubuntuforums.org/showthread.php?t=1811635

Let me know if this works for you.

share|improve this answer

If you are getting error some index files failed to download, try to change the server by going

System setting -> Software and Updates and reload.

enter image description here

If you are getting this problem with any third party ppa, it may happen that that ppa is down or does not exist.

To disable those ppa, select Other software tab disable those ppaenter image description here Also you can purge such ppa using command line :sudo add-apt-repository --remove ppa:somename/ppa

Second about lock. I think you are getting this error about lock Could not get lock /var/lib/dpkg/lock. If "yes" , then it happens when you already running a package manager and try to run another one. For example synaptic is running and at the same time trying to install using apt-get from terminal.

To remove duplicate sources.list entry see here

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.