"file not found "error in terminal and cann't update and download packages

Asked by lucky singh

 ubuntu-support-status
Support status summary of 'lucken99':

You have 1687 packages (98.3%) supported until April 2021 (5y)
You have 26 packages (1.5%) supported until February 2022 (5y)

You have 0 packages (0.0%) that can not/no-longer be downloaded
You have 4 packages (0.2%) that are unsupported

Run with --show-unsupported, --show-supported or --show-all to see more details
lucky@lucken99:~$ cat /etc/dpkg/dpkg.cfg.d/multiarch
cat: /etc/dpkg/dpkg.cfg.d/multiarch: No such file or directory
lucky@lucken99:~$ dpkg --print-foreign-architectures
i386
lucky@lucken99:~$ sudo grep -R roxy /etc/apt/*
[sudo] password for lucky:
lucky@lucken99:~$ grep roxy /etc/environment
lucky@lucken99:~$ echo $http_proxy
http://user:password@host:port/
lucky@lucken99:~$ echo $ftp_proxy
http://user:pass@host:port/
lucky@lucken99:~$ grep roxy /etc/bash.bashrc
#proxy
export http_proxy=http://user:password@host:port/
export ftp_proxy=http://user:pass@host:port/
lucky@lucken99:~$ grep roxy ~/.bashrc
lucky@lucken99:~$ cat /etc/apt/apt.conf
cat: /etc/apt/apt.conf: No such file or directory
lucky@lucken99:~$ sudo fuser -vvv /var/lib/dpkg/lock
lucky@lucken99:~$ sudo fuser -vvv /var/cache/apt/archives/lock
lucky@lucken99:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.2 LTS"
lucky@lucken99:~$ uname -a
Linux lucken99 4.8.0-36-generic #36~16.04.1-Ubuntu SMP Sun Feb 5 09:39:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
lucky@lucken99:~$ sudo rm /var/lib/apt/lists/lock
lucky@lucken99:~$ sudo rm /var/cache/apt/archives/lock
lucky@lucken99:~$ sudo rm /var/lib/dpkg/lock
lucky@lucken99:~$ sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
lucky@lucken99:~$ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
lucky@lucken99:~$ sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status || sudo cp /var/backups/apt.extended_states.0 /var/lib/dpkg/status
lucky@lucken99:~$ sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-bad
lucky@lucken99:~$ sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
cp: cannot stat '/var/lib/dpkg/available-old': No such file or directory
lucky@lucken99:~$ sudo rm -rf /var/lib/dpkg/updates/*
lucky@lucken99:~$ sudo rm -rf /var/lib/apt/lists
lucky@lucken99:~$ sudo rm /var/cache/apt/*.bin
lucky@lucken99:~$ sudo mkdir /var/lib/apt/lists
lucky@lucken99:~$ sudo mkdir /var/lib/apt/lists/partial
lucky@lucken99:~$ LANG=C;sudo apt-get clean
lucky@lucken99:~$ LANG=C;sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
lucky@lucken99:~$ sudo dpkg --configure -a
lucky@lucken99:~$ sudo dpkg --clear-avail
lucky@lucken99:~$ LANG=C;sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
lucky@lucken99:~$ LANG=C;sudo apt-get --fix-missing install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
lucky@lucken99:~$ LANG=C;sudo apt-get --purge autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
lucky@lucken99:~$ LANG=C;sudo apt-get --fix-missing update -o APT::Cache-Limit=100000000
Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
0% [Working]^C
lucky@lucken99:~$ LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000 && sudo apt-get dist-upgrade
Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease
  Temporary failure resolving 'archive.ubuntu.com'
0% [Connecting to archive.ubuntu.com]^C
lucky@lucken99:~$ find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;

/etc/apt/sources.list

     1 # deb cdrom:[Ubuntu 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2)]/ xenial main restricted
     2
     3 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
     4 # newer versions of the distribution.
     5 deb http://archive.ubuntu.com/ubuntu xenial main restricted
     6 # deb-src http://in.archive.ubuntu.com/ubuntu/ xenial main restricted
     7
     8 ## Major bug fix updates produced after the final release of the
     9 ## distribution.
    10 deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted
    11 # deb-src http://in.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
    12
    13 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    14 ## team. Also, please note that software in universe WILL NOT receive any
    15 ## review or updates from the Ubuntu security team.
    16 deb http://archive.ubuntu.com/ubuntu xenial universe
    17 # deb-src http://in.archive.ubuntu.com/ubuntu/ xenial universe
    18 deb http://archive.ubuntu.com/ubuntu xenial-updates universe
    19 # deb-src http://in.archive.ubuntu.com/ubuntu/ xenial-updates universe
    20
    21 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    22 ## team, and may not be under a free licence. Please satisfy yourself as to
    23 ## your rights to use the software. Also, please note that software in
    24 ## multiverse WILL NOT receive any review or updates from the Ubuntu
    25 ## security team.
    26 deb http://archive.ubuntu.com/ubuntu xenial multiverse
    27 # deb-src http://in.archive.ubuntu.com/ubuntu/ xenial multiverse
    28 deb http://archive.ubuntu.com/ubuntu xenial-updates multiverse
    29 # deb-src http://in.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
    30
    31 ## N.B. software from this repository may not have been tested as
    32 ## extensively as that contained in the main release, although it includes
    33 ## newer versions of some applications which may provide useful features.
    34 ## Also, please note that software in backports WILL NOT receive any review
    35 ## or updates from the Ubuntu security team.
    36 deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
    37 # deb-src http://in.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
    38
    39 ## Uncomment the following two lines to add software from Canonical's
    40 ## 'partner' repository.
    41 ## This software is not part of Ubuntu, but is offered by Canonical and the
    42 ## respective vendors as a service to Ubuntu users.
    43 # deb http://archive.canonical.com/ubuntu xenial partner
    44 # deb-src http://archive.canonical.com/ubuntu xenial partner
    45
    46 deb http://archive.ubuntu.com/ubuntu xenial-security main restricted
    47 # deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
    48 deb http://archive.ubuntu.com/ubuntu xenial-security universe
    49 # deb-src http://security.ubuntu.com/ubuntu xenial-security universe
    50 deb http://archive.ubuntu.com/ubuntu xenial-security multiverse
    51 # deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
lucky@lucken99:~$ sudo dpkg --audit

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#2

Do you have to use a proxy server to access the internet?

You seem to have a nonsense proxy definition in your configuration files which prevents the package management programs to find the repositories.

lucky@lucken99:~$ grep roxy /etc/bash.bashrc
#proxy
export http_proxy=http://user:password@host:port/
export ftp_proxy=http://user:pass@host:port/

Revision history for this message
lucky singh (lucken99) said :
#3

how to change it?

Revision history for this message
lucky singh (lucken99) said :
#4

i cann't change it.
there is no option for "open as root"
and also cann't install gksu for the root priviledge

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

Try the following:

Open a terminal window (e.g. by simultaneously pressing ctrl-alt-t) and issue the command
sudo gedit /etc/bash.bashrc
This should ask for your password (as conformation for an administrative action) and open an editor with the bashrc configuration file loaded.
Put comment indicators ('#') in front of the two proxy definition lines, making them

# export http_proxy=http://user:password@host:port/
# export ftp_proxy=http://user:pass@host:port/

save the file and close the editor.
Then logoff and logon again and re-run the package management troubleshooting procedure. Paste all output as a new comment into this question document.

Can you help with this problem?

Provide an answer of your own, or ask lucky singh for more information if necessary.

To post a message you must log in.