Posts tagged troubleshoot

Solving “I have no name!@*”

1

[imported from my old site, not a new post (if that’s important)]

So I’m not sure how, but I broke one of my Ubuntu vir­tual machines now, right at a about the worst pos­si­ble time for it to break. The symp­toms were that while I could still login to the machine as my user, and if I was root I could still “su” to that user, every time I was that user the user itself seemed to have no under­stand­ing of itself, while the sys­tem still did. That was a pretty hairy sen­tence, so let me explain by show­ing what I tried.

root@gw-pkl-01:~# su - charles
I have no name!@gw-pkl-01:~$

Now when you try SSH’ing any­where or doing any­thing use­ful you are told to get lost.

I have no name!@gw-pkl-01:~$ ssh charles@anywhere.i.can.think.of -Cv
You don't exist, go away!
I have no name!@gw-pkl-01:~$

But I won­der whether the sys­tem knows who I am?

I have no name!@gw-pkl-01:~$ id
uid=1000 gid=1000(charles) groups=4(adm),20(dialout),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),107(fuse),109(lpadmin),115(admin),1000(charles),1001(wheel)
I have no name!@gw-pkl-01:~$ whoami
whoami: cannot find name for user ID 1000
I have no name!@gw-pkl-01:~$ echo $USER
charles
I have no name!@gw-pkl-01:~$

That almost all seemed cor­rect, so what on earth could be going on? I tried adding new users to see if they were alright, and they also had the problem.

The answer is that your /etc/passwd file is not read­able by all users. This was con­firmed by com­par­ing the bro­ken machine with another one that I had deployed from the same template.

root@dynamips-pkl-01:~# ls -la /etc/passwd
-rw-r--r-- 1 root root 2104 2008-07-17 00:12 /etc/passwd
root@dynamips-pkl-01:~#

root@gw-pkl-01:~# ls -la /etc/passwd
-rw------- 1 root root 2331 2008-08-12 13:49 /etc/passwd
root@gw-pkl-01:~#

Make it read­able and every­thing works again.

root@gw-pkl-01:~# chmod +r /etc/passwd
root@gw-pkl-01:~# su - charles
charles@gw-pkl-01:~$ id
uid=1000(charles) gid=1000(charles) groups=4(adm),20(dialout),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),107(fuse),109(lpadmin),115(admin),1000(charles),1001(wheel)
charles@gw-pkl-01:~$ whoami
charles
charles@gw-pkl-01:~$ echo $USER
charles
charles@gw-pkl-01:~$

Thanks to this post which made that all easy to realise.

Debian or Ubuntu on a Sun Netra

1

[imported from my old site, not a new post (if that’s important)]

I will prob­a­bly expand on this at some stage, so for now it’s going to be short, but I recently put Debian onto a Sun Netra, which was pretty cool, but I decided to cross-grade from Debian to Ubuntu which I’ve done before with­out hav­ing any issues, and I ran into issues. Tons of them in fact. But only one was bad enough that I almost gave up, and by bad enough I mean that any­body who is good with dpkg would have solved this quickly but no mat­ter how hard I searched (at first), all I could find was whin­ing about how if you have this prob­lem it’s your own fault because you’ve mixed Debian and Ubuntu, but not giv­ing any clues as to how to solve the prob­lem. I had mixed the two, but I also hadn’t. My /etc/apt/sources.list had only Ubuntu sources, but some of the soft­ware on the machine was Debian. Any­way to get to the point if you have this problem:

Selecting previously deselected package sysvutils.
(Reading database ... 168107 files and directories currently installed.)
Unpacking sysvutils (from .../sysvutils_2.86.ds1-14.1ubuntu9_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/sysvutils_2.86.ds1-14.1ubuntu9_i386.deb (--unpack):
trying to overwrite `/usr/share/man/man1/mesg.1.gz', which is also in package sysvinit
Errors were encountered while processing:
/var/cache/apt/archives/sysvutils_2.86.ds1-14.1ubuntu9_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Then please fix it by doing the following:

$ sudo dpkg --force-overwrite -i /var/cache/apt/archives/sysvutils_2.86.ds1-14.1ubuntu9_i386.deb(Reading database ... 168508 files and directories currently installed.)
Unpacking sysvutils (from .../sysvutils_2.86.ds1-14.1ubuntu9_i386.deb) ...
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/usr/share/man/man1/mesg.1.gz', which is also in package sysvinit
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/usr/share/man/man1/last.1.gz', which is also in package sysvinit
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/usr/share/man/man1/lastb.1.gz', which is also in package sysvinit
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/usr/share/man/man8/pidof.8.gz', which is also in package sysvinit
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/usr/share/man/man8/killall5.8.gz', which is also in package sysvinit
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/usr/bin/last', which is also in package sysvinit
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/usr/bin/mesg', which is also in package sysvinit
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/sbin/killall5', which is also in package sysvinit
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/usr/bin/lastb', which is also in package sysvinit
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/bin/pidof', which is also in package sysvinit
Setting up sysvutils (2.86.ds1-14.1ubuntu9) ...

And when you are done, thank these guys.

Updated: it appears that some­body other than me is actu­ally read­ing my web­site, so I wanted to make a point of not­ing that the prob­lem I had was exactly as above, but obvi­ously not with i386 debs, so please don’t try fix­ing it exactly as pasted above, but rather apply that to a sparc64 setup. I’m kinda think­ing that if you’re hav­ing this issue then you already knew that, but I had to men­tion it :)

Go to Top