Linux cd rom repository

How to Setup Local Yum Repository from CD-ROM/DVD-ROM image on CentOS 6.2

In this guide, we will delve into the process of updating and installing RPM packages from a CD-ROM/DVD-ROM image on CentOS 6.2. This method proves to be particularly beneficial when dealing with a slow internet connection. By utilizing your local CD/DVD-ROM as a yum repository, you can bypass the need for an internet connection entirely.

We will explore two distinct methods to install and configure a local CentOS 6.2 yum repository. Both methods have been tested and confirmed to work on a CentOS 6.2 Linux server.

You can choose the method that best suits your preferences.

Method 1: Using DVD/ISO

Insert the DVD/ISO into the DVD-Drive.
Mount the ISO from the DVD-ROM into the /mnt directory using the following command:

You should see a message indicating that the block device is write-protected and is mounting as read-only.

Create a text file named centos62.repo in the /etc/yum.repos.d/ directory with the following content:

vi /etc/yum.repos.d/centos62.repo [CentOS6.2-Repository] name=DVD-CentOS6.2 repository baseurl=file:///mnt enabled=1 gpgcheck=0

You can now start installing, removing, and updating using the yum command. For example, to install httpd, you would use:

Method 2: Using Existing Partition

Check the existing partition on your CentOS 6.2 server using the df command:

Create a directory named localrepo in the /mnt directory:

Create directories named 1, 2, and 3 in the /mnt/localrepo directory:

Mount the ISO from the DVD-ROM into the /mnt/localrepo/1 directory:

mount -o loop /dev/cdrom /mnt/localrepo/1 df -lh

Create a Temporary repo folder under /tmp to store the required rpm’s packages for the createrepo installation:

Copy the required packagesto install create repo:

cp /mnt/localrepo/1/Packages/createrepo* /tmp/repo cp /mnt/localrepo/1/Packages/deltarpm* /tmp/repo cp /mnt/localrepo/1/Packages/libxml2-python* /tmp/repo cp /mnt/localrepo/1/Packages/python-deltarpm* /tmp/repo

You can verify the copied packages with the ls command:

Install the rpm packages using the following command:

Navigate to the /mnt/localrepo directory:

Run the createrepo command:

Create a repo config file in the /etc/yum.repos.d/ directory:

vi /etc/yum.repos.d/local.repo [CentOS6.2-Repository] name=CentOS6.2 repository baseurl=file:///mnt/localrepo enabled=1 gpgcheck=0

Commands Mentioned

  • mount – This command is used to mount a filesystem or storage device.
  • vi – A text editor command used to create or edit files.
  • yum – The package management tool for installing, updating, and removing packages in CentOS.
  • mkdir – This command is used to create directories.
  • cp – The copy command used to copy files from one location to another.
  • rpm – The RPM Package Manager tool for installing, uninstalling, and managing software packages in CentOS.
  • createrepo – This command is used to create a repository of RPM packages.
  • df – The disk filesystem command used to display disk space usage.
  • ls – The list command used to list files and directories.
Читайте также:  Linux show locked files

Conclusion

In this tutorial, we have explored two methods to set up a local yum repository from a CD-ROM/DVD-ROM image on CentOS 6.2. This process is particularly beneficial when dealing with a slow internet connection, as it allows you to bypass the need for an internet connection entirely. Both methods have been tested and confirmed to work on a CentOS 6.2 Linux server, and may also be applicable to other versions of CentOS server.

Remember, understanding the different types of web servers and hosting services is crucial to making the best decisions for your specific needs.

Whether you’re using Apache, Nginx, or LiteSpeed on a dedicated server, VPS server, cloud hosting, or shared hosting, these methods can help you manage your software packages more efficiently.

We hope this guide has been informative and helpful in setting up your local yum repository.

FAQ

  1. What is the purpose of the yum command? The yum command is a package management tool used in CentOS and other RPM-based Linux distributions. It is used to install, update, and remove software packages.
  2. What does the mount command do? The mount command is used to mount a filesystem or storage device to a specific directory, making it accessible to the system.
  3. What is the purpose of the createrepo command? The createrepo command is used to create a repository of RPM packages. This repository can then be used by package managers like yum for installing software.
  4. What does the df command do? The df command, short for disk filesystem, is used to display the amount of disk space used and available on the filesystems in your system.
  5. What is the function of the cp command? The cp command, short for copy, is used to copy files and directories from one location to another on a Linux system.

Dimitri Nek

Dimitri is a Linux-wielding geek from Newport Beach and a server optimization guru with over 20 years of experience taming web hosting beasts. Equipped with an arsenal of programming languages and an insatiable thirst for knowledge, Dimitri conquers website challenges and scales hosting mountains with unmatched expertise. His vast knowledge of industry-leading hosting providers allows him to make well-informed recommendations tailored to each client’s unique needs.

Источник

Как добавить блочное устройство cdrom в список источников Debian apt

Для установки пакетов с Live или установочного диска в репозиториях в качестве источника пакетов нужно прописать CD диск.

Читайте также:  Gtx 560 ti linux driver

Вот небольшой совет по добавлению официального компакт-диска Debian в файл /etc/apt/sources.list, чтобы уменьшить потребность в загрузке пакетов. Убедитесь, что ваш компакт-диск вставлен в дисковод для компакт-дисков, и введите команду:

Если, например, вы добавляете образ Wheezy, будет сгенерирован следующий результат:

