how to upgrade to vim after ubuntu 9.04 install

Asked by majid

i try the following and get these responses:

$sudo apt-get install vim

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package vim is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package vim has no installation candidate

-----------

apt-get install vim-full

E: Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

any ideas how to get the full version of vim?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu vim Edit question
Assignee:
No assignee Edit question
Solved by:
Tom
Solved:
Last query:
Last reply:
Revision history for this message
Tom (tom6) said :
#1

Try getting it through Synaptic Package Manager?

That second bunch of errors was just because you'd accidentally left sudo off the front. The command should have been

sudo apt-get install vim-full

lol, heheheh. Ohh, sometimes you get a similar bunch of errors if you have another packager manager or update manager open while try to use the command-line tool ;)

Good luck and regards from
Tom :)

Revision history for this message
majid (majid11) said :
#2

hi Tom,

thanks for your response. i have had a look in synaptic package manager and found vim-tiny and vim-common. how do i then go about installing the later, assuming its the fully functioning version, thanks

Revision history for this message
Tom (tom6) said :
#3

Vim-tiny is the one that's installed on my system, by default. i think vim-common is just a library you'll need but isn't the main program. Installing vim-tiny should draw vim-common in as a dependency. I think you'll need both :)

Good luck and regards from
Tom :)

Revision history for this message
majid (majid11) said :
#4

yeah thats exactly what i have got. the problem is that vim-tiny does not function well (you cant navigate in your script as well as being limited to 23 lines and other things). so im trying to update to a complete normal working version of vim.

i have also looked at other peoples q's and tried to fix this by the answers they get (as above), but without any joy yet, thanks.

Revision history for this message
Tom (tom6) said :
#5

How about using a different text-editor like SciTe or Gedit? Alternatively if you need to keep it to the command-line then Nano is pretty good?

Revision history for this message
Tom (tom6) said :
#6

It might be worth trying to install "vi" because that might be vim disguised by using the name for the previous editor that vim was developed from. Vi was really well known so it makes sense to keep the name for the new one, especially as Vim is really just an advanced Vi

err, does that make sense? I kinda know what i'm trying to say but it's sounding all wrong when i say it lol
Good luck and regards from
Tom :)

Revision history for this message
majid (majid11) said :
#7

i have been to www.vim.org to try and locate the right editor but its pointing me back to the site of my linux distribution (ubuntu) to get a vi/vim download. im going to see if i can find and download this from there or somewhere else ...

i suppose any suggestions for ubuntu vi download sites would be what im after now, thanks

Revision history for this message
Tom (tom6) said :
#8

Ok, i think the problem might just be something to do with your repositories not being setup right. It's worth looking in Synaptics "Settings" menu and see if you've got plenty of sources ticked. My jaunty is showing loads of vi and vim stuff so i don't understand how you're not.

I have found this site so hopefully this will be easier than sorting your repos out ;)
http://packages.ubuntu.com/jaunty/
Good luck and regards from
Tom :)

Revision history for this message
majid (majid11) said :
#9

i have just stumbled on this website: http://packages.ubuntu.com from where i have a choice of downloading different versions of vim. should i go for vim-full or vim-gnome. is there much difference?

Revision history for this message
Tom (tom6) said :
#10

From the description inside Synaptic it looks as though vim-gnome is the full package that you're looking for. This is what it says about Vim-full

"This package is simply a transitional package from vim-full to vim-gnome."

and this about vim-gnome

"Vi IMproved - enhanced vi editor - with GNOME2 GUI

Vim is an almost compatible version of the UNIX editor Vi.

Many new features have been added: multi level undo, syntax
highlighting, command line history, on-line help, filename
completion, block operations, folding, Unicode support, etc.

This package contains a version of vim compiled with a GNOME2 GUI
and support for scripting with Perl, Python, Ruby, and Tcl."

Good luck with this!
Regards from
Tom :)

Revision history for this message
majid (majid11) said :
#11

thanks Tom, i am going to try this and i will let you know how i get on ...

Revision history for this message
majid (majid11) said :
#12

i get to the following page with the downloads:
http://packages.ubuntu.com/jaunty/i386/vim-gnome/download

i have no idea where to go to complete the following instructions (adding a line to your /etc/apt/sources.list):

