Syed Jahanzaib Personal Blog to Share Knowledge !

October 9, 2013

Ubuntu apt-get not working


Ubuntu


Salam Alaekum,

If you are having trouble using apt-get in Ubuntu 12.4  As showed in the image below . . .

1- apt

then try below solutions …


Solution # 1  (Updated 5th-NOV-2021]

Edit the existing apt source file

nano /etc/apt/sources.list

Remove all entries & use paste below

deb http://old-releases.ubuntu.com/ubuntu/ precise main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ precise main restricted
deb http://old-releases.ubuntu.com/ubuntu/ precise-updates main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ precise-updates main restricted
deb http://old-releases.ubuntu.com/ubuntu/ precise universe
deb-src http://old-releases.ubuntu.com/ubuntu/ precise universe
deb http://old-releases.ubuntu.com/ubuntu/ precise-updates universe
deb-src http://old-releases.ubuntu.com/ubuntu/ precise-updates universe
deb http://old-releases.ubuntu.com/ubuntu/ precise multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ precise multiverse
deb http://old-releases.ubuntu.com/ubuntu/ precise-updates multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ precise-updates multiverse
deb http://old-releases.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu precise-security main restricted
deb-src http://old-releases.ubuntu.com/ubuntu precise-security main restricted
deb http://old-releases.ubuntu.com/ubuntu precise-security universe
deb-src http://old-releases.ubuntu.com/ubuntu precise-security universe
deb http://old-releases.ubuntu.com/ubuntu precise-security multiverse
deb-src http://old-releases.ubuntu.com/ubuntu precise-security multiverse

Save & Exit & update

apt-get update

Solution # 2

