3

just installed LAMP server and need to use vim editor to edit php.ini

The command sudo apt-get install vim gives me the following error:

Package 'vim' is not available but is refered to by another package. This means the package is missing or is obsolete, or is only avaiable from another source.
E: Package 'vim' has no installation candidate

Please advise

Zanna
  • 70,465
user165849
  • 31
  • 1
  • 1
  • 2

4 Answers4

4

Check your sources list /etc/apt/sources.list is as it should be. Run

sudo apt-get update

to download the package database. Then try again.

If all else fails, maybe you can find further advice and newer versions to compile from source on www.vim.org.

sgsheg
  • 41
  • 6
1

Vim is a powerful editor and should install with the command you gave in 12.04, 12.10 or 13.04.

However you do not need vim. There are other command line text editors available and I would suggest you use nano instead. It is installed by default and while its not as powerful as vim it is much easier to learn.

If you have the desktop version of Ubuntu you can also use GUI based editors such as gedit.

Warren Hill
  • 22,112
  • 28
  • 68
  • 88
1

You don't necessarily need to use vim. The text editor nano would have come in Ubuntu by default. Using it from the CLI is the same as vim:

nano /etc/path/to/php.ini

If you need vim itself, the vim-nox package should include vim:

sudo apt-get install vim-nox

The GUI version of Vim should also include command-line version of vim. You can install it as follows:

sudo apt-get install vim-gtk

Hope that helps.

Scott
  • 246
  • 1
  • 3
1

If vim is not in the source.list of your system you can use usually vi too.

Check here for the difference: What is the difference between Vi and Vim?

And you have always the option to compile it yourself, eg. http://www.vim.org/download.php#unix

wittich
  • 1,174
  • 13
  • 26