“How to use an ISO file as offline repository in Debian”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
 
第1行: 第1行:
 
*
 
*
  
**  Create the folders (mountpoint) to mount the ISO files
+
==**  Create the folders (mountpoint) to mount the ISO files==
 
<pre>sudo mkdir -p /media/repo_1
 
<pre>sudo mkdir -p /media/repo_1
 
sudo mkdir -p /media/repo_2
 
sudo mkdir -p /media/repo_2
 
sudo mkdir -p /media/repo_3 </pre>
 
sudo mkdir -p /media/repo_3 </pre>
** Debian ISO image downloaded at the location /root  
+
==** Debian ISO image downloaded at the location /root ==
 
<pre>cd /root &&  wget  -c  https://mirrors.163.com/debian-cd/10.5.0/amd64/iso-dvd/debian-10.5.0-amd64-DVD-1.iso
 
<pre>cd /root &&  wget  -c  https://mirrors.163.com/debian-cd/10.5.0/amd64/iso-dvd/debian-10.5.0-amd64-DVD-1.iso
  
第11行: 第11行:
  
 
wget  -c  https://mirrors.163.com/debian-cd/10.5.0/amd64/iso-dvd/debian-10.5.0-amd64-DVD-3.iso</pre>
 
wget  -c  https://mirrors.163.com/debian-cd/10.5.0/amd64/iso-dvd/debian-10.5.0-amd64-DVD-3.iso</pre>
** mount the ISO files
+
==** mount the ISO files==
*** temp  
+
===*** temp ===
 
<pre>
 
<pre>
 
sudo p mount  -o loop  /root/debian-10.5.0-amd64-DVD-1.iso  /media/repo_1/
 
sudo p mount  -o loop  /root/debian-10.5.0-amd64-DVD-1.iso  /media/repo_1/
第18行: 第18行:
 
sudo p mount  -o loop  /root/debian-10.5.0-amd64-DVD-1.iso  /media/repo_3/</pre>
 
sudo p mount  -o loop  /root/debian-10.5.0-amd64-DVD-1.iso  /media/repo_3/</pre>
  
*** forever  
+
===*** forever ===
 
<pre>
 
<pre>
 
sudo vi /etc/fstab
 
sudo vi /etc/fstab
第27行: 第27行:
 
</pre>
 
</pre>
  
** edit the /etc/apt/sources.list file to add the repository
+
==** edit the /etc/apt/sources.list file to add the repository==
 
<pre>deb [trusted=yes]  file:///media/repo_1/  buster  main contrib
 
<pre>deb [trusted=yes]  file:///media/repo_1/  buster  main contrib
 
deb [trusted=yes]  file:///media/repo_2/  buster  main contrib
 
deb [trusted=yes]  file:///media/repo_2/  buster  main contrib
第33行: 第33行:
  
  
* 快速查看每个 iso的软件
+
=* 快速查看每个 iso的软件=
  
 
  ls /media/repo_1/pool/main/
 
  ls /media/repo_1/pool/main/
 
  eg  ls /media/repo_1/pool/main/z/  得知有 zip    apt install zip
 
  eg  ls /media/repo_1/pool/main/z/  得知有 zip    apt install zip
  
*  see also
+
=*  see also=
 
[https://www.pcsuggest.com/how-to-use-an-iso-file-as-offline-repository-in-debian/ How to use an ISO file as offline repository in Debian]
 
[https://www.pcsuggest.com/how-to-use-an-iso-file-as-offline-repository-in-debian/ How to use an ISO file as offline repository in Debian]
  
 +
https://linuxconfig.org/add-iso-image-to-apt-sourceslist
  
* trouble  
+
 
 +
[https://www.cnblogs.com/goodhx/p/6737639.html Debian & CentOS建立本地iso源]
 +
 
 +
=* trouble =
  
 
<pre>
 
<pre>

2020年9月10日 (四) 03:19的最新版本

** Create the folders (mountpoint) to mount the ISO files

sudo mkdir -p /media/repo_1
sudo mkdir -p /media/repo_2
sudo mkdir -p /media/repo_3 

** Debian ISO image downloaded at the location /root

cd /root &&  wget  -c  https://mirrors.163.com/debian-cd/10.5.0/amd64/iso-dvd/debian-10.5.0-amd64-DVD-1.iso

wget  -c  https://mirrors.163.com/debian-cd/10.5.0/amd64/iso-dvd/debian-10.5.0-amd64-DVD-2.iso

wget  -c  https://mirrors.163.com/debian-cd/10.5.0/amd64/iso-dvd/debian-10.5.0-amd64-DVD-3.iso

** mount the ISO files

*** temp

sudo p mount  -o loop  /root/debian-10.5.0-amd64-DVD-1.iso  /media/repo_1/
sudo p mount  -o loop  /root/debian-10.5.0-amd64-DVD-1.iso  /media/repo_2/
sudo p mount  -o loop  /root/debian-10.5.0-amd64-DVD-1.iso  /media/repo_3/

*** forever

sudo vi /etc/fstab

/root/debian-10.5.0-amd64-DVD-1.iso  /media/repo_1/  iso9660 defaults,loop,  0 0
/root/debian-10.5.0-amd64-DVD-1.iso  /media/repo_2/  iso9660 defaults,loop,  0 0
/root/debian-10.5.0-amd64-DVD-1.iso  /media/repo_3/  iso9660 defaults,loop, 0 0

** edit the /etc/apt/sources.list file to add the repository

deb [trusted=yes]  file:///media/repo_1/  buster  main contrib
deb [trusted=yes]  file:///media/repo_2/  buster  main contrib
deb [trusted=yes]  file:///media/repo_3/  buster  main contrib 


* 快速查看每个 iso的软件

ls /media/repo_1/pool/main/
eg  ls /media/repo_1/pool/main/z/  得知有 zip    apt install zip

* see also

How to use an ISO file as offline repository in Debian

https://linuxconfig.org/add-iso-image-to-apt-sourceslist


Debian & CentOS建立本地iso源

* trouble


Reading package lists... Done
E: The repository 'file:/media/repo_1 buster Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
root@cailuw-test:~#

You should tell apt it's a trusted source:

deb [trusted=yes] file:///media/repo_1/  buster  main contrib