Vi anoyance in Ubuntu 9.04

Red Squirrel

No Lifer
May 24, 2003
67,898
12,365
126
www.anyf.ca
I noticed in ubuntu 9.04 when I use the boot CD, if i try to use vi i can hardly do anything.

backspace wont work, typing randomly refuses to actually type, and just overwrites on itself. The arrow keys actually generate A's it's totally messed.

Anyone else notice this? What is another way I can edit a file? I just need to edit one small file in order for a server to boot but it's not letting me.
 

Red Squirrel

No Lifer
May 24, 2003
67,898
12,365
126
www.anyf.ca
Is there other editors on the CD then vim? This machine has no network access. I also can't use the GUI editor as the GUI is not logged in as root so it wont let me edit the file. As this is a live CD there is no actual login screen for me to just login as root. Otherwise I could just use the GUI text editor.

I did some googling and this vi issue seems to be a bug in this release of ubuntu.
 

degibson

Golden Member
Mar 21, 2008
1,389
0
0
Originally posted by: RedSquirrel
... The arrow keys actually generate A's it's totally messed...

Sounds like the way vi behaves when the terminal type is set wrong. Try changing your terminal type.
 

xSauronx

Lifer
Jul 14, 2000
19,586
4
81
Originally posted by: RedSquirrel
Is there other editors on the CD then vim? This machine has no network access. I also can't use the GUI editor as the GUI is not logged in as root so it wont let me edit the file. As this is a live CD there is no actual login screen for me to just login as root. Otherwise I could just use the GUI text editor.

I did some googling and this vi issue seems to be a bug in this release of ubuntu.

in live cds you just hit the CLI and enter "sudo su" to get root. works on every live cd ive used, anyway.
 

Red Squirrel

No Lifer
May 24, 2003
67,898
12,365
126
www.anyf.ca
Originally posted by: xSauronx
Originally posted by: RedSquirrel
Is there other editors on the CD then vim? This machine has no network access. I also can't use the GUI editor as the GUI is not logged in as root so it wont let me edit the file. As this is a live CD there is no actual login screen for me to just login as root. Otherwise I could just use the GUI text editor.

I did some googling and this vi issue seems to be a bug in this release of ubuntu.

in live cds you just hit the CLI and enter "sudo su" to get root. works on every live cd ive used, anyway.

That's for a terminal app, but how do I change my existing GUI session to be root?
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Open a command prompt and type sudo gedit to open gedit with sudo rights....

edit: you could always kill the X session and run startx from whichever account you want to, but that won't guarantee you a gnome session
 

Red Squirrel

No Lifer
May 24, 2003
67,898
12,365
126
www.anyf.ca
Originally posted by: Crusty
Open a command prompt and type sudo gedit to open gedit with sudo rights....

edit: you could always kill the X session and run startx from whichever account you want to, but that won't guarantee you a gnome session

Yeah tried that, but I just get an error that it cannot find the display. Probably because it's already in use by the non root session.

Is there maybe a run as?

For now I'm just copying the file as root and chmodding it then copying it back, but kinda anoying. Would be nice to just get a full GUI root session. Perhaps there is another boot CD I can use as well, does not need to be Ubuntu.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
wtf are you trying to do? If you want to have a login shell as root open ANY command prompt and type sudo su.

Now anything you do will have root access, what else could you possibly need?

sudo gedit /path/to/file
sudo nano /path/to/file
sudo chmod 777 /path/to/file
sudo rm -rf /
 

Red Squirrel

No Lifer
May 24, 2003
67,898
12,365
126
www.anyf.ca
Originally posted by: Crusty
wtf are you trying to do? If you want to have a login shell as root open ANY command prompt and type sudo su.

Now anything you do will have root access, what else could you possibly need?

sudo gedit /path/to/file
sudo nano /path/to/file
sudo chmod 777 /path/to/file
sudo rm -rf /

Yes i know, this works for COMMANDS but not GUI. As I'm already in the GUI when the CD boots up, I cannot sudo the GUI itself.

I will try another boot CD though, I just need an easy way to see another file system so I can edit files without worrying about access rights. If vi in ubuntu was not messed I'd use that, but it's totally unusable in this version.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: RedSquirrel
Yes i know, this works for COMMANDS but not GUI. As I'm already in the GUI when the CD boots up, I cannot sudo the GUI itself.

I will try another boot CD though, I just need an easy way to see another file system so I can edit files without worrying about access rights. If vi in ubuntu was not messed I'd use that, but it's totally unusable in this version.

If you run a gui program from the command line using sudo, it will run as root.

