当前位置:   article > 正文

使用iso镜像设置Ubuntu系统本地apt源_ubuntu用ios文件制作本地源

ubuntu用ios文件制作本地源

使用iso镜像设置Ubuntu系统本地apt源 以下步骤 亲测无坑

1 下载Ubuntu镜像

下载对应系统版本的Ubuntu镜像

下载镜像

root@cloudwise:/home/cloudwise# wget https://mirror.bjtu.edu.cn/ubuntu-releases/16.04.7/ubuntu-16.04.7-server-amd64.iso
  • 1

64位系统 下载 -ubuntu-16.04.7-server-amd64.iso 32位系统 下载ubuntu-16.04.6-server-i386.iso

镜像的版本可以和系统不一致 只是用镜像里的包而已 写文档验证的这个机器 版本号如下

root@cloudwise:/home/cloudwise# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.3 LTS
Release:	18.04
Codename:	bionic
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

提供一个下载Ubuntu系统的地址 北京交通大学的

https://mirror.bjtu.edu.cn/ubuntu-releases/

2 挂载镜像

创建目录 挂载光盘

root@cloudwise:/home/cloudwise# mkdir /mount
root@cloudwise:/home/cloudwise# ls
ubuntu-18.04-desktop-amd64.iso
root@cloudwise:/home/cloudwise# chmod -R 777 /mount
root@cloudwise:/home/cloudwise# mount -t iso9660 -o loop ubuntu-16.04.7-server-amd64.iso /mount
mount: /mount: WARNING: device write-protected, mounted read-only.
root@cloudwise:/home/cloudwise# ls /mount
boot  dists  doc  EFI  install  isolinux  md5sum.txt  pics  pool  preseed  README.diskdefines  ubuntu
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

查看光盘内软件包个数

root@cloudwise:/home/cloudwise# find /mount -type f -name "*.deb" | wc -l
1263
  • 1
  • 2

3 设置apt源

备份sources.list文件

root@cloudwise:/home/cloudwise# cp /etc/apt/sources.list{,.20210107}
root@cloudwise:/home/cloudwise# ls /etc/apt/sources.list*
/etc/apt/sources.list
/etc/apt/sources.list.20210107
  • 1
  • 2
  • 3
  • 4

写入内容

root@cloudwise:/home/cloudwise# echo 'deb file:///mount/ stable main' > sources.list
  • 1

上边写的内容是写stable还是别的 要看挂载点里具体的目录 参考如下

root@cloudwise:/home/cloudwise# ls /mount/dists/
stable  unstable  xenial
root@cloudwise:/home/cloudwise# ls /mount/dists/stable/
main  Release  Release.gpg  restricted
  • 1
  • 2
  • 3
  • 4

4 更新apt源

root@cloudwise:/home/cloudwise# apt-get update
Get:1 file:/mount stable InRelease
Ign:1 file:/mount stable InRelease
Get:2 file:/mount stable Release [3,235 B]
Get:2 file:/mount stable Release [3,235 B]
Reading package lists... Done
W: Conflicting distribution: file:/mount stable Release (expected stable but got xenial)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

5 验证可用性

安装nmap 测试apt源的可用性

root@cloudwise:/home/cloudwise# apt-get -y install nmap
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libsigsegv2 pastebinit python3-newt run-one
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libblas-common libblas3 liblinear3 liblua5.2-0 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libreadline6 lua-lpeg ndiff python
  python-bs4 python-chardet python-html5lib python-lxml python-minimal python-pkg-resources python-six python2.7 python2.7-minimal
Suggested packages:
  liblinear-tools liblinear-dev python-doc python-tk python-genshi python-lxml-dbg python-lxml-doc python-setuptools python2.7-doc
  binfmt-support
The following NEW packages will be installed:
  libblas-common libblas3 liblinear3 liblua5.2-0 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libreadline6 lua-lpeg ndiff nmap
  python python-bs4 python-chardet python-html5lib python-lxml python-minimal python-pkg-resources python-six python2.7 python2.7-minimal