Использование /media/cdrom/ в качестве точки монтирования CD-ROM Идентификация… [7385c987a0f703941cb384c339b8ca1e-2] Поиск индексных файлов на диске… Найдено 1 индексов двоичных пакетов, 0 индексов пакетов с исходным кодом, 1 индексов переводов и 0 подписей Этот диск найден: 'Debian GNU/Linux 7.5.0 _Wheezy_ - Official amd64 CD Binary-1 20140426-13:37' Чтение индексов двоичных пакетов. Сделано Чтение индексов переводов. Сделано Запись нового списка источников Запись списка источников для этого диска: deb cdrom:[Debian GNU/Linux 7.5.0 _Wheezy_ - Official amd64 CD Binary-1 20140426-13:37]/ wheezy main

И будет добавлена следующая строка:

deb cdrom:[Debian GNU/Linux 7.5.0 _Wheezy_ - Official amd64 CD Binary-1 20140426-13:37]/ wheezy main

в ваш файл /etc/apt/sources.list.

Обратите внимание, что дистрибутив, его архитектура и версия для используемого диска и установленной операционной системы должны совпадать, иначе может возникнуть ошибка:

Использование /media/cdrom/ в качестве точки монтирования CD-ROM Идентификация… [7385c987a0f703941cb384c339b8ca1e-2] Поиск индексных файлов на диске… Найдено 0 индексов двоичных пакетов, 0 индексов пакетов с исходным кодом, 0 индексов переводов и 0 подписей Использование /media/cdrom/ в качестве точки монтирования CD-ROM Размонтирование CD-ROM… Ожидание диска… Вставьте диск в устройство и нажмите [Enter] Монтирование CD-ROM… Идентификация… [7385c987a0f703941cb384c339b8ca1e-2] Поиск индексных файлов на диске… Найдено 0 индексов двоичных пакетов, 0 индексов пакетов с исходным кодом, 0 индексов переводов и 0 подписей E: Не удалось найти ни одного файла пакетов; возможно, это не диск Debian или не с той архитектурой? E: Не удалось найти ни одного файла пакетов; возможно, это не диск Debian или не с той архитектурой? E: Не удалось автоматически обнаружить CD-ROM, и в точке монтирования по умолчанию также ничего нет. Вы можете использовать параметр --cdrom, чтобы указать точку монтирования CD-ROM. Подробнее о точке монтирования и автоматическом обнаружении CD-ROM смотрите в «man apt-cdrom».

Если название дистрибутива совпадает, но различаются версии, то использования пакета с такого диска может привести к неработоспособности операционной системы Linux.

Связанные статьи:

Источник

Как создать yum репозиторий из CD-ROM диска в RedHat/CentOS/Fedora

Как создать yum репозиторий из CD-ROM диска в RedHat/CentOS/Fedora

Хочу рассказать в этой теме «Как создать yum репозиторий из CD-ROM диска в RedHat/CentOS/Fedora» как я сделал репозиторий с подключенного в CD-ROM диска с дистрибутивом CentOS. Очень удобно его использовать если нет под рукой интернета или просто хорошо его использовать.

1. Нужно вставить в CD-ROM диск ( я использую VM-Ware, по этому я только его подключу) с репозиторием.

2. Теперь его нужно примонтировать в нужную вам директорию, а это делается следующим образом:

Выставлю на всякий случай ему права ( разрешить все):

Читайте также:  Adb install for linux

Собственно, подключаем CD-ROM:

# mount /dev/cdrom /media/cdrom

3. Создадим репозиторий для cdrom:

# vim /etc/yum.repos.d/cdrom.repo
[MY-CDrom-Repository] name=MY-CDrom-Repository baseurl=file:///media/cdrom enabled=1 gpgcheck=0

Мы создали репозиторий, можно сейчас и проверить его для этого выполните какую либо команду для установки чего либо ( например текстового редактора vim), для этого выполните:

Кстати, что качается моего подключенного CD-ROM в VM Ware, то у меня нечего не получилось сделать, монтирует папку только с 2 файлами, по этому нужно это делать с реальной машиной и CD-ROM, с ней все работает отлично!

Источник

AptCdrom

You can use the Ubuntu Live Cd to install packages (i.e. to an older offline Ubuntu computer).

Source.list

If you have a new Live CD and the Live CD in the Source.list file, comment all the repositories excepting the CD and

sudo apt-get update sudo apt-get dist-upgrade

After upgrade, uncomment all the other repositories in the source.list file.

Some computers can ask to use apt-cdrom. If so, follow the instructions that appears bellow.

Apt-cdrom

apt-cdrom can add a new CDROM to APTs sources.list file (list of available repositories). It is necessary to use apt-cdrom to add CDs to the APT system, it cannot be done by hand.

  • test: sudo apt-cdrom --no-act add
  • if everything is OK: sudo apt-cdrom add
  • sudo apt-cdrom ident
  • sudo apt-cdrom -d "your-cdrom-mount-point" -r

Description and options

  • add is used to add a new disc to the source list. It will unmount the CDROM device, prompt for a disk to be inserted and then procceed to scan it and copy the index files. If the disc does not have a proper .disk/ directory you will be prompted for a descriptive title. APT uses a CDROM ID to track which disc is currently in the drive and maintains a database of these IDs in /var/lib/apt/cdroms.list
  • ident is a debugging tool to report the identity of the current disc as well as the stored file name.
  • -d or —cdrom : MountPoint (specify the location to mount the cdrom). This mount point must be listed in /etc/fstab and properly configured.
  • -r or —rename : rename a disc; change the label of a disk or override the disks given label. This option will cause apt-cdrom to prompt for a new label.
  • -n, —just-print, —recon or —no-act: no Changes; Do not change the sources.list file and do not write index files. Everything is still checked however.

Test

After dist-upgrade you can test that everything is OK

sudo apt-get -f install sudo dpkg --configure -a

See also

AptCdrom (последним исправлял пользователь ckimes 2017-08-31 20:59:03)

The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details

Источник

Оцените статью
Adblock
detector