"If you are running Ubuntu, it is strongly suggested to use a package manager like aptitude or synaptic to download and install packages, instead of doing so manually via this website.
You should be able to use any of the listed mirrors by adding a line to your /etc/apt/sources.list like this:
deb http://cz.archive.ubuntu.com/ubuntu jaunty main
Replacing cz.archive.ubuntu.com/ubuntu with the mirror in question."

i open the synaptic package manager, but then i do not know how to go about downloading the package: gr.archive.ubuntu.com/ubuntu (assuming gr = great britain). i dont know what to do in the synaptic package manager.

Revision history for this message
Dominik Zalewski (dzalewski) said :
#13

You can also set vim as your default editor by running:

sudo update-alternatives –config editor

and then choose vim.

Revision history for this message
Tom (tom6) said :
#14

To add repositories using Synaptic try going up to the "Settings" menu and then "Repositories". I have ticked a lot of these and it might be worth seeing if yours are ticked too. It'd be a good plan to check what the settings are in all the tabs. Vim is usually a basic package though so even if it's just the Cd in the 1st tab that's ticked then you should be getting vim in the packages list. The drop down list that says "Download from ...", when you click on "other" it gives an option to find the best server of the moment but if you're in England then the Oxford one or any of those should be good as long-term choices.

Good luck and regards from
Tom :)

Revision history for this message
majid (majid11) said :
#15

thanks Tom
i ticked the Cd in the 1st tab and have chose one of the download locations in the uk. the system accepted the changes and started downloading all the stuff. when it finished, i checked the package list (installed), and it still shows vim-tiny and vim-common.

i tried the following as Dominik has suggested: sudo update-alternatives --config editor
but it display the same options as before (vim-tiny). vim-gnome does not appear.
surely we're getting close!

Revision history for this message
Best Tom (tom6) said :
#16

On the 2nd tab, "3rd party" there's an "Add" button can you add the repos you listed earlier using that?

deb http://gb.archive.ubuntu.com/ubuntu jaunty main

i would guess that if this goes wrong it could break your system a bit in some way so i would recommend first backing up your sources list first by opening a teminal console and entering

cd /etc/apt
sudo cp sources.list sources.140509

so that you can get the same sources.list back using a LiveCd if it dos all go wrong. I hope this helps!
Good luck and regards from
Tom :)

Revision history for this message
majid (majid11) said :
#17

SUCCESS!!!

it worked! finally, it downloaded the repos, and i applied vim-gnome. the vi functions properly without any of the problems before - good work Tom

Revision history for this message
majid (majid11) said :
#18

Thanks Tom, that solved my question.

Revision history for this message
Tom (tom6) said :
#19

WoooHoooo!!! :)))))
I think you did most of the work in solving this. I just gave a few nudges and had a few guesses. Congrats on solving this :))))
Regards from
Tom :)

Revision history for this message
majid (majid11) said :
#20

thanks again, suppose if i have to submit another Q, you might catch me here again!

Revision history for this message
Tom (tom6) said :
#21

Lol, maybe. You can always answer questions here too. Seems like we learned a lot during that question. Most of us answering questions are just volunteers doing a bit to help here and there. Possibly will catch up with you next time tho :)

Good luck and regards anyway
Tom :)

Revision history for this message
Gaurav Kulkarni (gaurav-electx) said :
#22

Hi Tom, could u plz help me in the same problem,
My arrow keys and backspace key give ambiguous results in Vi editor. I tried the commands :$sudo apt-get update vim
and got following errors:

Err http://in.archive.ubuntu.com jaunty Release.gpg
  Could not resolve 'in.archive.ubuntu.com'
Err http://in.archive.ubuntu.com jaunty/main Translation-en_IN
  Could not resolve 'in.archive.ubuntu.com'
Err http://in.archive.ubuntu.com jaunty/restricted Translation-en_IN
  Could not resolve 'in.archive.ubuntu.com'
Err http://in.archive.ubuntu.com jaunty/universe Translation-en_IN
  Could not resolve 'in.archive.ubuntu.com'
Err http://in.archive.ubuntu.com jaunty/multiverse Translation-en_IN
  Could not resolve 'in.archive.ubuntu.com'
Err http://in.archive.ubuntu.com jaunty-updates Release.gpg
  Could not resolve 'in.archive.ubuntu.com'
Err http://in.archive.ubuntu.com jaunty-updates/main Translation-en_IN
  Could not resolve 'in.archive.ubuntu.com'
Err http://in.archive.ubuntu.com jaunty-updates/restricted Translation-en_IN
  Could not resolve 'in.archive.ubuntu.com'
Err http://in.archive.ubuntu.com jaunty-updates/universe Translation-en_IN
  Could not resolve 'in.archive.ubuntu.com'
Err http://in.archive.ubuntu.com jaunty-updates/multiverse Translation-en_IN
  Could not resolve 'in.archive.ubuntu.com'
Err http://security.ubuntu.com jaunty-security Release.gpg
  Could not resolve 'security.ubuntu.com'
Err http://security.ubuntu.com jaunty-security/main Translation-en_IN
  Could not resolve 'security.ubuntu.com'
Err http://security.ubuntu.com jaunty-security/restricted Translation-en_IN
  Could not resolve 'security.ubuntu.com'
Err http://security.ubuntu.com jaunty-security/universe Translation-en_IN
  Could not resolve 'security.ubuntu.com'
Err http://security.ubuntu.com jaunty-security/multiverse Translation-en_IN
  Could not resolve 'security.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/jaunty/Release.gpg Could not resolve 'in.archive.ubuntu.com'

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/jaunty/main/i18n/Translation-en_IN.bz2 Could not resolve 'in.archive.ubuntu.com'

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/jaunty/restricted/i18n/Translation-en_IN.bz2 Could not resolve 'in.archive.ubuntu.com'

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/jaunty/universe/i18n/Translation-en_IN.bz2 Could not resolve 'in.archive.ubuntu.com'

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/jaunty/multiverse/i18n/Translation-en_IN.bz2 Could not resolve 'in.archive.ubuntu.com'

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/jaunty-updates/Release.gpg Could not resolve 'in.archive.ubuntu.com'

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/jaunty-updates/main/i18n/Translation-en_IN.bz2 Could not resolve 'in.archive.ubuntu.com'

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/jaunty-updates/restricted/i18n/Translation-en_IN.bz2 Could not resolve 'in.archive.ubuntu.com'

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/jaunty-updates/universe/i18n/Translation-en_IN.bz2 Could not resolve 'in.archive.ubuntu.com'

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/jaunty-updates/multiverse/i18n/Translation-en_IN.bz2 Could not resolve 'in.archive.ubuntu.com'

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jaunty-security/Release.gpg Could not resolve 'security.ubuntu.com'

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jaunty-security/main/i18n/Translation-en_IN.bz2 Could not resolve 'security.ubuntu.com'

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jaunty-security/restricted/i18n/Translation-en_IN.bz2 Could not resolve 'security.ubuntu.com'

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jaunty-security/universe/i18n/Translation-en_IN.bz2 Could not resolve 'security.ubuntu.com'

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jaunty-security/multiverse/i18n/Translation-en_IN.bz2 Could not resolve 'security.ubuntu.com'

W: Some index files failed to download, they have been ignored, or old ones used instead.
W: You may want to run apt-get update to correct these problems

Revision history for this message
Tom (tom6) said :
#23

Hi :)
Jaunty is no longer supported so you need to upgrade to the 10.04 LTS or more recent.

Jaunty is the 9.04 which was released in 2009, April. It was one of the normal 6monthly releases which only have 18months support. So, support for the 9.04 ended in 2010, October which was when the 10.10 was released. I have stuck with the 10.04 on most machines because the LTSes have at least 3 years support. The LTSes were 6.06, 8.04, 10.04 and soon the 12.04. When support ends for a release the repos for it are closed and that means no more updates and no new programs unl;ess they are downloaded from 3rd party web-sites.

So, i would recommend upgrading to or doing a fresh install of Ubuntu 10.04. Then in a couple of days time download the 12.04 and try it out to see if it's not too difficult to use.

Errr, generally it is better to ask a new question rather than to add to the end of an old thread in Launchpad. Launchpad doesn't "bump threads".
Good luck and regards from
Tom :)

Revision history for this message
Gaurav Kulkarni (gaurav-electx) said :
#24

Thanks Tom :)

Revision history for this message
Tom (tom6) said :
#25

Hi :)
You are welcome. I hope it helped!

I've not seen the Unity interface in 12.04 yet. I didn't like it much in the 11.04 but that was it's first outing. I think it is probably heading in the 'right' direction which Gnome 3 clearly wasn't.

So, i am mostly sticking with 10.04 LTS but i should keep trying the newer releases as they reach beta and proper release just to see what they are like. LiveCd/Usb seems a good way of doing that.

Good luck, thanks and regards from
Tom :)