Installing Debian GNU/Linux for amd64

Write your "How To" regarding anything you are comfortable with and you feel it will help the forum members.

NOTE :: All threads started here will appear only after the approval from Administrator
Post Reply
yadhie
Posts: 53
Joined: Fri Mar 30, 2007 7:44 pm
Contact:

Installing Debian GNU/Linux for amd64

Post by yadhie »

Installing Debian GNU/Linux for amd64
The Debian-Installer

Using Debian-Installer is the preferred installation method for the Debian GNU/Linux distribution, and therefore for the unofficial amd64 port too.

Builds of the installer images for netboot, monolithic, hd-media and cdrom can be found on the /debian-installer directory of each mirror. For example, if your chosen mirror is:

http://ftp.de.debian.org/debian-amd64/

then you will need to append /debian-installer to that path, in order to obtain the following:

http://ftp.de.debian.org/debian-amd64/debian-installer/

A complete list of mirrors can be found at http://amd64.debian.net/README.mirrors.html.

Netinst, businesscard, full CD and DVD set, along with other ISO images can be found at the following locations:

*

Stable: http://cdimage.debian.org/cdimage/unoff ... rge-amd64/.
*

Testing: http://www.debian.org/devel/debian-installer/.
*

Unstable: it is possible to install the unstable distribution using a netboot method or business card CD image from testing. Please read this FAQ first.

The Debian-Installer **** for the AMD64 architecture is to be found at http://amd64.debian.net/docs/installmanual/en/; if you have trouble writing the iso images to cd-rw, see this url: http://www.debian.org/CD/faq/.

All general D-I bugs are tracked in the Bug Tracking System.
Installing into a chroot
Before you start

Before you start bootstrapping the pure64 port into a chroot, make sure you are already running a 64bit kernel, or boot from a Debian-Installer CD in order to accomplish the following steps.

If you already have an existing i386 Debian installation, you can install the amd64 kernels found in the archive.
Bootstrapping the chroot

* Make sure you are running a 64bit kernel.
*

Create a directory to install the pure64 chroot into. If you want the chroot to be bootable as well, format a spare partition or add a new harddisk for the root of your new pure64 install. Then mount it somewhere, like /pure64.
*

You can use debootstrap or cdebootstrap. For Sid aka unstable, run:

cdebootstrap --arch amd64 sid /pure64/ http://ftp.debian.org/debian/

or

debootstrap --arch amd64 sid /pure64/ http://ftp.debian.org/debian/

And for Sarge (unofficial mirror required):

cdebootstrap --arch amd64 sarge /pure64/ http://amd64.debian.net/debian-amd64/

or

debootstrap --arch amd64 sarge /pure64/ http://amd64.debian.net/debian-amd64/

You will want to use a mirror faster for you than alioth; see the sources.list section below.
* If you decided to create a bootable chroot, you will need to

cp /etc/hostname /etc/resolv.conf /etc/network/interfaces /mnt/etc

and set up the fstab.
*

Finally, run:

chroot /pure64

and then:

apt-get install locales

from within it. You will also want to set up your /etc/apt/sources.list.

The sources.list

A complete list of publically accessible mirrors for your source.list is provided - you might want to check which one is fastest for you, and use that one. You can find this list here: Debian worldwide mirror sites. The unofficial list of mirrors which contains the unofficial AMD64 Sarge release can be found here. This can be useful also for some Etch packages which have not yet been rebuilt in the official archives.

Please mind that since sarge, there are no Non-US binary packages any longer.
Finishing the installation

Until console-data is fixed, you need to select the keymap from the full list, not from the arch list as is usual. To get the debconf question again, run:

dpkg-reconfigure -plow console-data

and select the appropriate keymap from the list. Or simply install the boot-time keymap by hand:

install-keymap de-latin1-nodeadkeys

or whatever keymap you are used to.
Using an IA32 chroot to run 32bit applications
Introduction

The current amd64 port of debian is a pure 64bit port. This means you can't run binary only programs which are compiled for IA32 or applications which haven't been ported to AMD64 yet (e.g. OpenOffice.org). This is because you can't mix 32bit applications and 64bit libraries. You would also need the 32bit versions of the libraries to run a 32bit application.

This chapter explains how you can run 32bit applications in your 64bit system using the IA32 libs from a IA32 chroot and running IA32 applications inside this chroot, in a way which is mostly transparent to the user.

Please make sure to read all the following sections before actually choosing one way rather than another.
The quick way

There is already a minimal set of IA32 libraries packaged for use in a 64bit Debian system. Simply type:

apt-get install ia32-libs

and you will be able to run most 32bit binaries within your system. In other words, you don't need a whole chroot to run quite a few programs: installing ia32-libs is a solution for most cases.

It is also possible to build 32bit binaries within a 64bit environment. For instance, you can do something like:

gcc -m32 hello.c -o hello

and verify that your Hello World program is 32 bit. Of course, you can also run it.

One last thing: for 32bit programs needing X locales you might also want to

export XLOCALEDIR=/emul/ia32-linux/usr/X11R6/lib/X11/locale

Installing a Debian IA32 chroot system

First you need to install a IA32 base system into a chroot. You can do this with the debootstrap command:

debootstrap --arch i386 sid /var/chroot/sid-ia32 http://ftp.debian.org/debian/

To install a few more libraries you can change into this chroot and install/update packages with apt-get:

chroot /var/chroot/sid-ia32
apt-get install libx11-6

To run an application inside the chroot you will need some parts of your 64bit system tree inside the chroot. This can be achieved with a bind mount. In this example we will bind /tmp to the chroot for the X11 sockets which are in /tmp, and bind /home to access the home directories from within the chroot. You may also want to mount the /dev, /proc and /sys filesystems within the chroot. Edit your fstab and add the required paths:

# sid32 chroot
/home /var/chroot/sid-ia32/home none bind 0 0
/tmp /var/chroot/sid-ia32/tmp none bind 0 0
/dev /var/chroot/sid-ia32/dev none bind 0 0
/proc /var/chroot/sid-ia32/proc none bind 0 0

Then mount them:

mount /var/chroot/sid-ia32/home
mount /var/chroot/sid-ia32/tmp
mount /var/chroot/sid-ia32/dev
mount /var/chroot/sid-ia32/proc

You will also need to set up the relevant users in the chroot. Copy your /etc/passwd, /etc/shadow and /etc/group files to the chroot, or add the users manually to the passwd/shadow of your chroot. It is also possible to hard link the files when they are on the same partition. Just make sure the user exists also in the chroot. To avoid locale problems you might also want to set up /etc/environment.

WARNING! Remember that if you bind your home directory and delete your chroot, all your personal data will be lost. So do not forget to umount your home before eventually erasing a chroot.

Please note that if you are using schroot there are chances you can avoid binding directories and copying or hard linking files. Check schroot manpage and modify /etc/schroot/setup.d/10mount to match your needs.
Running applications inside the chroot (e.g. OpenOffice.org)

At this point you should be able to run applications within the chroot. Change to your chroot (you must be root to do this):

chroot /var/chroot/sid-ia32

Change to the user under which you want to run the program:

su - zumsel

Set your $DISPLAY:

export DISPLAY=:0

And run something:

openoffice

Of course you must have installed the package inside the chroot for this to work.
Running applications inside a chroot using schroot

There is also an easier way to run applications inside the chroot with the schroot. Leave the chroot and install the schroot package. schroot allows users to change into several chroots and run commands inside them. You must add your chroot to /etc/schroot/schroot.conf to allow users to change into it. This can be done as follows:

[sid32]
description=Debian Sid i386 (sid32)
location=/var/chroot/sid-ia32
priority=3
groups=zumsel,root
root-groups=root
aliases=default,unstable,ia32
personality=linux32
type=plain
run-exec-scripts=true
run-setup-scripts=true

In this case, /etc/resolv.conf, /etc/passwd, /etc/shadow and /etc/group will be copied at each time a schroot session is started. On the other hand, you still need to explicitly bind the directories you need.

Now you should be able to run commands inside the chroot as normal user:

schroot -c sid32 -p openoffice

Or, if the [sid32] stanza in your /etc/schroot/schroot.conf contains aliases=default, you can simply run:

schroot -p openoffice

This will run openoffice in the sid32 chroot you specified in /etc/schroot/schroot.conf. The option -p preserves the user's environment so you don't have to set DISPLAY or such things manually.

You can make things slightly simpler even than this. Write a small shell script like the following, and place it in your PATH, e.g. /usr/local/bin/do_schroot. This script can look like the following:

#!/bin/bash

exec schroot -p -c sid32 -q -- "`basename $0`" "$@"

Make it executable:

chmod 755 /usr/local/bin/do_schroot

Now create a symlink to this script from each command you want to run inside the chroot to this shell script:

cd /usr/local/bin
ln -s do_schroot openoffice
ln -s do_schroot oowriter
ln -s do_schroot oocalc

Now you can execute openoffice by simply typing openoffice or oowriter.

You can also pass filenames on the command line to openoffice since the paths are the same inside the chroot.
The future: Multiarch

While architectures like sparc64 or powerpc64, which provide lib for default 32bit libraries and lib64 for extra 64bit libraries, default to executing 32bit applications, amd64 defaults to 64bit binaries because of the performance benefits it offers in 64bit mode. Thus, not wanting to rewrite virtually every binary-arch package's creation rules to install libs in lib64 not lib, and wanting to find a solution for all multiarch capable platforms debian supports, various people are working on so-called multiarch support.

All relevant information concerning multiarch is assembled on http://people.debian.org/~taggart/multiarch/.
FAQ
Is AMD64 the same as IA64?

No. IA64 is Intel's designation for their Itanium architecture. Intel's name for their AMD64-compatible architecture is EM64T (Extended Memory 64 Technology). IA64 systems are a completely different architecture.
Not yet an official port?

It is! Please read this page for information about how to switch to an official mirror, if you haven't done so yet.
So, when will it be released?

The first planned official Debian release of 64bit userland for AMD64 will be Etch (Sarge+1).

The unofficial sarge based on the debian-amd64 port can be found here: http://cdimage.debian.org/cdimage/unoff ... rge-amd64/. Security updates will be provided by the AMD64 porting team.
Which distributions are available: stable, testing, unstable?

Currently, there are 4 distributions available, 2 official and 2 unofficial:

* debian-amd64 sid - unstable, available in the official Debian archive.
* debian-amd64 etch - testing, available in the official Debian archive.
* debian-amd64 sarge - plain stable distribution as if amd64 was already a supported architecture and the packages where in the official archive. It has been released right after the official sarge distribution has been released. It will never be official.
* debian-amd64 stinkypete - unsupported packages which did not make it into supported sarge for obvious reasons (hence the codename). It has to be used as an extension to sarge, not an alternative.

How stable is debian-amd64?

The port is being worked at since the beginning of 2004, and many people use it for both workstations and servers. The stable suite is recommended for servers and workstations, featuring security updates and debian-volatile support.

There are 64bit related problems in approximately 200 packages. Most of these packages will simply fail to build, some of them will cause segmentation violations. Experience shows, however, that the former is more common than the latter. The vast majority of packages with known 64bit problems cannot be built at all.

For most workstations, a 32 bit chroot is still necessary in order to run some common applications, namely OpenOffice.org, WINE, MPlayer with Win32 codecs and Mozilla with Flash. Nonetheless, a growing number of people use these ports on their desktop system, and are really happy with it.
Can I `apt-get arch-upgrade` from an already installed i386 debian?

No. You need to reinstall on a newly formatted partition or disk, by either running cdebootstrap / debootstrap from your running installation or using the Debian-Installer.
I want to run i386 userland with a 64bit Linux kernel

Running 32bit userland with a 64bit kernel is recommended only for servers needing the absolute stability of 10 years of 32bit debian, but without the memory limitations the IA32 architecture bears, for example a 64bit mysql server on a system with 8GB or 16GB memory.

Running the mixed setup on a workstation is not recommended, because iptables, the XFS filesystem, non-free NVidia and ATI binary drivers do currently not support it.
I my (insert mainboard/nic/disk subsystem here) supported?

*

Mainboards: Every currently available amd64 mainboard should work with pure64; If you want to run sarge on it, you will probably archive the best results with an older VIA or AMD based board, due to the old kernel found in the sarge installer. Nforce4 based boards are likely to not run with the sarge installer, as SIS and ATI boards are neither. You should use the etch installer on those and install the newest kernel from backports.org on those boxes, if you want to run sarge on them. SIS boards are likely to cause the most trouble.
*

Most network interface cards should work out of the box; nforce4 onboard nics (forcedeth) will not work with the sarge installer, neither will newer Marvell/Yukon (skge) NICs.
*

Most Sata/scsi/pata drivers should work; the sarge installer does not know about newer nforce4/sis/ati chipsets, so you will probably end without DMA or without disks at all. dpt_i2o scsi hosts are supported using the i2o drivers; newer 3ware **** and mpt/fusion need a recent kernel and should be installed too using the etch installer and he latest backports.org kernel.

I get "could not install root!" while [c]debootstrapping pure64.

Make sure the following points apply:

* You actually have a 32/64 bit kernel running.
* You have at least cdebootstrap version 0.2.5 or debootstrap version 0.2.38

When running apt-get update, I get a GPG error...

Since apt 0.6 has landed in Debian Unstable, it's now possible to verify if the packages that you install are legitimate. This means that when you download a package apt will verify that the author is who he claims to be and that the package is the same package he uploaded. If the error you get looks like:

The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8899AABBCCDDEEFF

then, if you trust the repository, you should download that key and add it to your list of trusted keys, in this way:

# gpg --keyserver subkeys.pgp.net --recv-keys 8899AABBCCDDEEFF
# gpg --armor --export 8899AABBCCDDEEFF | apt-key add -

All problems should be solved next time you run apt-get update. You can check if that key is now considered safe with the following command:

apt-key list

Which Linux kernel to use with my CPU?

The Debian Kernel Team maintains 64bit kernel packages for both i386 and amd64, featuring different kernel flavours for AMD64 and EM64T systems as well as UP and SMP flavours.

* amd64-generic - this is the installer kernel, running on all amd64 compatible architectures known.
* amd64-k8 - the uniprocessor AMD Athlon64, AthlonFX, Opteron **** and Turion64 flavour. If your CPU vendor is AMD and you have a single processor in your box, this is what you want.
* amd64-k8-smp - the Multiprocessor/Multicore AMD Athlon64 X2 and Opteron ****/**** flavour, with NUMA support.
* em64t-p4 - this flavour is intended for single processor Intel Pentium4 systems, with HT disabled.
* em64t-p4-smp - if you have an Intel "Nocona" Xeon, a Pentium D or want to run Pentium4 in HT mode.

Note: The Debian kernels are 64bit, need an initrd, and have IA32 emulation enabled by default.

If you want to compile the kernel yourself, the latest 2.6 kernel is recommended. At least Linux 2.6.5 is need to build a kernel with IA32 emulation using the toolchain from amd64. Also, Athlon 64 X2 (Dual-Core) processors require Linux 2.6.14 or newer. Latest versions are always the best.

Linux 2.4 series kernels are not supported, the system will not boot lacking NPTL suppport.
Is there any alternative to the Linux kernel?
Yes, there is the Debian GNU/kFreeBSD project for AMD64. For additional information check this page.
Is my Nvidia card supported?

The NVidia drivers for amd64 are known to work with linux 2.6.5 and newer kernels. The official debian nvidia-graphics-driver packages support amd64, everything works the same way as you might be used to with i386. It is not recommended to install using the NVidia driver installer, because it is based on a different directory layout than the debian amd64 port.

Installing the NVidia drivers is **** in /usr/share/doc/nvidia-kernel-source/README.Debian

Since the **** is i386 centristic, these are the short instructions for amd64:

* Add contrib and non-free to your sources.list and update your package index files. Please also have a look at Randall Donald's page.
* Install all needed packages: nvidia-kernel-source, nvidia-kernel-common, kernel-headers-2.6.8-10-amd64-k8 (or whatever matches the installed kernel). Sarge will likely require gcc-3.4 too.
* Go to /usr/src/kernel-headers-2.6.8-11-amd64-k8 (or whatever headers you installed) after you unpacked the nvidia-kernel-source tarball in /usr/src and run:

make-kpkg modules_image

or, if you are using Sarge:

MAKEFLAGS="CC=gcc-3.4" make-kpkg modules_image

* Install the created nvidia-kernel-*.deb, nvidia-glx and nvidia-glx-dev to get everything setup correctly.

Sarge users please note also that there's an available linux 2.6.15 kernel built with gcc-3.3 available at backports.org. In other words you won't need to use gcc-3.4 as stated before, if you use that kernel.

Please also note that using a 64 bit kernel with a 32 bit userland won't let NVidia drivers work properly.
Is my ATI card supported?

Old ati radeon cards up to the 9200 model are mostly supported by the free GLX drivers in XFree86.

For newer cards (unfortunately except the X1x00 series), ATI has released its fglrx drivers for amd64. See the mailing list archive starting at Jan. 2005 for informations. There are no prebuilt debian packages available in the unofficial amd64 archive, but the package sources already do support it. However, there's an unofficial repository available at the Fabio Stanchina's page.
I want to use 802.11g wavelan...

Most wavelan cards with native linux support do work in a 64bit kernel too. If your card is not supported by Linux directly, you might need to setup ndiswrapper. See the corresponding **** of that package.
Is there no flash plugin for mozilla?

No. If you really need to access such webpages, install mozilla and flashplugin-nonfree in your 386 chroot and use the 32bit browser to access the sites.
Has anyone successfully installed VMWare on amd64?

You probably need the any-any patch found here. It is a file named like vmware-any-any-update101.tar.gz; extract it and run runme.pl.

If you are running an old VMware version with a recent (2.6.12+) kernel, you may need to run (as root) the following:

echo "#include <linux/ioctl32.h>" > /lib/modules/`uname -r`/build/include/asm/ioctl32.h

I found a bug in package xyz which I want to report...

In general, all bugs concerning a debian package should be reported to the Debian Bug Tracking System (BTS), whether they are amd64 only or not. If you can reproduce the very same bug on another, officially supported debian architecture, even better.

Typically, bugs showing up in the amd64 ports are general unstable bugs, concerning all supported architectures. You can verify this by checking the BTS, often the very same bug was already reported by someone else for some other architecture.

If you encounter a bug not listed in the BTS, please report it. If you think this is a 64bit bug or an amd64-only issue, please send a copy to the mailing list using the X-Debbugs-CC: header. See http://www.debian.org/Bugs/Reporting for details on how to report bugs to the BTS.
Why no sparc64-like biarch port?

The cross-build environment is based on this, and the so-called "old-biarch" found on alioth is, too. However, it will be superseded by multiarch when the latter is ready. Look at the multiarch section of this **** for more information.


source : https://alioth.debian.org/docman/view.p ... howto.html


SHAdmin
Posts: 2089
Joined: Sat Dec 18, 2004 11:28 am
Contact:

Post by SHAdmin »

Thank you for sharing the great 'How to' with the community members.

Your account has been credited 15 points for sharing it.
Post Reply