我正在尝试安装 vi 和 vim
我最初安装了 vi,但无法安装 vim,然后我删除了 vi,现在我无法同时安装两者。
我看了互联网上的所有线程,说你应该更新、卸载或清除,然后重新安装,但没有一个工作。
以下是日志:
[root@artik ~]# apt-get install vi.tiny
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package vi.tiny
E: Couldn't find any package by glob 'vi.tiny'
E: Couldn't find any package by regex 'vi.tiny'
[root@artik ~]# apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
vim : Depends: vim-common (= 2:8.1.0788-0york0~16.04) but 2:8.1.0837-0york0~16.04 is to be installed
Depends: vim-runtime (= 2:8.1.0788-0york0~16.04) but 2:8.1.0837-0york0~16.04 is to be installed
E: Unable to correct problems, you have held broken packages.
现在,归档/etc/apt/sources.list
[root@artik ~]# cat /etc/apt/sources.list
deb http://ports.ubuntu.com/ubuntu-ports/ xenial main universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main universe
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main universe
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main universe
deb [arch=armhf] https://download.docker.com/linux/ubuntu xenial stable
# deb-src [arch=armhf] https://download.docker.com/linux/ubuntu xenial stable
deb http://archive.ubuntu.com/ubuntu xenial main universe
# deb-src http://archive.ubuntu.com/ubuntu xenial main universe
我在 Artik 板上运行 ubuntu
编辑:在 /etc/apt/sources.list.d/ 我有:
[root@artik ~]# ls /etc/apt/sources.list.d/
artik-e2e-source.list
artik-e2e-source.list.save
artik-platform-artik533s-sources.list
artik-platform-artik533s-sources.list.save
jonathonf-ubuntu-vim-xenial.list
jonathonf-ubuntu-vim-xenial.list.save
nodesource.list
nodesource.list.save
和 apt-cache
[root@artik ~]# apt-cache policy vim vim-common
vim:
Installed: (none)
Candidate: 2:8.1.0788-0york0~16.04
Version table:
2:8.1.0788-0york0~16.04 500
500 http://ppa.launchpad.net/jonathonf/vim/ubuntu xenial/main armhf Packages
2:7.4.1689-3ubuntu1.2 500
500 http://ports.ubuntu.com/ubuntu-ports xenial-security/main armhf Packages
500 http://ports.ubuntu.com/ubuntu-ports xenial-updates/main armhf Packages
2:7.4.1689-3ubuntu1 500
500 http://ports.ubuntu.com/ubuntu-ports xenial/main armhf Packages
vim-common:
Installed: (none)
Candidate: 2:8.1.0837-0york0~16.04
Version table:
2:8.1.0837-0york0~16.04 500
500 http://ppa.launchpad.net/jonathonf/vim/ubuntu xenial/main armhf Packages
100 /var/lib/dpkg/status
2:8.1.0788-0york0~16.04 500
500 http://ppa.launchpad.net/jonathonf/vim/ubuntu xenial/main armhf Packages
2:7.4.1689-3ubuntu1.2 500
500 http://ports.ubuntu.com/ubuntu-ports xenial-security/main armhf Packages
500 http://ports.ubuntu.com/ubuntu-ports xenial-updates/main armhf Packages
2:7.4.1689-3ubuntu1 500
500 http://ports.ubuntu.com/ubuntu-ports xenial/main armhf Packages
编辑2:
当我这样做时,apt-get update
我得到一个错误,我不知道它是否重要:
Err:7 http://archive.ubuntu.com/ubuntu xenial/main armhf Packages
404 Not Found [IP: 91.189.88.162 80]
看起来你没有跑
sudo apt-get update
。此外,这看起来像您已经安装了一个
ppa
.ppa
应该在位于的文件中列出,并且/etc/apt/sources.list.d
不会在 中列出/etc/apt/sources.list
。运行以下命令:
如果这不起作用,请告诉我,我们可以调查您是否仍然
ppa
安装。如果没有,那么您可能需要重新安装ppa
. 如果您不想要ppa
,那么您将需要清除您的apt-cache
并做一些其他的事情来补救,如果需要,我可以为您提供有关如何执行此操作的进一步说明。请发布任何错误。谢谢!
首先,通过运行以下命令修复您的 sources.list 文件,因为它包含不应存在的行:
如果您已删除 ppa,请运行以下命令:
请发布更多错误。谢谢!
解决方法如下:
问题解决了。
只是说包或程序 vi.tiny 不存在于 ubuntu 存储库中。您可以尝试先安装 vi 看看是否有效。
至于 vim,听起来你有一些损坏的包,
aptitude
通常很擅长解决这样的问题,所以你可以试试