sudo rm /var/lib/apt/lists/* -vf
sudo apt-get clean
sudo apt-get autoremove
sudo apt-get dist-upgrade
sudo apt-get update --fix-missing
sudo apt-get update

Solution # 3

Run below cmd

sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

& try to update now

 apt-get update 

Hopefully the issue will be solved : )

As shown in the image below . . .

2- apt


 

Regard’s
Syed Jahanzaib

 

14 Comments »

  1. assalamualaikum..terima kasih banyak sangat membantu

    Like

    Comment by alibunker — October 11, 2013 @ 12:31 PM

  2. Sir…….Assalaaam o Alekom…..
    Sir…………thanks apt-get working But apt-get install dnsmasq is not woking ………..
    In your squid configuration …..! first= apt-get install dnsmasq and 2nd apt-get update.
    can i change the steps……? first= apt-get update and 2nd apt-get install dnsmasq
    do i change these steps . will any problem create squid server…..?
    ALLAH aap ko JAZAEKHAIR dey………..

    Like

    Comment by Waqar — October 12, 2013 @ 2:16 PM

  3. thnx sir jahanzaib … aagar aap nhn hote to humara kiya hota……

    Like

    Comment by Haji Amad Soomro — October 21, 2013 @ 9:48 PM

  4. Thx Sir. your this page Helps alot and fixed ma isue

    Like

    Comment by Ash — November 27, 2013 @ 1:11 AM

  5. Thanks dear this really solved my problem.

    Like

    Comment by M. Shoaib arain — December 16, 2013 @ 3:42 PM

  6. which previous line do u mean when u say ” Remove all previous lines and add following lines ” ?

    Like

    Comment by sq — May 25, 2014 @ 10:52 PM

  7. Err http://pk.archive.ubuntu.com saucy-updates InRelease

    Err http://pk.archive.ubuntu.com saucy-backports InRelease

    Err http://pk.archive.ubuntu.com saucy Release.gpg
    Unable to connect to pk.archive.ubuntu.com:http:
    Err http://pk.archive.ubuntu.com saucy-updates Release.gpg
    Unable to connect to pk.archive.ubuntu.com:http:
    Err http://pk.archive.ubuntu.com saucy-backports Release.gpg
    Unable to connect to pk.archive.ubuntu.com:http:
    Fetched 401 kB in 2min 0s (3,331 B/s)
    Reading package lists… Done
    W: Failed to fetch http://pk.archive.ubuntu.com/ubuntu/dists/saucy/InRelease

    W: Failed to fetch http://pk.archive.ubuntu.com/ubuntu/dists/saucy-updates/InRelease

    W: Failed to fetch http://pk.archive.ubuntu.com/ubuntu/dists/saucy-backports/InRelease

    W: Failed to fetch http://pk.archive.ubuntu.com/ubuntu/dists/saucy/Release.gpg Unable to connect to pk.archive.ubuntu.com:http:

    W: Failed to fetch http://pk.archive.ubuntu.com/ubuntu/dists/saucy-updates/Release.gpg Unable to connect to pk.archive.ubuntu.com:http:

    W: Failed to fetch http://pk.archive.ubuntu.com/ubuntu/dists/saucy-backports/Release.gpg Unable to connect to pk.archive.ubuntu.com:http:

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

    Like

    Comment by sq — May 25, 2014 @ 11:06 PM

  8. how do i fix this issue?

    Like

    Comment by sq — May 25, 2014 @ 11:06 PM

  9. AoA!
    Dear Sir
    I’m facing following error
    W: Failed to fetch http://pk.archive.ubuntu.com/ubuntu/dist/bionic/InRelease Could not resolve ‘pk.archive.ubuntu.com’
    W: Failed to fetch http://pk.archive.ubuntu.com/ubuntu/dist/bionic-updates/InRelease Could not resolve ‘pk.archive.ubuntu.com’
    W: Failed to fetch http://pk.archive.ubuntu.com/ubuntu/dist/bionic-proposed/InRelease Could not resolve ‘pk.archive.ubuntu.com’
    W: Failed to fetch http://pk.archive.ubuntu.com/ubuntu/dist/bionic-backports/InRelease Could not resolve ‘pk.archive.ubuntu.com’
    W: Failed to fetch http://pk.archive.ubuntu.com/ubuntu/dist/bionic-security/InRelease Could not resolve ‘pk.archive.ubuntu.com’
    W: Some index files failed to download. They have been ignored, or old ones used instead.
    W: Target Sources (main/source/Sources) is configured multiple times in etc/apt/sources.list:19 and /etc/apt/source.list:29
    W: Target Sources (resstricted/source/Sources) is configured multiple times in etc/apt/sources.list:19 and /etc/apt/source.list:29
    W: Target Sources (universe/source/Sources) is configured multiple times in etc/apt/sources.list:19 and /etc/apt/source.list:29
    W: Target Sources (multiverse/source/Sources) is configured multiple times in etc/apt/sources.list:19 and /etc/apt/source.list:29

    Like

    Comment by Aziz Ullah — November 6, 2019 @ 11:27 AM

  10. Ubuntu Linux 12.04 sources.list worked

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

    ## Major bug fix updates produced after the final release of the
    ## distribution.
    deb http://old-releases.ubuntu.com/ubuntu/ precise-updates main restricted
    deb-src http://old-releases.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://old-releases.ubuntu.com/ubuntu/ precise universe
    deb-src http://old-releases.ubuntu.com/ubuntu/ precise universe
    deb http://old-releases.ubuntu.com/ubuntu/ precise-updates universe
    deb-src http://old-releases.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://old-releases.ubuntu.com/ubuntu/ precise multiverse
    deb-src http://old-releases.ubuntu.com/ubuntu/ precise multiverse
    deb http://old-releases.ubuntu.com/ubuntu/ precise-updates multiverse
    deb-src http://old-releases.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://old-releases.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
    deb-src http://old-releases.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse

    deb http://old-releases.ubuntu.com/ubuntu precise-security main restricted
    deb-src http://old-releases.ubuntu.com/ubuntu precise-security main restricted
    deb http://old-releases.ubuntu.com/ubuntu precise-security universe
    deb-src http://old-releases.ubuntu.com/ubuntu precise-security universe
    deb http://old-releases.ubuntu.com/ubuntu precise-security multiverse
    deb-src http://old-releases.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://old-releases.ubuntu.com/ubuntu precise partner
    # deb-src http://old-releases.ubuntu.com/ubuntu precise partner

    ## Uncomment the following two lines to add software from Ubuntu’s
    ## ‘extras’ repository.
    ## This software is not part of Ubuntu, but is offered by third-party
    ## developers who want to ship their latest software.
    # deb http://old-releases.ubuntu.com/ubuntu precise main
    # deb-src http://old-releases.ubuntu.com/ubuntu precise main

    Like

    Comment by Serkan Erdogdu — October 5, 2021 @ 5:30 AM


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: