I've having problem installing vim on my Ubuntu. After running sudo apt-get install vim, I get the following error message:
Ign:1 http://ca.archive.ubuntu.com/ubuntu focal-updates/main amd64 vim-runtime all 2:8.1.2269-1ubuntu5.7
Ign:2 http://ca.archive.ubuntu.com/ubuntu focal-updates/main amd64 vim amd64 2:8.1.2269-1ubuntu5.7
Ign:1 http://ca.archive.ubuntu.com/ubuntu focal-updates/main amd64 vim-runtime all 2:8.1.2269-1ubuntu5.7
Err:2 http://security.ubuntu.com/ubuntu focal-updates/main amd64 vim amd64 2:8.1.2269-1ubuntu5.7
Temporary failure resolving 'ca.archive.ubuntu.com'
Ign:1 http://security.ubuntu.com/ubuntu focal-updates/main amd64 vim-runtime all 2:8.1.2269-1ubuntu5.7
Err:1 http://security.ubuntu.com/ubuntu focal-updates/main amd64 vim-runtime all 2:8.1.2269-1ubuntu5.7
Temporary failure resolving 'ca.archive.ubuntu.com'
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/v/vim/vim-runtime_8.1.2269-1ubuntu5.7_all.deb Temporary failure resolving 'ca.archive.ubuntu.com'
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/v/vim/vim_8.1.2269-1ubuntu5.7_amd64.deb Temporary failure resolving 'ca.archive.ubuntu.com'
E: Unable to fetch some archives, try running apt-get update or apt-get --fix-missing.
While I tried running apt-get update, it gives me this error message:
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
Can anyone help me to look at what is the problem? I would assume it is a permission issue but not sure how to fix it. Thanks.
aptrun withoutsudo. For the first item, you may be able to resolve this by changing which servers your system connects to when updating. I generally use thegb.archive.ubuntu.comservers as they're consistently fast and available ... despite being on the other side of the planet for me – matigo Apr 26 '22 at 00:37