0

I think I've damaged my Ubuntu installation, as now it is not recognising some terminal commands such as ufw/glances (which are already installed). The result is as follows.

-bash: ufw: command not found

Also sudo apt update --fix-missing is not not working, as it gives the following results.

Err:1 http://security.ubuntu.com/ubuntu focal-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:2 http://lk.archive.ubuntu.com/ubuntu focal InRelease                                                       
  Temporary failure resolving 'lk.archive.ubuntu.com'
Err:3 http://gb.archive.ubuntu.com/ubuntu bionic InRelease                                                      
  Temporary failure resolving 'gb.archive.ubuntu.com'
Err:4 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease      
  Temporary failure resolving 'ppa.launchpad.net'
Err:5 http://lk.archive.ubuntu.com/ubuntu focal-updates InRelease
  Temporary failure resolving 'lk.archive.ubuntu.com'
Err:6 http://ppa.launchpad.net/gluster/glusterfs-3.12/ubuntu focal InRelease
  Temporary failure resolving 'ppa.launchpad.net'
Err:7 http://lk.archive.ubuntu.com/ubuntu focal-backports InRelease
  Temporary failure resolving 'lk.archive.ubuntu.com'
Err:8 http://ppa.launchpad.net/gluster/glusterfs-6/ubuntu focal InRelease
  Temporary failure resolving 'ppa.launchpad.net'
Reading package lists... Done       
Building dependency tree       
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://lk.archive.ubuntu.com/ubuntu/dists/focal/InRelease  Temporary failure resolving 'lk.archive.ubuntu.com'
W: Failed to fetch http://lk.archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  Temporary failure resolving 'lk.archive.ubuntu.com'
W: Failed to fetch http://lk.archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease  Temporary failure resolving 'lk.archive.ubuntu.com'W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Temporary failure resolving 'gb.archive.ubuntu.com'
W: Failed to fetch http://ppa.launchpad.net/deadsnakes/ppa/ubuntu/dists/focal/InRelease  Temporary failure resolving 'ppa.launchpad.net'
W: Failed to fetch http://ppa.launchpad.net/gluster/glusterfs-3.12/ubuntu/dists/focal/InRelease  Temporary failure resolving 'ppa.launchpad.net'
W: Failed to fetch http://ppa.launchpad.net/gluster/glusterfs-6/ubuntu/dists/focal/InRelease  Temporary failure resolving 'ppa.launchpad.net'
W: Some index files failed to download. They have been ignored, or old ones used instead.

This happened when I tried to downgrade the python version from 3.8 to 3.5 to run a specific programme, in ubuntu 20.2. I only saw the comments not recommending the procedures a little late, which was too late at the moment.

Couple of notes: my path is as follows (and it contains bin, /usr/bin and /usr/local/bin)

/home/chameera/.local/bin:/opt/lib/mpich/bin:/opt/lib/netcdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • using wget, cannot download any file, but can ssh into and out of the machine, as well as transfer files
  • ping to 8.8.8.8 responds, but doesn't respond to www.google.com
  • sudo dpkg --configure -a does not generate any output after clearing the lock files in sudo rm /var/lib/apt/lists/lock, sudo rm /var/lib/dpkg/lock, sudo rm /var/lib/dpkg/lock-frontend, sudo rm /var/lib/apt/lists/* -vf

I have not yet rebooted the machine as it is a remote machine and a little bit worried to do so, fearing that I may loose access to it again until I physically recover the machine. I would be so grateful if any of you can help me out in this regard.

Thank you so much in advance!

  • There is no Ubuntu 20.02 release (ie. no release in 2020-February), so I'd check your details. I'd suggest reversing your changes; as many tools in Ubuntu require python3 to be the default version it comes with; otherwise you're limited to base tools only (ie. no higher level tools like apt or apt-get...) FYI: wget should still work, as should dpkg - however many user-level tools you normally use to correct networking issues may not work until you correct the python3 issue. You ping issue highlights DNS issues; correct manually if needs be. You should not clean lock files! – guiverc Jul 08 '22 at 11:33

1 Answers1

1

You need to undo your downgrade of python, I'm not sure how you did it.

After that is fixed, I would recommend either using Anaconda to manage other python versions (never touch system python!) or installing CPython separately in another directory tree, such as /opt/python/<version>. With the latter option, you can use Environment Modules or Lmod to swap software versions in and out easily, similarly to python virtual environments or conda environments.

jamie
  • 11