我在 Ubuntu 上安装 vim 时遇到问题。运行后sudo apt-get install vim
,我收到以下错误消息:
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.
当我尝试运行时apt-get update
,它给出了以下错误消息:
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)
有人能帮我看看问题出在哪里吗?我认为这是权限问题,但不确定如何解决。谢谢。