Syed Jahanzaib Personal Blog to Share Knowledge !

October 9, 2013

Ubuntu apt-get not working


ubuntu-logo

Salam Alaekum,

Recently Ubuntu pk archive source stopped working, means no update, no packages can be installed using apt-get install command. probably some issues in pk archive. but later found out issue was something else.

As showed in the image below . . .

1- apt


Solution # 1

Execute following commands (or copy paste to terminal , make sure you are logged in with root)


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 # 2 (if above soluiton #1 does not work)

Use the following sources.list as a workaround.

nano /etc/apt/sources.list

Remove all previous lines and add following lines.


 


# Ubuntu apt-get update not working at various PK locations
# Use US base sources as a workaround, they work pretty good  : )
# Syed Jahanzaib , aacable@hotmail.com
# https://aacable.wordpress.com

deb http://us.archive.ubuntu.com/ubuntu/ lucid main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid main restricted
deb http://us.archive.ubuntu.com/ubuntu/ lucid-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid-updates main restricted
deb http://us.archive.ubuntu.com/ubuntu/ lucid universe
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid universe
deb http://us.archive.ubuntu.com/ubuntu/ lucid-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ lucid multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid multiverse
deb http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
deb http://security.ubuntu.com/ubuntu lucid-security main restricted
deb-src http://security.ubuntu.com/ubuntu lucid-security main restricted
deb http://security.ubuntu.com/ubuntu lucid-security universe
deb-src http://security.ubuntu.com/ubuntu lucid-security universe
deb http://security.ubuntu.com/ubuntu lucid-security multiverse
deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse

Save and Exit the file. now issue following update command


apt-get update

Hopefully the issue will be solved : )

As showed in the image below . . .

2- apt

Regard’s
Syed Jahanzaib

Advertisements

10 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


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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: