0

while running sudo apt-get install packagename i got this error. apt-get: /lib/i386-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /usr/lib/i386-linux-gnu/libapt-pkg.so.5.0)

The output of " cat /etc/apt/sources.list" is:
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse

while running dpkg -l libapt*

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
un  libapt-inst    <none>       <none>       (no description available)
ii  libapt-inst1.4 0.8.16~exp12 i386         deb package format runtime librar
rc  libapt-inst1.5 1.0.1ubuntu2 i386         deb package format runtime librar
ii  libapt-inst2.0 1.6.6        i386         deb package format runtime librar
un  libapt-pkg     <none>       <none>       (no description available)
ii  libapt-pkg-per 0.1.33build1 i386         Perl interface to libapt-pkg
ii  libapt-pkg4.12 1.0.1ubuntu2 i386         package management runtime librar
ii  libapt-pkg5.0: 1.7.0ubuntu0 i386         package management runtime librar

cat /etc/lsb-release
DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=bionic DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"

  • 1
    You have 16.04 repository in your sources.list. – Pilot6 Feb 22 '19 at 16:55
  • I'm very confused by what I'm seeing here: Your repositories are from Xenial (16.04), your kernel may be from Xenial-HWE or Bionic, you have loaded packages from Bionic(18.04) (according to a comment on the answer) and you're system is looking for packages from Cosmic (18.10) – Charles Green Feb 22 '19 at 16:58
  • @Pilot6 Any thoughts on how someone could get into this situation? – Charles Green Feb 22 '19 at 16:59
  • The problem started when i was dealing with docker installation for 18.04.i was pasting the command sudo apt install apt-transport-https. – ANUSHA GEORGE Feb 22 '19 at 17:01
  • @CharlesGreen There are so many ways to shoot in your foot. I am not quite sure that OP has 18.04. What does cat /etc/lsb-release show? – Pilot6 Feb 22 '19 at 17:02

1 Answers1

0

You have 16.04 repository set in your sources.list file.

I suggest to remove that file by

sudo rm /etc/apt/sources.list

Then run

software-properties-gtk

and check there repositories like main, universe, etc.

That should create a new sources.list file with bionic reposiories instead of xenial.

Another way is to run sudo nano /etc/apt/sources.list

and paste there this text

deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse  
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse

Then save it by Ctrl+O and exit by Ctrl+X.

Run sudo apt update.

Pilot6
  • 90,100
  • 91
  • 213
  • 324
  • I fear this may run deeper than that - the version of libapt_pkg5.0 that is running, is from cosmic – Charles Green Feb 22 '19 at 17:10
  • deleted the sources.list file.but for the second command i got the same error. – ANUSHA GEORGE Feb 22 '19 at 17:10
  • Yeah, but we can at least start from here. Then we can see. – Pilot6 Feb 22 '19 at 17:11
  • ubuntu:~$ software-properties-gtk Traceback (most recent call last): File "/usr/lib/command-not-found", line 28, in from CommandNotFound import CommandNotFound File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 19, in from CommandNotFound.db.db import SqliteDatabase File "/usr/lib/python3/dist-packages/CommandNotFound/db/db.py", line 5, in import apt_pkg ImportError: /lib/i386-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /usr/lib/i386-linux-gnu/libapt-pkg.so.5.0) – ANUSHA GEORGE Feb 22 '19 at 17:11
  • See the update. There is another way of fixing it. – Pilot6 Feb 22 '19 at 17:15
  • no changes when following above commands.Same error shows after editing sources.list – ANUSHA GEORGE Feb 22 '19 at 17:15
  • I have no idea how you got there. You broke lots of things in your system. – Pilot6 Feb 22 '19 at 17:17
  • reinstalling OS is only way? – ANUSHA GEORGE Feb 22 '19 at 17:17
  • It's obviously the easiest way. For the future don't run commands found in the net when you are not sure what they are supposed to do. – Pilot6 Feb 22 '19 at 17:18
  • Yea.I realised the same.Thanks a lot for your support. – ANUSHA GEORGE Feb 22 '19 at 17:19