Setting the TERM didn't help vim? Or is it vi?
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Originally posted by: RedSquirrel
Originally posted by: Crusty
wtf are you trying to do? If you want to have a login shell as root open ANY command prompt and type sudo su.

Now anything you do will have root access, what else could you possibly need?

sudo gedit /path/to/file
sudo nano /path/to/file
sudo chmod 777 /path/to/file
sudo rm -rf /

Yes i know, this works for COMMANDS but not GUI. As I'm already in the GUI when the CD boots up, I cannot sudo the GUI itself.

I will try another boot CD though, I just need an easy way to see another file system so I can edit files without worrying about access rights. If vi in ubuntu was not messed I'd use that, but it's totally unusable in this version.

A GUI has to come from a command being executed somewhere.... if that command was run with SUDO that GUI has root access. It's not that hard to figure it out.

If you want your entire X session running with root access you need to start X with sudo or logged in as root. If you want to do that you have to terminate teh current X session, either goto a virtual terminal via ctrl+F[1-4] and kill off the processes or try ctrl-alt-backspace to kill X. Then you can try starting an X session as root.
 

Brazen

Diamond Member
Jul 14, 2000
4,259
0
0
Originally posted by: RedSquirrel
Originally posted by: Crusty
wtf are you trying to do? If you want to have a login shell as root open ANY command prompt and type sudo su.

Now anything you do will have root access, what else could you possibly need?

sudo gedit /path/to/file
sudo nano /path/to/file
sudo chmod 777 /path/to/file
sudo rm -rf /

Yes i know, this works for COMMANDS but not GUI. As I'm already in the GUI when the CD boots up, I cannot sudo the GUI itself.

I will try another boot CD though, I just need an easy way to see another file system so I can edit files without worrying about access rights. If vi in ubuntu was not messed I'd use that, but it's totally unusable in this version.

You sure can sudo gui applications. As others have said, just type "sudo gedit" and then open the file through gedit's menu or type "sudo gedit /path/to/my/file", and the file will opened in all of root's glory.

Personally though, I would just use nano from the command line.
 

Red Squirrel

No Lifer
May 24, 2003
67,898
12,365
126
www.anyf.ca
Originally posted by: Crusty
Originally posted by: RedSquirrel
Originally posted by: Crusty
wtf are you trying to do? If you want to have a login shell as root open ANY command prompt and type sudo su.

Now anything you do will have root access, what else could you possibly need?

sudo gedit /path/to/file
sudo nano /path/to/file
sudo chmod 777 /path/to/file
sudo rm -rf /

Yes i know, this works for COMMANDS but not GUI. As I'm already in the GUI when the CD boots up, I cannot sudo the GUI itself.

I will try another boot CD though, I just need an easy way to see another file system so I can edit files without worrying about access rights. If vi in ubuntu was not messed I'd use that, but it's totally unusable in this version.

A GUI has to come from a command being executed somewhere.... if that command was run with SUDO that GUI has root access. It's not that hard to figure it out.

If you want your entire X session running with root access you need to start X with sudo or logged in as root. If you want to do that you have to terminate teh current X session, either goto a virtual terminal via ctrl+F[1-4] and kill off the processes or try ctrl-alt-backspace to kill X. Then you can try starting an X session as root.

It's a boot CD, it's not me that starts the GUI, it starts on it's own. (though maybe there's some kind of flag I can put at the boot menu?) If I try to start an individual app from command line it wont work, as there is no way to display GUI applications inside a text terminal. It's like trying to run solitaire in DOS, it wont let you.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
:facepalm;

Are you even reading my posts? It doesn't matter what user is running your current GUI session. Open a GUI terminal application and run sudo gedit /path/to/file to edit a file as root. How hard is that? You're taking a 30s job and turning it into a year long project.

Anyways, what's wrong with just using nano to edit the file?
 

Red Squirrel

No Lifer
May 24, 2003
67,898
12,365
126
www.anyf.ca
Originally posted by: Crusty
:facepalm;

Are you even reading my posts? It doesn't matter what user is running your current GUI session. Open a GUI terminal application and run sudo gedit /path/to/file to edit a file as root. How hard is that? You're taking a 30s job and turning it into a year long project.

Anyways, what's wrong with just using nano to edit the file?

I tried that. I get an error about the display (cannot open display, or something like that)

Though guess that does work in some distros as I just tried my Fedora box. I did not figure you could open a GUI app from within a terminal.
 

Alex

Diamond Member
Oct 26, 1999
6,995
0
0
Originally posted by: RedSquirrel
I noticed in ubuntu 9.04 when I use the boot CD, if i try to use vi i can hardly do anything.

backspace wont work, typing randomly refuses to actually type, and just overwrites on itself. The arrow keys actually generate A's it's totally messed.

Anyone else notice this? What is another way I can edit a file? I just need to edit one small file in order for a server to boot but it's not letting me.

I hate vi / pico.... use gedit!
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Though guess that does work in some distros as I just tried my Fedora box. I did not figure you could open a GUI app from within a terminal.

And you've been using Linux for how long? It works on all of them and always has. As long as the DISPLAY variable is set, which is done automatically when you start a terminal inside of an X session, and X security allows the client to connect you can start any X app from the cli. How do you think people start X apps remotely but display them locally?
 

Red Squirrel

No Lifer
May 24, 2003
67,898
12,365
126
www.anyf.ca
Originally posted by: Nothinman
Though guess that does work in some distros as I just tried my Fedora box. I did not figure you could open a GUI app from within a terminal.

And you've been using Linux for how long? It works on all of them and always has. As long as the DISPLAY variable is set, which is done automatically when you start a terminal inside of an X session, and X security allows the client to connect you can start any X app from the cli. How do you think people start X apps remotely but display them locally?

That's doable? Like kinda like citrix? How exactly does this work? That would be kind of cool. Guessing it has to be on a Linux box though right? Tried in Windows just for kicks but as I assumed I got the error I got in ubuntu live cd.


-bash-3.2$ gedit
cannot open display:
Run 'gedit --help' to see a full list of available command line options.
-bash-3.2$




 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Originally posted by: RedSquirrel
Originally posted by: Nothinman
Though guess that does work in some distros as I just tried my Fedora box. I did not figure you could open a GUI app from within a terminal.

And you've been using Linux for how long? It works on all of them and always has. As long as the DISPLAY variable is set, which is done automatically when you start a terminal inside of an X session, and X security allows the client to connect you can start any X app from the cli. How do you think people start X apps remotely but display them locally?

That's doable? Like kinda like citrix? How exactly does this work? That would be kind of cool. Guessing it has to be on a Linux box though right? Tried in Windows just for kicks but as I assumed I got the error I got in ubuntu live cd.


-bash-3.2$ gedit
cannot open display:
Run 'gedit --help' to see a full list of available command line options.
-bash-3.2$

When you ssh you can specify to forward the X session using -X, then assuming your DISPLAY is set correctly you can run any GUI program remotely while showing the display locally.

 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
That's doable? Like kinda like citrix? How exactly does this work? That would be kind of cool. Guessing it has to be on a Linux box though right? Tried in Windows just for kicks but as I assumed I got the error I got in ubuntu live cd.

You can do it on any OS as long as you've got an X server running on the local machine.

And if you look at the error message you can see that the DISPLAY variable isn't even set because it says it can't open the display but there's no name for the display that it tried.
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,282
3,904
75
Just out of morbid curiosity...you're not trying to edit a file on the CD, are you? When running a live CD, most of the files are read-only because they're only stored on the CD. They're also compressed on the CD, so you can't edit them directly there, even if the CD were multisession.

Changing a live CD's files would require extracting the compressed volume, modifying it, re-compressing it, and putting the .iso back together with the new compressed volume. I've never done it, partly because I could never figure out how the compressed volume had been compressed.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Just out of morbid curiosity...you're not trying to edit a file on the CD, are you? When running a live CD, most of the files are read-only because they're only stored on the CD. They're also compressed on the CD, so you can't edit them directly there, even if the CD were multisession.

Actually most of the LiveCDs use unionfs these days so that you can edit files, install packages, etc and the changes will be made to a RAM disk overlayed on top of the CD.
 

Red Squirrel

No Lifer
May 24, 2003
67,898
12,365
126
www.anyf.ca
Originally posted by: Ken g6
Just out of morbid curiosity...you're not trying to edit a file on the CD, are you? When running a live CD, most of the files are read-only because they're only stored on the CD. They're also compressed on the CD, so you can't edit them directly there, even if the CD were multisession.

Changing a live CD's files would require extracting the compressed volume, modifying it, re-compressing it, and putting the .iso back together with the new compressed volume. I've never done it, partly because I could never figure out how the compressed volume had been compressed.

No was actually trying to edit a file on a physical drive I mounted manually. Though I've edited stuff on a live cd before as well since it just makes a ram drive. I even installed a bunch of stuff with apt get once. Was trying out the 3D effects on a company machine without even installing Linux. was pretty neat to be able to do that.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |