Debian: Difference between revisions

From miki
Jump to navigation Jump to search
(Created page with '==Apt sources== Add these lines to <tt>/etc/apt/sources.list</tt> <pre> deb http://ftp.belnet.be/debian/ lenny contrib deb-src http://ftp.belnet.be/debian/ lenny contrib deb htt…')
 
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Apt sources==
== References ==
* [https://debian-handbook.info/browse/stable/ Debian 10 administrator handbook]
Add these lines to <tt>/etc/apt/sources.list</tt>
: Not read, but probably lot of cool things.
<pre>
deb http://ftp.belnet.be/debian/ lenny contrib
deb-src http://ftp.belnet.be/debian/ lenny contrib


;Archives
deb http://ftp.belnet.be/debian/ lenny non-free
* http://snapshot.debian.org/ &mdash; A wayback machine that contains snapshot of Debian archive repositories, accessible by date or version number.
deb-src http://ftp.belnet.be/debian/ lenny non-free
* http://archive.debian.org/
</pre>

;Packaging
* https://www.jelmer.uk/fresh-builds.html
: Post with many information on how Debian manage packages, etc.

== Install ==
=== Booting from hard-disk ===
Reference: [https://d-i.debian.org/manual/en.i386/apas02.html#howto-getting-images-hard-disk Debian Installer - Booting from hard-disk]

Copy files '''<tt>initrd.gz</tt>''' and '''<tt>vmlinuz</tt>''' from one of the repository below to '''<tt>/boot</tt>''', then copy the netinst installation {{file|.iso}} CD/DVD file in the root of one of the hard-drive partitions (e.g. root of {{file|/home}} partition).

;initrd.gz and vmlinuz
* Debian testing [http://ftp.debian.org/debian/dists/testing/main/installer-amd64/current/images/hd-media/ amd64].

;Netinst installation media
* Debian testing [https://cdimage.debian.org/cdimage/buster_di_alpha4/amd64/iso-cd/debian-buster-DI-alpha4-amd64-netinst.iso amd64]


Then restart the PC, and type in the GRUB command-line (press '''c''' in GRUB menu).
For '''Grub 2 (recent)''':
<source lang=bash>
# Note: change /boot/vmlinuz to vmlinuz and /boot/initrd.gz to initrd.gz if selected partition is mounted as /boot.

ls # List available partitions
ls (hd0,msdos6) # View partition information
ls (hd0,msdos6)/ # View partition content
linux (hd0,msdos6)/boot/vmlinuz
initrd (hd0,msdos6)/boot/initrd.gz
boot
</source>

See [[Ubuntu]] page for older Grub versions.

=== Download installation media ===
;Reference: https://www.debian.org/CD/faq/

The whole debian archive can be downloaded as separate DVD (currently '''16 dvds''' for amd64 architecture).

The best method is to use <code>jigdo-lite</code> from the {{deb|jigdo-file}} package [https://www.debian.org/CD/jigdo-cd/],[http://atterer.org/jigdo/debian-jigdo-mini-howto].
* Reconstructs the same ISO file as available through HTTP.
* Download package from standard mirror, which are usually faster / less loaded.
* Can reuse past downloaded images if available.

<source lang="bash">
sudo apt install jigdo-file
mkdir debian_10
cd debian_10

# We will download the first 3 DVDs
jigdo-lite

# To resume a half-finished download, enter name of .jigdo file.
# To start a new download, enter URL of .jigdo file.
# You can also enter several URLs/filenames, separated with spaces,
# or enumerate in {}, e.g. `http://server/cd-{1_NONUS,2,3}.jigdo'
# jigdo: https://cdimage.debian.org/debian-cd/current/amd64/jigdo-dvd/debian-10.3.0-amd64-DVD-{1,2,3}.jigdo
#
# -----------------------------------------------------------------
# The jigdo file refers to files stored on Debian mirrors. Please
# choose a Debian mirror as follows: Either enter a complete URL
# pointing to a mirror (in the form
# `ftp://ftp.debian.org/debian/'), or enter any regular expression
# for searching through the list of mirrors: Try a two-letter
# country code such as `de', or a country name like `United
# States', or a server name like `sunsite'.
# Debian mirror [http://deb.debian.org/debian/]: http://ftp.be.debian.org/debian/
#
# -----------------------------------------------------------------
# The jigdo file also refers to the Non-US section of the Debian
# archive. Please repeat the mirror selection for Non-US. Do not
# simply copy the URL you entered above; this does not work because
# the path on the servers differs!
# Debian non-US mirror: http://archive.debian.org/debian-non-US/
</source>

; Jigdo files:
* For amd64: <code>https://cdimage.debian.org/debian-cd/current/amd64/jigdo-dvd/debian-10.3.0-amd64-DVD-{1,2,3}.jigdo</code> (note: up to 16 DVD available).
* For i386: <code>https://cdimage.debian.org/debian-cd/current/i386/jigdo-dvd/debian-10.3.0-i386-DVD-{1,2,3}.jigdo</code> (note: up to 16 DVD available).

; List files
* It is not recommended to download all DVD, but only the first few (say three). Packages are sorted by popularity, so the first DVDs will contain the most popular packages.
* To find out in which DVD some package is located, use the list files.
* Get the list files ({{file|*.list.gz}}) from the mirror:
:* amd64: https://cdimage.debian.org/cdimage/release/current/amd64/list-dvd/
:* i386: https://cdimage.debian.org/cdimage/release/current/i386/list-dvd/

;Write images to USB
* Simple as using <code>cp</code> [https://www.debian.org/CD/faq/#write-usb]:
<source lang=bash>
sudo cp image.iso /dev/sdx # /dev/sda, /dev/sdb... - DOUBLE CHECK DESTINATION!
pv image.iso > /dev/sdx # As root, to get progress
</source>

; Live images
* [https://cdimage.debian.org/images/unofficial/non-free/images-including-firmware/weekly-live-builds/amd64/iso-hybrid/ List of Debian + Live + Testing + Non-Free images]

=== Install Testing ===
See https://wiki.debian.org/DebianTesting.

==Apt==
See [[Apt]] for more information on package management system.

=== sources.list ===
Example {{file|/etc/apt/sources.list}} file for Debian 8, aka. ''Jessie'':
<source lang=bash>
# Stable
deb http://ftp.debian.org/debian/ jessie main contrib
deb-src http://ftp.debian.org/debian/ jessie main contrib
deb http://security.debian.org/ jessie/updates main contrib
deb-src http://security.debian.org/ jessie/updates main contrib

# Testing
deb http://ftp.debian.org/debian/ testing main contrib
deb-src http://ftp.debian.org/debian/ testing main contrib
deb http://security.debian.org/ testing/updates main contrib
deb-src http://security.debian.org/ testing/updates main contrib

# Unstable / Sid
# deb http://ftp.debian.org/debian/ sid main contrib
# deb-src http://ftp.debian.org/debian/ sid main contrib

# Backport
deb http://ftp.debian.org/debian jessie-backports main contrib
deb-src http://ftp.debian.org/debian jessie-backports main contrib

# jessie-updates, previously known as 'volatile'
# A network mirror was not selected during install. The following entries
# are provided as examples, but you should amend them as appropriate
# for your mirror of choice.
#
# deb http://ftp.debian.org/debian/ jessie-updates main contrib
# deb-src http://ftp.debian.org/debian/ jessie-updates main contrib
</source>

Using CD-ROM, with multiarch:
<source lang=bash>
# CDROM
deb [arch=i386] cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official i386 DVD Binary-3 20170116-10:09]/ jessie contrib main''
deb [arch=i386] cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official i386 DVD Binary-2 20170116-10:09]/ jessie contrib main
deb [arch=i386] cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official i386 DVD Binary-1 20170116-10:09]/ jessie contrib main
deb [arch=amd64] cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official amd64 DVD Binary-1 20170116-11:01]/ jessie contrib main
deb [arch=amd64] cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official amd64 DVD Binary-2 20170116-11:01]/ jessie contrib main
deb [arch=amd64] cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official amd64 DVD Binary-3 20170116-11:01]/ jessie contrib main
</source>
Note that when using <code>apt-cdrom add</code>, <code>apt</code> does not add the arch field <code>[arch=i386]</code> or <code>[arch=amd64]</code>.

=== preferences ===
Example {{file|/etc/apt/preferences}}:
<source lang=bash>
Package: *
Pin: release a=stable
Pin-Priority: 500

Package: *
Pin: release a=jessie-backports
Pin-Priority: 475

Package: *
Pin: release a=testing
Pin-Priority: 450

Package: *
Pin: release a=unstable
Pin-Priority: 400
</source>

=== Multi-arch support ===
* https://wiki.debian.org/Multiarch/HOWTO

To add support for '''i386''' architecture:
<source lang=bash>
dpkg --add-architecture i386
</source>

For CD-ROM repository, we must add the ''arch'' field manually. For instance:
<source lang=bash>
deb [arch=amd64] cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official amd64 DVD Binary-1 20170116-11:01]/ jessie contrib main
</source>

=== Archives ===
These repositories contain old versions of Debian packages:
* http://snapshot.debian.org/
: A wayback machine that contains snapshot of Debian archive repositories, accessible by date or version number.
* http://archive.debian.org/

== How-To ==
=== Install PHP5.6 CLI on Debian Stretch ===
* Install package {{deb|libqdbm14}} from Stretch repository.
* Download and install packages {{deb|libonig2}}, {{deb|php5-cli}}, {{deb|php5-common}}, {{deb|php5-json}} from https://packages.debian.org/jessie/.
<source lang="text">
libonig2_5.9.5-3.2_amd64.deb
php5-cli_5.6.30+dfsg-0+deb8u1_amd64.deb
php5-common_5.6.30+dfsg-0+deb8u1_amd64.deb
php5-json_1.3.6-1_amd64.deb
</source>
* PHP5 binary is at {{file|/usr/bin/php5}}.

;Alternatives
* Use co-installable PHP7 / PHP5.6 from https://deb.sury.org/.


== NTFS ==
== NTFS ==
The package '''ntfs-3g''' is not installed by default, and if so, the link <tt>/sbin/mount.ntfs</tt> &rarr; <tt>/sbin/mount.ntfs-3g</tt> is missing.
The package '''ntfs-3g''' is not installed by default, and if so, the link <tt>/sbin/mount.ntfs</tt> &rarr; <tt>/sbin/mount.ntfs-3g</tt> is missing.

== Troubleshoot ==
=== Apt-offline - ERROR: Failed to sync file ===
Occurs with <code>apt-offline=1.7.2</code>. Solution is to install {{deb|python-lzma}} on the ''OFFLINE'' system. [https://github.com/rickysarraf/apt-offline/issues/37].

Latest revision as of 09:18, 8 April 2022

References

Not read, but probably lot of cool things.
Archives
Packaging
Post with many information on how Debian manage packages, etc.

Install

Booting from hard-disk

Reference: Debian Installer - Booting from hard-disk

Copy files initrd.gz and vmlinuz from one of the repository below to /boot, then copy the netinst installation .iso CD/DVD file in the root of one of the hard-drive partitions (e.g. root of /home partition).

initrd.gz and vmlinuz
Netinst installation media


Then restart the PC, and type in the GRUB command-line (press c in GRUB menu). For Grub 2 (recent):

# Note: change /boot/vmlinuz to vmlinuz and /boot/initrd.gz to initrd.gz if selected partition is mounted as /boot.

ls                                   # List available partitions
ls (hd0,msdos6)                      # View partition information
ls (hd0,msdos6)/                     # View partition content
linux (hd0,msdos6)/boot/vmlinuz
initrd (hd0,msdos6)/boot/initrd.gz
boot

See Ubuntu page for older Grub versions.

Download installation media

Reference
https://www.debian.org/CD/faq/

The whole debian archive can be downloaded as separate DVD (currently 16 dvds for amd64 architecture).

The best method is to use jigdo-lite from the jigdo-file package [1],[2].

  • Reconstructs the same ISO file as available through HTTP.
  • Download package from standard mirror, which are usually faster / less loaded.
  • Can reuse past downloaded images if available.
sudo apt install jigdo-file
mkdir debian_10
cd debian_10

# We will download the first 3 DVDs
jigdo-lite

# To resume a half-finished download, enter name of .jigdo file.
# To start a new download, enter URL of .jigdo file.
# You can also enter several URLs/filenames, separated with spaces,
# or enumerate in {}, e.g. `http://server/cd-{1_NONUS,2,3}.jigdo'
# jigdo: https://cdimage.debian.org/debian-cd/current/amd64/jigdo-dvd/debian-10.3.0-amd64-DVD-{1,2,3}.jigdo
# 
# -----------------------------------------------------------------
# The jigdo file refers to files stored on Debian mirrors. Please
# choose a Debian mirror as follows: Either enter a complete URL
# pointing to a mirror (in the form
# `ftp://ftp.debian.org/debian/'), or enter any regular expression
# for searching through the list of mirrors: Try a two-letter
# country code such as `de', or a country name like `United
# States', or a server name like `sunsite'.
# Debian mirror [http://deb.debian.org/debian/]: http://ftp.be.debian.org/debian/
# 
# -----------------------------------------------------------------
# The jigdo file also refers to the Non-US section of the Debian
# archive. Please repeat the mirror selection for Non-US. Do not
# simply copy the URL you entered above; this does not work because
# the path on the servers differs!
# Debian non-US mirror: http://archive.debian.org/debian-non-US/
Jigdo files
List files
  • It is not recommended to download all DVD, but only the first few (say three). Packages are sorted by popularity, so the first DVDs will contain the most popular packages.
  • To find out in which DVD some package is located, use the list files.
  • Get the list files (*.list.gz) from the mirror:
Write images to USB
  • Simple as using cp [3]:
sudo cp image.iso /dev/sdx             # /dev/sda, /dev/sdb... - DOUBLE CHECK DESTINATION!
pv image.iso > /dev/sdx                # As root, to get progress
Live images

Install Testing

See https://wiki.debian.org/DebianTesting.

Apt

See Apt for more information on package management system.

sources.list

Example /etc/apt/sources.list file for Debian 8, aka. Jessie:

# Stable
deb http://ftp.debian.org/debian/ jessie main contrib
deb-src http://ftp.debian.org/debian/ jessie main contrib
deb http://security.debian.org/ jessie/updates main contrib
deb-src http://security.debian.org/ jessie/updates main contrib

# Testing
deb http://ftp.debian.org/debian/ testing main contrib
deb-src http://ftp.debian.org/debian/ testing main contrib
deb http://security.debian.org/ testing/updates main contrib
deb-src http://security.debian.org/ testing/updates main contrib

# Unstable / Sid
# deb http://ftp.debian.org/debian/ sid main contrib
# deb-src http://ftp.debian.org/debian/ sid main contrib

# Backport
deb http://ftp.debian.org/debian jessie-backports main contrib
deb-src http://ftp.debian.org/debian jessie-backports main contrib

# jessie-updates, previously known as 'volatile'
# A network mirror was not selected during install.  The following entries
# are provided as examples, but you should amend them as appropriate
# for your mirror of choice.
#
# deb http://ftp.debian.org/debian/ jessie-updates main contrib
# deb-src http://ftp.debian.org/debian/ jessie-updates main contrib

Using CD-ROM, with multiarch:

# CDROM
deb [arch=i386] cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official i386 DVD Binary-3 20170116-10:09]/ jessie contrib main''
deb [arch=i386] cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official i386 DVD Binary-2 20170116-10:09]/ jessie contrib main
deb [arch=i386] cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official i386 DVD Binary-1 20170116-10:09]/ jessie contrib main
deb [arch=amd64] cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official amd64 DVD Binary-1 20170116-11:01]/ jessie contrib main
deb [arch=amd64] cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official amd64 DVD Binary-2 20170116-11:01]/ jessie contrib main
deb [arch=amd64] cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official amd64 DVD Binary-3 20170116-11:01]/ jessie contrib main

Note that when using apt-cdrom add, apt does not add the arch field [arch=i386] or [arch=amd64].

preferences

Example /etc/apt/preferences:

Package: *
Pin: release a=stable
Pin-Priority: 500

Package: *
Pin: release a=jessie-backports
Pin-Priority: 475

Package: *
Pin: release a=testing
Pin-Priority: 450

Package: *
Pin: release a=unstable
Pin-Priority: 400

Multi-arch support

To add support for i386 architecture:

dpkg --add-architecture i386

For CD-ROM repository, we must add the arch field manually. For instance:

deb [arch=amd64] cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official amd64 DVD Binary-1 20170116-11:01]/ jessie contrib main

Archives

These repositories contain old versions of Debian packages:

A wayback machine that contains snapshot of Debian archive repositories, accessible by date or version number.

How-To

Install PHP5.6 CLI on Debian Stretch

libonig2_5.9.5-3.2_amd64.deb
php5-cli_5.6.30+dfsg-0+deb8u1_amd64.deb
php5-common_5.6.30+dfsg-0+deb8u1_amd64.deb
php5-json_1.3.6-1_amd64.deb
  • PHP5 binary is at /usr/bin/php5.
Alternatives

NTFS

The package ntfs-3g is not installed by default, and if so, the link /sbin/mount.ntfs/sbin/mount.ntfs-3g is missing.

Troubleshoot

Apt-offline - ERROR: Failed to sync file

Occurs with apt-offline=1.7.2. Solution is to install python-lzma on the OFFLINE system. [4].