Showing posts with label Install. Show all posts
Showing posts with label Install. Show all posts

April 24, 2013

Reinstalling Arch.

Recently I decided to reinstall Arch Linux on my laptop because why not? Everything is working, with the major exception of wireless. As you may recall, Arch Linux does not play nice with Broadcom wireless chips.


For those that don't keep up with Arch Linux changes, in late 2012/early 2013 (I don't actually recall which) they switched from init scripts to systemd for system start up. Well, now (in April 2013) they have made the switch from the old network connection manager called netcfg to a new network manager called netctl. One of the primary reasons for this move is that netctl has better integration with systemd.


This [of course] breaks everything network-related. In the past 36 hours, I have spent absurd amounts of time attempting to connect to my school's WAP2-Enterprise network, all to no avail. Network Manager (included with the GNOME3 group in the arch repositories) has been my favorite network manager to date, but it seems to not currently work with netcfg OR netctl. Getting annoyed with network manager caused me to decide to try connecting with wicd, which I have heard wonderful things about but have never tried. After attempting to get a connection up using wicd and netctl, I got tired and decided to go to bed.


Cue today. I figured that if wicd wouldn't connect with netctl, I'd give it a shot with netcfg. I haven't started yet, and I think at this point that I'm just going to wait until tomorrow or Monday (I'm gone all weekend) because it's been a pretty decent day and I don't feel like getting frustrated [again].


Long story short, I'm not entirely sure that netctl currently supports WPA2-Enterprise connections and the current documentation says nothing about any kind of WPA2 encryption. Assuming netcfg works, I'm just going to assume this is the case, because the other option is that my wireless card is borked (which wouldn't necessarily be a bad thing).


TL;DR: netctl says nope, gonna try netcfg.

March 7, 2013

The Wonderful World of Arch (Part 5) [Wireless]

This isn't really a continuation - it's more just my notes on getting wireless working with a Broadcom Wireless chip.

*** LONG ***

First thing first - do *another* system upgrade (I am assuming you are logged in as a normal user and have sudo installed - also assuming you have wired access):

sudo pacman -Syu

This ensures that you have the latest linux headers - required for broadcom wireless.
At this point, I would usually redirect you to the Arch Wiki, but I won't. Unfortunately, the wiki is kind of contradictory about broadcom chips. I'm going to post what worked for *me*. I can't promise that it will work for you, but hopefully it'll give you a good start.

I have a little aside to make now: Installing packages from the AUR (Arch User Repository).

To install a package from the AUR, open a browser (you can install one with pacman: sudo pacman -S chromium). Any browser from here will work. And search google with the string "AUR [package]". Either download the tarball in-browser or wget it from terminal.

cd to the directory the tarball downloaded to and run

tar -xzvf [archive name]

to untar the archive and cd to the directory created. Then run

makepkg

...this will create a *.pkg.tar.xz file which can be installed with

sudo pacman -U [package name].pkg.tar.xz

...this will install the new package.

***NOTE*** You can take a shortcut for installing things from the AUR with a package like aurget. The usage is very similar to that of pacman, hwoever it does not need to be run as root.

Step 1:
Install firmware
Begin by installing b43-fwcutter:

sudo pacman -S b43-fwcutter

Then install b43-firmware from the AUR.

Step 2:
Install broadcom-wl (the wireless driver [proprietary])from the AUR.
Remove b43 and ssb from the kernel with rmmod:

sudo rmmod b43
sudo rmmod ssb



***NOTE*** b43 and ssb may not be loaded - this is okay.

Load wl:

sudo modprobe wl

Check that lib80211 was loaded by wl with lsmod.

sudo lsmod | less

(hit q to exit) If not loaded, load it with

sudo modprobe lib80211

..and update dependencies

sudo depmod -a


Step 3:
Make the module load at boot by creating a file for each module in /etc/modules-load.d with the naming convention [module name].conf
Inside that file, write the module name. For example if you wanted to load wl at boot you would do

sudo nano /etc/modules-load.d/wl.conf

and write wl in the file. Save and exit nano.

You need to load wl, lib80211, and virtio-net at boot.

Configuring Wireless
For configuring wireless, I've chosen to configure everything manually rather than using a network manager like netcfg.
wireless_tools should already be installed. If for some reason it isn't, use pacman to install it.
Additionally, you should install iw and wpa_supplicant, both with pacman.

At this point, you should still be connected to your wired network. You can run ip addr to see the names and connection statuses of each of your interfaces. Make note of the interface that has no ip address - that is your wireless interface. From here on out, replace [interface] with the name of your interface.

***NOTE*** If trying to connect to an ad-hoc network, use "sudo iw [interface] set type ibss" to set your interface to ad-hoc.

Activate the interface with

sudo ip link set [interface] up

...and scan for wireless networks with

sudo iw dev [interface] scan | less

Take note of the SSID, and look for anything referring to WPA or WEP - it will be important when you configure the wireless connection.
The next part is dependent on what kind of security is on the network. Instructions can be found here.
Information on configuring wpa_supplicant.conf can be found here. I can't walk you through this is because it will be different for every network. If you're having trouble, some google-fu will definitely help.
Instead of running

sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf

...you should use

sudo wpa_supplicant -Dwext -i[interface] -c/etc/wpa_supplicant.conf -B

-D specifies the driver to use, -i specifies the interface, and -c specifies the configuration file.

From here, you're ready to grab an IP address with

sudo dhcpcd[interface]

...and check that it worked with

ip addr

If you see a line beginning with inet, you have an ip and everything is working!

The next (and final!) step is to configure the network to start at boot.
Create the "/etc/systemd/system/network.service" file with a text editor and make it like this:

[Unit]
Description=Network Connectivity
Wants=network.target
Before=network.target
BindsTo=sys-subsystem-net-devices-[interface].device
After=sys-subsystem-net-devices-[interface].device

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/ip link set dev [interface] up
ExecStart=/usr/sbin/wpa_supplicant -Dwext -i[interface] -c/etc/wpa_supplicant.conf -B
ExecStart=/sbin/dhcpcd [interface]

[Install]
WantedBy=multi-user.target


Save, and enable with

sudo systemctl enable network

...and reboot! Remove your ethernet cable and wireless should come up on boot! You can check by issuing ip addr.
Congratulations on your fully functioning Arch install!

March 6, 2013

The Wonderful World of Arch (Part 4) [Post-Install]

This is a continuation of my three previous posts, found here, here, and here.

Login using your username and password NOT as root! root should under NO circumstance be used as a normal user.

At this point, we've rebooted and we're ready to configure X.
First, we need to do a system upgrade (to get the latest linux headers) and install sudo.
For the moment, we need to login as root by typing su, then Enter, and then your root password at the password prompt.
Now we can upgrade the system, install sudo, and install X.
Do

pacman -Syu

to upgrade the system, and then:

pacman -S sudo

to install sudo.

Now we have to configure sudo to allow your non-root user to issue root commands.
The usual way to do this is by using:

visudo /etc/sudoers

...however this uses the editor vi, which I do not currently know how to use.

***NOTE*** There is a very good reason for needing to use visudo, which is explained here.

There is a solution to this though:

VISUAL="/usr/bin/nano -p" visudo

That command will open nano as the visudo editor.

In this file, you will need to uncomment the line that reads

# %wheel ALL=(ALL) ALL

by removing the # before the line.

Exit nano, and then type exit to get out of the root shell.

Now we install X.
X (or X11) is a window management system. Ubuntu, Mint, and SUSE all use X under a desktop environment to manage windows.
First, we have to install X from the Arch Repositories:

sudo pacman -S xorg-server xorg-xinit xorg-server-utils
pacman -S mesa


This will be different for everyone, so i'm not going to cover it, instructions can be found here.
If you have a laptop, you should install the synaptics package like so:

sudo pacman -S xf86-input-synaptics

Now to test X. First we install the test environment:

sudo pacman -S xorg-twm xorg-xclock xterm

and then run X:

startx

...and exit by exiting all of the open terminals (there should be 3).

Now that we know X works, it's time to install a GUI!
The desktop environment you choose is up to you - the instructions probably differ for each one. This page has a list of desktop environments (bear in mind that there are more than just those), each with install instructions. I chose Cinnamon because I think it looks gorgeous. The instructions for each DE are fairly straightforward, so I'll leave you on your own for those.

Next comes the display manager, which is essentially a graphical login screen. I chose SLiM, but there are many others. As with the desktop environments, these are fairly straightforward to install and i'm not going to go into the installation.

My next post will be about wrestling with getting WiFi up and working with a Broadcom Wireless chip! Now found here!


March 5, 2013

The Wonderful World of Arch (Part 3)

This is the continuation of my previous posts found here and here.

We left off having created a standard user, and now it's time to install the bootloader. I have decided to use GRUB.
First, install GRUB for BIOS systems:

pacman -S grub-bios

***NOTE*** The following process is for BIOS systems only. If your system uses UEFI, please refer to the documentation found in the Arch Beginners' Guide.

Next, open a virtual console with Alt+F2 and type root at the archiso login: prompt.
Now, create a BIOS boot partition as follows:

cgdisk /dev/sda

Select the 1007.0KiB empty partition and choose new (n).
Hit Enter twice, and when asked for the filesystem type, enter EF02. Do not name the partition.
Hit w to write the filesystem, and quit cgdisk.

Switch back to the original console with Alt+F1 and run grub-install like so:

grub-install --target=i386-pc --recheck /dev/sda
cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo


Now to configure GRUB, there's not actually much for you to do here, except run a command.

grub-mkconfig -o /boot/grub/grub.cfg

Now onto rebooting! type exit to exit the chroot environment, and unmount the partitions:

umount /mnt/{home,}

...and then reboot:

reboot

...sacrifice your best goat and chicken to the Arch Gods (and remove your installation media)...
...And hopefully it'll boot back up! Mine did!
Next post is about some post-installation stuff. Coming soon! Here!

March 4, 2013

The Wonderful World of Arch (Part 2)

This is a continuation of my previous post found here. Enjoy!

We left off looking at /mnt/etc/fstab in nano. We have the base system installed to sda and now we're going to configure the installation with

arch-chroot /mnt

I highly suggest following the Arch Beninners' Guide whilst doing this.
Now that you're in chroot, there are some files that need to be edited, locale.gen and locale.conf.
First, do

nano /etc/locale.gen

...and uncomment the line(s) with UTF-8 of the locale(s) you desire, in my case en_US.UTF-8 UTF-8. Then exit nano, saving the edited file.
Next, run

locale-gen

The next file, locale.conf doesn't exist yet, so we're going to make it with:

echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8


***NOTE*** Replace en_US.UTF-8 with the locale you chose if using a locale other than English
Next, we will set the time zone.
Use

ls /usr/share/zoneinfo

to see all available countries, then list the directory with your country, for example:

ls /usr/share/zoneinfo/America/

Choose the city nearest you (New York for me), and create a symlink:

ln -s /usr/share/zoneinfo/America/New_York /etc/localtime

Then set the hardware clock:

hwclock --systohc --utc

Now, I'm going to set a hostname by doing

echo EXAMPLE_HOSTNAME > /etc/hostname

Next, we're going to configure the wired network interface to start at boot.

***NOTE*** The following section has been FIXED. This is now unnecessary.

***NOTE*** The Arch Beginners' Guide points out that there is currently a bug in the install .iso that sets the interface name to something different after a reboot than the one used during installation. They have provided a script that will act as a workaround for now. That script follows here:

for i in /sys/class/net/*; do
echo "==$i"
udevadm test-builtin net_id "$i";
echo
done 2>/dev/null


In the following configuration, the value of ID_NET_NAME_PATH will be used in place of [interface]
We will be using netcfg for wired connections.
Install ifplugd with

pacman -S ifplugd

...and change the value for WIRED_INTERFACE to the value of ID_NET_NAME_PATH like so:

nano /etc/conf.d/netcfg

and change

WIRED_INTERFACE="eth0"

to

WIRED_INTERFACE="[interface]"

...and finally enable the service:

systemctl enable net-auto-wired.service

Also, enable dhcpcd to run at boot:

systemctl enable dhcpcd

***NOTE*** I am intentionally skipping wireless for now, as that it a BEAST to configure on the 6910p (If anyone's curious why, check Arch's wiki on Broadcom Wireless [yes, they have an entire section of the wiki specifically for Broadcom])

Next we're going to configure pacman (no, not the game, the [pac]kage [man]ager).
There are tons of articles on using pacman, but for now we're just going to be very basic and simply configure it.
***NOTE*** This only applies if installing x86_64 (a 64-bit system)
Selecting repositories:
Do

nano /etc/pacman.conf

...and scroll down to the line that reads #[multilib].
Uncomment that line and the two line following it and run

pacman -Sy

Next, set a root password with

passwd

Please make sure that this is a strong password as it is your root password. If you don't know what root is, this is a good explanation.
Next, we will create a normal user with useradd, like so:

useradd -m -g users -G wheel -s /bin/bash [username]
passwd [username]


Let's break that down:
useradd - add user command.
-m - makes the user's home folder at /home/[username]
-g users - the user's primary group, in this case, users
-G wheel - any supplementary groups, wheel for this user
-s /bin/bash - the user's login shell
[username] - username, must be alphanumeric (letters and numbers) and all lower case
passwd [username] allows you to set the password for [username]

In my next post, we'll be installing the bootloader and rebooting! Coming Soon! Here!

The Wonderful World of Arch (Part 1)

So I decided today that I was going to try installing Arch Linux. Again.

For anyone interested, I'm installing on an HP Compaq 6910p with 3GiB RAM and a Core 2 Duo

A lot of this is also me making notes so that, if I decide to try again, I won't have to go back to the wiki (found here), so please bear with me.

It's best to start with an empty hard disk, however I was installing over (not alongside) an Ubuntu 12.04 installation.

I used the Linux Live USB Creator (LiLi) to install the arch .iso (2013.03.01 if you're wondering) to a USB key - this is the easiest part (in my opinion). The only thing is that you have to rename the USB label to the the value of archisolabel found at /loader/archiso-x86_64.conf. You can open this with any text editor. You also have to change the value in the autorun.inf to that same value. You're now ready to boot!

To boot from USB, I have to hit F9, but it's different for pretty much every system. Common keys are F2, Del, Esc, F11, and F12.

When the live disk boots, you will be automatically logged in as root. At this point, you have a decision to make - which partitioning scheme to use. Your two options are MBR and GPT. I'm by no means an expert, and you should look elsewhere for more information on MBR vs GPT, but suffice it to say that GPT is newer. I chose to use GPT. You can create GPT partitions using:

cgdisk /dev/sda

The ncurses interface is actually pretty decent, and is fairly self explanatory, so i'm just going to give an overview of what to do:
Step 1:
Delete any and all existing partitions. This WILL delete ANY data on the disk. MAKE A BACKUP!
Step 2:
Create your "/" (root) partition. This should be around 15-20GiB
***NOTE*** This will also create 1007KiB of free space. This is normal.
Step 3:
Create your "/home" and any other partitions you desire - feel free to fill up any remaining space on the disk!

(Q)uit cgdisk, and format the partitions. I used ext4.
If you're having trouble remembering which partition is which, you can use lsblk. sda is your primary hard disk, sda1 is (generally) your root partition, and sda2 is your home partition. If you're still having trouble distinguishing partitions, check the sizes to help you differentiate.
You can format the partitions with:

mkfs.ext4 dev/sda1
mkfs.ext4 dev/sda2


Next, mount the partitions: ***NOTE*** This is different for people with UEFI motherboards

mount /dev/sda1 /mnt
mkdir /mnt/home
mount /dev/sda2 /mnt/home


Next, you may want to check your pacman mirrorlist (but not absolutely necessary):

nano /etc/pacman.d/mirrorlist

Once you're done with that (or if you decided to skip it),
you're ready to install the base system:

pacstrap /mnt base base-devel

This is a script that does the installation for you!
Generate an fstab with:

genfstab -L -p /mnt >> /mnt/etc/fstab

and edit with

nano /mnt/etc/fstab

Like I said, I'm not an expert, so go here for more help. Also, the Arch Beginners' Guide is fantastic!

Part 2 coming soon! is now here!