4

I am trying to install vi and vim

I initially had vi instlled, and could not install vim, then I removed vi, and now I cannot install both.

I watch all threads in internet, that says you should update, uninstall or purge, then reinstall, but none are working.

Here are the logs:

[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.

now, file /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

I am running ubuntu on Artik board

EDIT: Inside /etc/apt/sources.list.d/ I have:

[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

and 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

EDIT 2:

When I do apt-get update I get an error, I don't know if it is important:

Err:7 http://archive.ubuntu.com/ubuntu xenial/main armhf Packages
  404  Not Found [IP: 91.189.88.162 80]
4
  • The package is called vim-tiny, not vi.tiny. However, you have a bigger problem to solve currently…
    – Melebius
    Feb 6, 2019 at 14:19
  • 1
    I'd suggest adding apt-cache policy vim vim-common to your question, as the your vim package is not coming from official Ubuntu sources as I read packages.ubuntu.com/xenial/vim (official vim requires vim-common 2:7.4.1689-3ubuntu1 not what is listed in your messages)
    – guiverc
    Feb 6, 2019 at 14:20
  • 1
    @guiverc It looks like the OP is using this ppa: launchpad.net/~jonathonf/+ppa-packages
    – mchid
    Feb 6, 2019 at 14:26
  • @guiverc apt-cache added to the question Feb 6, 2019 at 14:31

3 Answers 3

1

It looks like you didn't run sudo apt-get update.

Additionally, this looks like you have installed a ppa. The ppa should be listed in a file located in /etc/apt/sources.list.d and will not be listed on /etc/apt/sources.list.

Run the following commands:

sudo apt-get update
sudo apt-get install --reinstall vim=2:8.1.0837-0york0~16.04

If this does not work, please let me know and we can investigate to see if you still have the ppa installed. If not, then you may want to reinstall the ppa. If you don't want the ppa, then you will need to clear your apt-cache and do some other stuff to remedy and I can give you further instructions on how to do that if that is needed.

Please post any errors. Thanks!


First, fix your sources.list file because it contains a line that should not be there by running the following command:

sudo sed -i 's/\(deb http...archive\)/#\1/g' /etc/apt/sources.list
sudo apt-get update

If you have removed the ppa, run the following commands:

sudo apt-get clean
sudo apt-get update
sudo apt-get remove vim vim-common vim-runtime
sudo apt-get install vim vim-common vim-runtime

Please post any more errors. Thanks!

7
  • E: Version '2:8.1.0837-0york0~16.04' for 'vim' was not found Feb 6, 2019 at 14:26
  • I ran a lot apt-get update !!! Feb 6, 2019 at 14:27
  • I updated my question with all installed ppa Feb 6, 2019 at 14:28
  • @JuliatzindelToro It looks there were build failures with the arm version of vim in that ppa. Would you like to install the official version instead of the ppa version?
    – mchid
    Feb 6, 2019 at 14:38
  • yep, but forgive my ignorance, how should I do ? I already tried to remove ppa, and run apt-get install vim Feb 6, 2019 at 14:42
1

The solution is as follows:

sudo apt-get purge vim-common
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install vim

Problem solved.

-1
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'

Is just saying that the package or program vi.tiny doesn't exist in the ubuntu repo's. You might try installing just vi first to see if that works.

# apt-get install vi

As for vim, it sounds like you have some broken packages, aptitude is usually pretty good at fixing issues like this so you might try

# apt-get install aptitude
...
# aptitude install vim
1
  • Unfortunately, your solution won’t work after E: Unable to correct problems, you have held broken packages. This problem must be resolved first.
    – Melebius
    Feb 6, 2019 at 14:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .