Help with Arch Linux


Recommended Posts

The deepest I've ever gotten with Linux is early RedHat back before Fedora and later on Ubuntu 11.x. I wanted to install a variant that will challenge me to actually learn Linux and what a challenge it's turning out to be.

I just installed Arch, and I have already made a severe mistake. I did not uncomment any of the pacman mirrors and now cannot do anything that requires a package download. What is the easiest way to edit the mirror list? I'm at work right now, so I can't try anything at the moment, but I've been reading up on how to edit text files from the command shell and it appears the "vim" may be my best bet? The only thing I tried before work was the edit command, but that doesn't allow me to see the file and I have no idea how to accomplish what I'm trying to accomplish that way. Thanks for any help.

Link to comment
Share on other sites

Make sure that you have nano or VI installed then using one of them, go to, sudo vi /etc/pacman.d/mirrorlist and do the changes.

Link to comment
Share on other sites

I've been reading up on how to edit text files from the command shell and it appears the "vim" may be my best bet?

If you're new to command line text editing, nano is by far your best bet. Almost zero learning curve. type "nano /path/to/file.txt" make the changes you need, then when finished hit ctrl+x and it'll ask you if you want to save, and then close.

Link to comment
Share on other sites

Yes, simply edit the file:


/etc/pacman.d/mirrorlist
[/CODE]

I did that, but I'm not sure how to edit specific lines of the file without being able to see the file while I'm editing it.

Make sure that you have nano or VI installed then using one of them, go to, [b]sudo vi /etc/pacman.d/mirrorlist[/b] and do the changes.

I'll give that try after work.

Link to comment
Share on other sites

If you're new to command line text editing, nano is by far your best bet. Almost zero learning curve. type "nano /path/to/file.txt" make the changes you need, then when finished hit ctrl+x and it'll ask you if you want to save, and then close.

Awesome, thank you.

Link to comment
Share on other sites

If you're new to command line text editing, nano is by far your best bet. Almost zero learning curve. type "nano /path/to/file.txt" make the changes you need, then when finished hit ctrl+x and it'll ask you if you want to save, and then close.

Yes, have to agree 100%, Nano is by far the easiest, VI is incredibly powerful but can get quite confusing. Vim is based on VI and can be used from both the command line interface and as a standalone application in a graphical user interface.

Link to comment
Share on other sites

Is Nano the same editor that's used during the Arch install? If so it was very easy, too bad I didn't know about the commenting before I finished the install :( I ask because that editor used ctrl+x to save and exit too.

Link to comment
Share on other sites

Is Nano the same editor that's used during the Arch install? If so it was very easy, too bad I didn't know about the commenting before I finished the install :( I ask because that editor used ctrl+x to save and exit too.

As far as I know nano is installed by default. The ARCH Wikis are excellent for any sort of help!

Here is one for Nano.

Link to comment
Share on other sites

As far as I know nano is installed by default. The ARCH Wikis are excellent for any sort of help!

Here is one for Nano.

Unfortunately the US government blocks Arch's website so I'll have to check it out when I get home.

Link to comment
Share on other sites

Unfortunately the US government blocks Arch's website so I'll have to check it out when I get home.

That's pretty weird, I suppose that they have their reasons. Good luck and enjoy your Arch mission, for me it's the best distro out there. :)

Link to comment
Share on other sites

vi or nano will do the trick. Just remember to pick a mirror close to your location so you get a good speed. It can be changed at any time as well in case you want to try another.

Once you've installed and setup Arch and Gentoo, you'll be a Linux expert ;)

Link to comment
Share on other sites

vi or nano will do the trick. Just remember to pick a mirror close to your location so you get a good speed. It can be changed at any time as well in case you want to try another.

Once you've installed and setup Arch and Gentoo, you'll be a Linux expert ;)

I'm on a satellite connection so no matter what mirror I pick it'll be slow as sin. I'm very excited to delve into Arch though, can't wait! Right now I just have it running in Virtualbox, but maybe someday I'll dualboot it.

Link to comment
Share on other sites

Since you're learning:

In many cases with config files you want to use "nano -w" so word-wrapping works correctly. Otherwise config files with long lines will get put on another line when saved, and could cause issues.

Link to comment
Share on other sites

Since you're learning:

In many cases with config files you want to use "nano -w" so word-wrapping works correctly. Otherwise config files with long lines will get put on another line when saved, and could cause issues.

Thanks for the tip!

Just an update, I ended up reinstalling Arch again because I was getting weird errors about the hostname even after I fixed the mirrorlist. After restarting and doing a dhcpcd, I was successful in using pacman. Installing xorg-server now and planning to install XFCE next.

Link to comment
Share on other sites

Since you're learning:

In many cases with config files you want to use "nano -w" so word-wrapping works correctly. Otherwise config files with long lines will get put on another line when saved, and could cause issues.

Or just add

set nowrap

to ~/.nanorc

Link to comment
Share on other sites

Thanks for the tip!

Just an update, I ended up reinstalling Arch again because I was getting weird errors about the hostname even after I fixed the mirrorlist. After restarting and doing a dhcpcd, I was successful in using pacman. Installing xorg-server now and planning to install XFCE next.

There are a couple of things you should do.

1. Edit /etc/rc.conf (you also might want to set your keyboard map too) and change "HOSTNAME=" to a unique name. Then repeat with the same name in /etc/hosts.

2. Edit /etc/locale.gen and select your locale. Then run locale-gen.

3. Edit /etc/makepkg.conf and use -march=native so when you compile software from AUR, it's optimised for your system's architecture and CPU.

4. Install yaourt or another AUR and pacman front end.

Link to comment
Share on other sites

So, trying to install xfce4 package and I'm getting some file conflicts.


error: failed to commit transaction (conflicting files)
glibc: /usr/bin/tzselect exists in filesystem
glibc: /usr/sbin/zdump exists in filesystem
glibc: /usr/sbin/zic exists in filesystem
Errors occurred, no packages were upgraded.
[/CODE]

Can I just remove the conflicting files and try again? I want to ask first before I go deleting some essential file.

Link to comment
Share on other sites

So, trying to install xfce4 package and I'm getting some file conflicts.


error: failed to commit transaction (conflicting files)
glibc: /usr/bin/tzselect exists in filesystem
glibc: /usr/sbin/zdump exists in filesystem
glibc: /usr/sbin/zic exists in filesystem
Errors occurred, no packages were upgraded.
[/CODE]

Can I just remove the conflicting files and try again? I want to ask first before I go deleting some essential file.

I found a few threads with similar issues, here's one:

https://bbs.archlinu...c.php?id=138954

I'm curious, does it ask you to update pacman first? If it does try saying "no" to updating pacman, and then update the rest as normal. Other users said just deleting those files and updating worked for them as well.

Also, did you run pacman -Syyu before installing any extra packages? On a clean install sometimes if you don't update all the packages before trying to install more you can run into errors (especially if you didn't use the netinstall)

Link to comment
Share on other sites

I found a few threads with similar issues, here's one:

https://bbs.archlinu...c.php?id=138954

I'm curious, does it ask you to update pacman first? If it does try saying "no" to updating pacman, and then update the rest as normal. Other users said just deleting those files and updating worked for them as well.

Also, did you run pacman -Syyu before installing any extra packages? On a clean install sometimes if you don't update all the packages before trying to install more you can run into errors (especially if you didn't use the netinstall)

I tried saying no to pacman updating as well as letting it update. I only did a pacman -Syy, so I'll try it with the 'u' on the end. If that fails I'll just delete the file, thanks very much.

Link to comment
Share on other sites

Yeah, just run -Syu, and say "N" to the question to update pacman first. If that doesn't work, run pacman -S tzdata, then try again.

Link to comment
Share on other sites

Well I started learning some stuff about Arch linux and I'll give you some hints that helped me out: I normally mess up lots of things so when I make the system unbootable I normaly chroot from a livecd liveusb( that is change the root directory, I think of it like a sandbox ), by doing this you have access to the software where you installed arch linux, for instance administration binaries that are placed in /sbin that maybe used in the booting process or /usr/bin. Here is how it's done:

The proc directory holds information about processes and other general system stuff.

The dev directory constains device files which let you manipulate devices http://www.tldp.org/...tml/dev-fs.html

The sys directory "It's a sysfs type of file system and it's something like the /proc filesystem since the "files" represent information in the kernel memory and are not on your harddrive." http://linux.about.c...hwtpap07t06.htm

The mnt directory where devices are mounted.

To see all the partitions in your system

vi /proc/partitions[/CODE]

Create a mounting point

[CODE]sudo mkdir /mnt/arch[/CODE]

Mount the arch root directory, respective partition X.

[CODE]sudo /dev/sdaX /mnt/arch[/CODE]

If you created additional partitions for boot (in sdaX partition) etc.

[CODE]sudo /dev/sdaX /mnt/arch/boot[/CODE]

[CODE]
sudo mount -o bind /dev /mnt/arch/dev
sudo mount -t devpts /dev/pts /mnt/arch/dev/pts
sudo mount -t proc /proc /mnt/arch/proc
sudo mount -t sysfs /sys /mnt/arch/sys
sudo chroot /mnt/arch/ /bin/bash
[/CODE]

Now you can edit your arch installation as much as you like. When everything is done just type

[CODE]exit[/CODE]

in terminal

And unmount all the mount points with the umount command.

To see all the mounted devices type in terminal

[CODE]mount[/CODE]

[CODE]
sudo umount /mnt/arch/dev/pts
sudo umount /mnt/arch/dev
sudo umount /mnt/arch/proc
sudo umount /mnt/arch/sys
sudo umount /mnt/arch/
[/CODE]

Umount will fail if you are in the directory you wish to unmount.

I do this with a livecd/usb http://partedmagic.c...hp?id=downloads The livecd must be the same architecture as the installed OS. For more info https://wiki.archlin...php/Change_Root

Vim is really useful I like it a lot. there are 3 modes. The ones I use are insertion mode and command mode. To return to command mode when in insertion mode type Esc. When in command mode all the keyboard is scripted to do certain things like if you type dd it deletes an entire line; if you press o you create a line below the selected line if you shift-o you do it above and then you enter insertion mode. If you want to insert something in the cursor type i, type a to append it writes after the cursor. If you type shift-i it writes in the beginning of the line if you shift-a you do it at the end.

if you want to save a file you enter command mode and type :w ; if you want to quit and save :wq ; if you wrote sth to the buffer(not yet saved) and want to discard changes :q! . The ! forces vi to quit.

pacman -Sy checks to see if all the information about the packages if up-to-date

pacman -Syy forces package information synchronization regarless of the package information being up to date

pacman -Syyu does what -Syy does and updates the system

pacman -S [i]package[/i] installs the package

pacman -Ss [i]package[/i] searches for packages

pacman -R [i]package[/i] removes a package

if you pacman -S [i]package[/i] and it replies that you do not have a key.

Do the following:

[CODE]
pacman-key --init
pacman-key --populate archlinux
pacman-key --refresh-keys
[/CODE]

pacman-key --init Will need entropy, just change command line interface with ctrl+alt+F2 / F7 and do md5 [i]filename[/i] or sth else sha1 [i]filename[/i] etc and then get to the original CLI ctrl+alt+F1. You can also write random stuff.

This guy helped me out! Check it out when you have time. He helps you set up a GUI, sound, xorg, wireless,etc. He has 5 videos if I'm not mistaken. He does it in a pratical way. RobGraves is the MAN!

Link to comment
Share on other sites

XD I kept editing my previous post and still I forgot this.

sudo umount /mnt/arch/boot[/CODE]

( and other mount points if they happen to be in other partitions).

I am in dire need help of help too xD I have a mac and I installed grub2 in the EFI system partition, it works well but I cant enter arch linux in EFI mode. I am configuring a custom kernel as we speak to enable EFI booting. I think the problem is with the initramfs which contains modules needed by the system to change the root, find hardware (I think) and other stuff. http://www.neowin.ne...-boot-mac-os-x/ If you can tell me how you made it work :D Thanks. I saw you have mac os x installed so supposedly you have a macbook! Or not! XD

Link to comment
Share on other sites

This topic is now closed to further replies.