LinuxCommandLibrary

apt-cdrom

Add a CD-ROM as an APT source

SYNOPSIS

apt-cdrom [options] [add|ident]

PARAMETERS

-d, --cdrom path
    Set alternative CD-ROM mount point (default: /cdrom or /media/cdrom)

-m, --mount
    Mount CD-ROM if not already mounted

-n, --rename label
    Use custom label for the source entry

-r, --recurse
    Recursively scan for index files (multi-CD support)

-i, --identify-only
    Identify disc contents without adding source (ident subcommand)

-h, --help
    Display usage summary

DESCRIPTION

apt-cdrom is a utility for Debian-based Linux systems to add optical media like CD-ROMs or DVDs as package repositories to APT. It scans the disc for Debian package indices, identifies the release (e.g., Bullseye), architecture, and disc number/label, then appends a deb cdrom: entry to /etc/apt/sources.list.d/ or sources.list. This enables apt-get, apt, or synaptic to install/update packages from the media without internet.

Common for offline installations from official Debian CDs/DVDs, it handles multi-disc sets via recursion. The command auto-mounts if specified, renames sources for clarity, or just identifies contents. Run as root or with sudo; user must be in cdrom group for device access. Output example: Using CD-ROM mount point /media/cdrom/ followed by source addition confirmation.

Though functional, it's legacy; modern setups prefer mounting ISOs with apt or network mirrors.

CAVEATS

Requires root privileges; user in cdrom group for device access. Fails on non-Debian discs or unreadable media. Deprecated for USB/ISO mounts; may conflict with auto-mounters like udisks.

EXAMPLE USAGE

sudo apt-cdrom add - adds default CD-ROM source.
sudo apt-cdrom -d /media/mydisc -i - identifies without adding.
sudo apt-cdrom -m -r add - mounts, recurses, adds.

HISTORY

Introduced in APT 0.3 (1998) for dselect/apt-get integration during Debian's shift from floppy-based installs. Maintained through APT 2.x in Debian 12 (2023), but usage declined with broadband ubiquity.

SEE ALSO

apt(8), apt-get(8), dpkg(1), sources.list(5), mount(8)

Copied to clipboard