0 upgraded, 21 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/10.2 MB of archives.
After this operation, 44.6 MB of additional disk space will be used.
Get:1 file:/mount stable/main amd64 libpython2.7-minimal amd64 2.7.12-1ubuntu0~16.04.12 [338 kB]
Get:2 file:/mount stable/main amd64 python2.7-minimal amd64 2.7.12-1ubuntu0~16.04.12 [1,258 kB]
Get:3 file:/mount stable/main amd64 python-minimal amd64 2.7.12-1~16.04 [28.1 kB]
Get:4 file:/mount stable/main amd64 libreadline6 amd64 6.3-8ubuntu2 [117 kB]
Get:5 file:/mount stable/main amd64 libpython2.7-stdlib amd64 2.7.12-1ubuntu0~16.04.12 [1,883 kB]
Get:6 file:/mount stable/main amd64 python2.7 amd64 2.7.12-1ubuntu0~16.04.12 [224 kB]
Get:7 file:/mount stable/main amd64 libpython-stdlib amd64 2.7.12-1~16.04 [7,768 B]
Get:8 file:/mount stable/main amd64 python amd64 2.7.12-1~16.04 [137 kB]
Get:9 file:/mount stable/main amd64 libblas-common amd64 3.6.0-2ubuntu2 [5,342 B]
Get:10 file:/mount stable/main amd64 libblas3 amd64 3.6.0-2ubuntu2 [147 kB]
Get:11 file:/mount stable/main amd64 liblinear3 amd64 2.1.0+dfsg-1 [39.3 kB]
Get:12 file:/mount stable/main amd64 liblua5.2-0 amd64 5.2.4-1ubuntu1 [106 kB]
Get:13 file:/mount stable/main amd64 lua-lpeg amd64 0.12.2-1ubuntu1 [28.6 kB]
Get:14 file:/mount stable/main amd64 python-bs4 all 4.4.1-1 [64.2 kB]
Get:15 file:/mount stable/main amd64 python-pkg-resources all 20.7.0-1 [108 kB]
Get:16 file:/mount stable/main amd64 python-chardet all 2.3.0-2 [96.3 kB]
Get:17 file:/mount stable/main amd64 python-six all 1.10.0-3 [10.9 kB]
Get:18 file:/mount stable/main amd64 python-html5lib all 0.999-4 [83.1 kB]
Get:19 file:/mount stable/main amd64 python-lxml amd64 3.5.0-1ubuntu0.1 [818 kB]
Get:20 file:/mount stable/main amd64 ndiff all 7.01-2ubuntu2 [20.1 kB]
Get:21 file:/mount stable/main amd64 nmap amd64 7.01-2ubuntu2 [4,638 kB]
Selecting previously unselected package libpython2.7-minimal:amd64.
(Reading database ... 102729 files and directories currently installed.)
Preparing to unpack .../0-libpython2.7-minimal_2.7.12-1ubuntu0~16.04.12_amd64.deb ...
Unpacking libpython2.7-minimal:amd64 (2.7.12-1ubuntu0~16.04.12) ...
Selecting previously unselected package python2.7-minimal.
Preparing to unpack .../1-python2.7-minimal_2.7.12-1ubuntu0~16.04.12_amd64.deb ...
Unpacking python2.7-minimal (2.7.12-1ubuntu0~16.04.12) ...
Selecting previously unselected package python-minimal.
Preparing to unpack .../2-python-minimal_2.7.12-1~16.04_amd64.deb ...
Unpacking python-minimal (2.7.12-1~16.04) ...
Selecting previously unselected package libreadline6:amd64.
Preparing to unpack .../3-libreadline6_6.3-8ubuntu2_amd64.deb ...
Unpacking libreadline6:amd64 (6.3-8ubuntu2) ...
Selecting previously unselected package libpython2.7-stdlib:amd64.
Preparing to unpack .../4-libpython2.7-stdlib_2.7.12-1ubuntu0~16.04.12_amd64.deb ...
Unpacking libpython2.7-stdlib:amd64 (2.7.12-1ubuntu0~16.04.12) ...
Selecting previously unselected package python2.7.
Preparing to unpack .../5-python2.7_2.7.12-1ubuntu0~16.04.12_amd64.deb ...
Unpacking python2.7 (2.7.12-1ubuntu0~16.04.12) ...
Selecting previously unselected package libpython-stdlib:amd64.
Preparing to unpack .../6-libpython-stdlib_2.7.12-1~16.04_amd64.deb ...
Unpacking libpython-stdlib:amd64 (2.7.12-1~16.04) ...
Setting up libpython2.7-minimal:amd64 (2.7.12-1ubuntu0~16.04.12) ...
Setting up python2.7-minimal (2.7.12-1ubuntu0~16.04.12) ...
Linking and byte-compiling packages for runtime python2.7...
Setting up python-minimal (2.7.12-1~16.04) ...
Selecting previously unselected package python.
(Reading database ... 103487 files and directories currently installed.)
Preparing to unpack .../00-python_2.7.12-1~16.04_amd64.deb ...
Unpacking python (2.7.12-1~16.04) ...
Selecting previously unselected package libblas-common.
Preparing to unpack .../01-libblas-common_3.6.0-2ubuntu2_amd64.deb ...
Unpacking libblas-common (3.6.0-2ubuntu2) ...
Selecting previously unselected package libblas3.
Preparing to unpack .../02-libblas3_3.6.0-2ubuntu2_amd64.deb ...
Unpacking libblas3 (3.6.0-2ubuntu2) ...
Selecting previously unselected package liblinear3:amd64.
Preparing to unpack .../03-liblinear3_2.1.0+dfsg-1_amd64.deb ...
Unpacking liblinear3:amd64 (2.1.0+dfsg-1) ...
Selecting previously unselected package liblua5.2-0:amd64.
Preparing to unpack .../04-liblua5.2-0_5.2.4-1ubuntu1_amd64.deb ...
Unpacking liblua5.2-0:amd64 (5.2.4-1ubuntu1) ...
Selecting previously unselected package lua-lpeg:amd64.
Preparing to unpack .../05-lua-lpeg_0.12.2-1ubuntu1_amd64.deb ...
Unpacking lua-lpeg:amd64 (0.12.2-1ubuntu1) ...
Selecting previously unselected package python-bs4.
Preparing to unpack .../06-python-bs4_4.4.1-1_all.deb ...
Unpacking python-bs4 (4.4.1-1) ...
Selecting previously unselected package python-pkg-resources.
Preparing to unpack .../07-python-pkg-resources_20.7.0-1_all.deb ...
Unpacking python-pkg-resources (20.7.0-1) ...
Selecting previously unselected package python-chardet.
Preparing to unpack .../08-python-chardet_2.3.0-2_all.deb ...
Unpacking python-chardet (2.3.0-2) ...
Selecting previously unselected package python-six.
Preparing to unpack .../09-python-six_1.10.0-3_all.deb ...
Unpacking python-six (1.10.0-3) ...
Selecting previously unselected package python-html5lib.
Preparing to unpack .../10-python-html5lib_0.999-4_all.deb ...
Unpacking python-html5lib (0.999-4) ...
Selecting previously unselected package python-lxml.
Preparing to unpack .../11-python-lxml_3.5.0-1ubuntu0.1_amd64.deb ...
Unpacking python-lxml (3.5.0-1ubuntu0.1) ...
Selecting previously unselected package ndiff.
Preparing to unpack .../12-ndiff_7.01-2ubuntu2_all.deb ...
Unpacking ndiff (7.01-2ubuntu2) ...
Selecting previously unselected package nmap.
Preparing to unpack .../13-nmap_7.01-2ubuntu2_amd64.deb ...
Unpacking nmap (7.01-2ubuntu2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Setting up libblas-common (3.6.0-2ubuntu2) ...
Setting up libblas3 (3.6.0-2ubuntu2) ...
update-alternatives: using /usr/lib/libblas/libblas.so.3 to provide /usr/lib/libblas.so.3 (libblas.so.3) in auto mode
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up liblua5.2-0:amd64 (5.2.4-1ubuntu1) ...
Setting up liblinear3:amd64 (2.1.0+dfsg-1) ...
Setting up lua-lpeg:amd64 (0.12.2-1ubuntu1) ...
Setting up libreadline6:amd64 (6.3-8ubuntu2) ...
Setting up nmap (7.01-2ubuntu2) ...
Setting up libpython2.7-stdlib:amd64 (2.7.12-1ubuntu0~16.04.12) ...
Setting up python2.7 (2.7.12-1ubuntu0~16.04.12) ...
Setting up libpython-stdlib:amd64 (2.7.12-1~16.04) ...
Setting up python (2.7.12-1~16.04) ...
Setting up python-pkg-resources (20.7.0-1) ...
Setting up python-six (1.10.0-3) ...
Setting up python-bs4 (4.4.1-1) ...
Setting up python-lxml (3.5.0-1ubuntu0.1) ...
Setting up python-html5lib (0.999-4) ...
Setting up python-chardet (2.3.0-2) ...
Setting up ndiff (7.01-2ubuntu2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
root@cloudwise:/home/cloudwise#
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/255967
推荐阅读
相关标签
  

闽ICP备14008679号