Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

ubuntu 12.04 newest kernel 3.7.1

Ok, I downloaded "Eclipse" in order to do some programming. then I wanted to reinstall it so i " sudo apt-get --purge remove [Ecplise] ".

Then I restarted my computer (asus ux31a) and it loads the nice purple startup screen and then goes straight to the command -line and asks for login and password.

I tried for about an hour to mess around with it based off of other similar problems people had.

I tried...

ctrl-f7(f8) -- nothing
startx -- and got the error etc/x11/xinit/xserverrc: 3: exec: usr/bin/x: not found

then when I try to sudo shutdown now I get could not write bytes: broken pipe

I'm trying to trouble shoot this I could just reinstall Ubuntu but i'd rather fix the error if possible.

share|improve this question
    
Just assuming that 12.04 + Kernel version 3.7.x is working correctly. Did you try sudo apt-get install xserver-xorg or sudo apt-get install --reinstall xserver-xorg to make sure the xserver is installed correctly? –  Luis Jan 9 '13 at 5:22
    
well...i got impatient...and just reinstalled ubuntu 12.04...lol sorry –  ubuntuNoob Jan 9 '13 at 8:17

2 Answers 2

I see you reinstalled anyway, but if you actually ran what you said you ran, then this is the explanation for why your system broke.

To reinstall eclipse, purging all config, you could use:

sudo apt-get --purge remove eclipse

sudo apt-get install eclipse

To just reinstall eclipse, you could use:

sudo apt-get install --reinstall eclipse

You said you used:

sudo apt-get --purge remove [Ecplise]

Note the capitalization and spelling. But, much more significantly, note the square brackets. This does something very different to what you were expecting. I suggest you read up on regex.

The apt-* commands all take arguments in the form of regex strings; however, different apt-* commands handle them differently. apt-cache search searches both name and description fields, whilst apt-get searches just the name field. apt-cache disregards case, whilst apt-get respects it, etc. It's all relatively intuitive behaviour, so you don't need to think about it most of the time.

Here's some examples of the behaviour of apt-get. Note how regex can be used. I advise against testing these yourself, so I have added the -s flag - this runs a simulation, as opposed to actually changing your system.

sudo apt-get install -s anyedit

This matches all packages called "anyedit" precisely - there aren't any.

sudo apt-get install -s anyedit.*

This matches all packages with "anyedit" anywhere in the name - this is going to find "eclipse-anyedit".

sudo apt-get install -s ^anyedit.*

This matches all packages where the name starts with "anyedit" - there aren't any.

sudo apt-get install -s [a-z]edit.*

This is starting to get bad. Now we're matching all packages where the name contains the text "edit" directly preceeded by any lowercase alphabetical character - it it would match "gedit", "kcoloredit", "gedit-latex-plugin", "ckeditor", etc.

sudo apt-get install -s [abc]

[abc] matches either a, or b, or c. This will find every package which contains any of those characters in its name. So it will install most of the packages in the repositories.

sudo apt-get remove --purge -s [Ecplise]

This matches every package which contains one of c,e,i,l,p,s or E in its name. This regex matches over 98% of the packages in the repositories, and unfortunately your command has requested they all be fully deleted along with their configuration. Now you can hopefully understand what happened.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
    Note, selecting 'libc6-xen' for regex '[Ecplise]'
    Note, selecting 'omninotify' for regex '[Ecplise]'
    Note, selecting 'mpg123-alsa' for regex '[Ecplise]'
    Note, selecting 'libuuidm-ocaml-dev' for regex '[Ecplise]'
    Note, selecting 'libtexttools-doc' for regex '[Ecplise]'
    Note, selecting 'libsvm-java' for regex '[Ecplise]'
    Note, selecting 'libstdc++-dev-armel-cross' for regex '[Ecplise]'
    Note, selecting 'libosmgpsmap2' for regex '[Ecplise]'
    Note, selecting 'libolap4j-java' for regex '[Ecplise]'

... etc (it's a long list consisting of most of the packages on your system, including xserver-xorg, which contains /usr/bin/X).

So, the moral of the story is: be aware that apt-* commands accept regular expressions, always double-check your commands before running them, and with apt-get, always double-check what it's telling you it's actually going to do you before you press 'y' to proceed!

share|improve this answer

For the rest people will end up on this thread

I installed Eclipse for Android development but messed up with my x too sudo apt-get install xorg worked for me. I startx without restart and ended up in a desktop (Unity) without bars and Dash and stuff. Only the desktop (wallpaper) and the startup apps running like Gwibber. Then I Ctrl+Alt+T for terminal and did `sudo apt-get install nvidia-current (I have Nvidia GPU) and then restarted. Now Lightdm and Unity working correctly.

How it helps

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.