You are not logged in.

#1 2012-02-07 13:34:20

Top_se
Member
From: Germany
Registered: 2008-08-03
Posts: 31

edit pacman.conf without editor

Hi folks,

I have got a BIG problem. That is what I did:

I installed a new /etc/pacman.d/mirrorlist

after that I got an error in pacman, which said that the architecture is unknown or sth

so I inserted "Architecture = x86_64" into pacman.conf and did some updates

after a restart some time later xinit failed to initialize "x" ... probably because my window manager can not load (see following text)

well, now I am left without X and when I try to start vim it says sth like: "error while loading shared libraries gtk-x11-...sth... wrong ELF class ELFCLASS64"

now I tried to install nano via pacman which was successful, but as soon as I try to start nano it says "/usr/bin/nano file or directory not found" (I also tried to install vi with the same result)

Now I am really lost since I can not edit any files, especially pacman.conf to change the architecture, since I guess the origin of my problem is that I did not have a x64 system in first place!? Even though I am sure I have ...

Do you have any idea how to fix my system? I can still use pacman and mount a usb device, if that helps?

Best,
Tobias

Offline

#2 2012-02-07 13:45:34

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,612
Website

Re: edit pacman.conf without editor

You could use sed or grep and pipe the output to a new file, cat or less through the result to ensure it was done properly, then mv the new file to pacman.conf.

There is also the sed -i option which edits the file in place, but this seems a bit risky to me for such a task.

You could also just boot to a live cd/usb and edit from there.

Edit: yet another option could be to copy it to usb, then edit it on another computer, then copy it back.

Last edited by Trilby (2012-02-07 13:52:27)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2012-02-07 13:55:57

javex
Member
Registered: 2011-12-30
Posts: 76

Re: edit pacman.conf without editor

Please try to give us some more information:
Do

ls -l /usr/bin | grep nano

and see if nano is actually present. Also check if "/usr" is mounted

mount

. If you are unsure, post the output.
Also please provide your pacman.conf so we can see if there's anything wrong there. To get it do

cat /etc/pacman.conf

. Then place it in the file as noted below.

Note: to provide the output do the following:

COMMAND > ~/command_output.txt

. Then you can copy those files to a usb drive via

cp ~/command_output.txt /path/to/usb

.

This could help us figure out the problem.

You could also look into tools for "editing" a file in the command line. Maybe 'sed' can help there, not so sure myself. Perhaps you can do some kind of

cat /etc/pacman.conf | *command to replace/remove the Architecture line* > /etc/pacman.conf

Watch out though, ALWAYS make backups, you don't want to screw things up even more.

Hope this helps.

By the way: You change doesn't look so wrong if I am not mistaken. I wonder how this could screw things up this way?

Oh by the way: If all else fails, boot a live cd, mount your system and edit the files via live cd tools. If you then want to test things you can chroot into your mounted system.

Offline

#4 2012-02-07 13:56:12

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: edit pacman.conf without editor

since I guess the origin of my problem is that I did not have a x64 system in first place!? Even though I am sure I have ...

Your hardware might be x64, but it sounds like you installed i686 and then changed architecture to x64? The default "Architecture = auto" should have done it.

Depends what you can still use..

#sed "/^Architecture/d" /etc/pacman.conf
#echo 'Architecture = auto' >> /etc/pacman.conf

or with wget, get the default pacman.conf from the repo and move into place (this is current pacman default .conf:

#wget http://projects.archlinux.org/svntogit/packages.git/plain/trunk/pacman.conf?h=packages/pacman

edit: haha. need to refresh before posting when I come back to tabs opened in the background..

Last edited by hokasch (2012-02-07 13:58:38)

Offline

#5 2012-02-07 14:48:45

Top_se
Member
From: Germany
Registered: 2008-08-03
Posts: 31

Re: edit pacman.conf without editor

Well, thank you for the quick replies!!!

I replaced my pacman.conf with the default one as hokasch proposed. So cat pacman.conf | grep Arch now returns "Architecture = auto" But still, if I install sth it is a x86_64 package, which is understandable since uname -m returns x86_64   so I do not think I did sth wrong in the first place ...

But I wonder why pacman does not install e.g. nano properly...
when I do ls -l /usr/bin | grep nano, I get:

-rwxr-xr-x 1 root root 188712 Nov 2 16:54 nano and
....  ....   ....   ....   ....   ....  rnano -> nano

So /usr should be mounted and nano with the executable flag there, right javex? But what is wrong there? why cant I start it then?
`
Anyway, can you tell me which packages I should reinstall in order to resolve the issue with the ELFCLASS64 in libgtk-x11-2.0.so.0 ?`I am pretty sure I did not update vim after I changed my pacman.conf today, so why should it be asking for 32bit libraries?

Offline

#6 2012-02-07 16:05:02

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: edit pacman.conf without editor

Ok, did you initially install x64?
Do you get anything from "pacman -Qi | grep i686"? What about "file /usr/bin/nano" etc?

If you are positively running a x64 system, is your system fully updated from a syncing mirror and the multilib repo uncommented (since you pulled the default pacman.conf, it is not at the moment)? I would start off by uncommenting multilib, changing your mirrorlist to only list one trusted mirror (e.g. kernel.org), pacman -Syy and pacman -Syu. See lib32-gtk2.

Last edited by hokasch (2012-02-07 16:22:26)

Offline

#7 2012-02-07 19:39:57

Top_se
Member
From: Germany
Registered: 2008-08-03
Posts: 31

Re: edit pacman.conf without editor

Well, I am pretty sure it was a 64 bit system from scratch ...

hm, I did not know about that multilib repo till now ... but by now I did a full system upgrade and now I cant even b boot anymore ... the error is that it cant find /sbin/init, even though it is there (I mounted the partition in my Windows system and I can see the file ...) I guess now the system is totally broken ... I guess I have to reinstall now ...

hokasch, I never used any untrusted mirror ... just the official ones ... but thanks for the tips nevertheless!!!

But I would still be interested in why it says that it cant find a file even though its there ...

Last edited by Top_se (2012-02-07 19:40:24)

Offline

#8 2012-02-08 09:05:59

Top_se
Member
From: Germany
Registered: 2008-08-03
Posts: 31

Re: edit pacman.conf without editor

Heyho!

Now I got a Archbang live-USB system running. MIght that help me to rescue my system?

I mean, I really would like to try this multilib repo stuff, but how can I convince pacman to install files into the right directory? I could mount my arch partition to /mnt, but if I start /mnt/usr/bin/pacman there, I guess pacman would install stuff e.g. to /etc/... which is actually on my usb-device! ...

Btw I have a i868 live system and a x86_64 live system. With the x86_64 system I can start nano (which I installed after I applied the "Architecture = x86_64" option in pacman.conf) but with the i868 system I can't! And it's exactly the other way round with gvim (which was already installed before I changed the pacman option ...) Thus I guess, originally I had a i868 system ...

Well, actually, when I try to start /mnt/usr/bin/pacman I get an error that an library can't be loaded, so I guess I installed a x86_64 library even though pacman needs i868 libraries. Can I use the pacman on the live usb somehow?

Or can I maybe transform my whole system into a x86_64 system?

Best,
Tobias

Offline

#9 2012-02-08 09:27:16

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: edit pacman.conf without editor

"pacman -Qi | grep i686"

would have shown you if you have i686 packages installed, file command will show the architecture of a binary. I was assuming you check for a mixed architecture before running a full upgrade. Likely you had only some packages (including the kernel) upgraded as x64 on an i686 base, so you could still boot but had problems with some binaries. The file not found error can be the result of mixed architecture, e.g. you installed nano as x64 but already had some dependencies on the system as i686 which did not get updated by installing nano. While bash finds nano, the file not found is really from something nano is linked against and can not find.

Anyway, I think you should back up your data and reinstall. You can theoretically switch architecture without reinstall, but in this case I believe just reinstalling would be quicker. Nevertheless, some links:

https://wiki.archlinux.org/index.php/Arch64_FAQ
https://wiki.archlinux.org/index.php/Mi … rch_LiveCD

Offline

#10 2012-02-08 11:14:27

Top_se
Member
From: Germany
Registered: 2008-08-03
Posts: 31

Re: edit pacman.conf without editor

True, I really was too fast with doing the full upgrade ...

I can't reinstall my system, because there is a commercial software installed which I can't reinstall that easily (cause of licence issues)

If I run:

pacman --root /mnt -Qi | grep i686 via the live-machine I only get a long list like:

Architecture   : i686
Architecture   : i686
Architecture   : i686
...

but if I run

pacman --root /mnt -Qi | grep x86_64   I also get a similar list with x86_64 instead of i686 but also a very long list of actual package names and descriptions (where I even can't scroll to its beginning ...)

Thus I really would try the approach from your second link (after backing up my files) but what kind of packages should I install i686 or x86_64 ? Especially since pacman -Qi grep i686 didn't show any i686 packages ... even though I'm sure there must be i686 packages be left if I had a i686 system in first place ...

Thx for your help!!!

Offline

Board footer

Powered by FluxBB