操作

获取需要的deb包

#执行安装后,安装的包会保存在/var/cache/apt/archives 目录下
apt-get install vim #查看
正在处理用于 man-db (2.8.7-3) 的触发器 ...
root@lenovo:/var/cache/apt/archives# ll
总用量 6740
drwxr-xr-x 3 root root 12288 12月 23 10:44 ./
drwxr-xr-x 3 root root 4096 12月 23 10:44 ../
-rw-r----- 1 root root 0 10月 17 20:34 lock
drwx------ 2 _apt root 4096 12月 23 10:44 partial/
-rw-r--r-- 1 root root 1208868 9月 5 20:28 vim_2%3a8.1.0875-5ubuntu2_amd64.deb
-rw-r--r-- 1 root root 5668708 9月 5 20:28 vim-runtime_2%3a8.1.0875-5ubuntu2_all.deb

下载的软件复制到其他目录

cp -r /var/cache/apt/archives  /AAA
chmod 777 -R /AAA/

建立依赖关系

进入该目录:操作

dpkg-scanpackages   .  | gzip  -9c  > Packages.gz

#如果没有dpkg-scanpackages 需要下载工具
apt-get install dpkg-dev ##打包备用
tar cvzf AAA.tar.gz /AAA/

使用

复制软件包到某一目录下,解压

备份原来的安装源

cp /etc/apt/sources.list /etc/apt/sources.list.bak
echo > /etc/apt/sources.list

添加本地源

vi /etc/apt/sources.list
#插入下列语句:位置, 包的位置
#包的位置 /home/xxx/Desktop/nvidia/pakages 里面也有Packages.gz deb [trusted=yes] file:/home/xxx/Desktop/nvidia/pakages/ ./

更新源

apt-get update

离线安装

apt-get  install  AAA

下载离线包

找到依赖的包用apt-cache depends packname来获取

单独下载某一个包

sudo apt-get install --reinstall -d containerd.io

# aptitude clean
# aptitude --download-only install <your_package_here>
# cp /var/cache/apt/archives/*.deb <your_directory_here>

sudo apt-get install docker-ce

sudo apt-get install nvidia-docker2

安装docker和nvidia-docker 需要的包


-rw-r--r-- 1 xxxx xxxx 103764 1月 11 2018 aufs-tools_1%3a4.9+20170918-1ubuntu1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 6320 4月 30 2017 cgroupfs-mount_1.4_all.deb
-rw-r--r-- 1 xxxx xxxx 20027634 10月 19 09:07 containerd.io_1.2.10-3_amd64.deb
-rw-r--r-- 1 xxxx xxxx 22837582 11月 15 02:24 docker-ce_5%3a19.03.5~3-0~ubuntu-bionic_amd64.deb
-rw-r--r-- 1 xxxx xxxx 42473666 11月 15 02:24 docker-ce-cli_5%3a19.03.5~3-0~ubuntu-bionic_amd64.deb
-rw-rw-r-- 1 xxxx xxxx 607336 12月 28 17:48 dpkg-dev_1.19.0.5ubuntu2_all.deb
-rw-r--r-- 1 xxxx xxxx 5184 12月 24 18:39 gcc_4%3a7.4.0-1ubuntu2.3_amd64.deb
-rw-r--r-- 1 xxxx xxxx 7463000 12月 24 18:39 gcc-7_7.4.0-1ubuntu1~18.04.1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 3911688 12月 11 03:03 git_1%3a2.17.1-1ubuntu0.5_amd64.deb
-rw-r--r-- 1 xxxx xxxx 803316 12月 11 03:03 git-man_1%3a2.17.1-1ubuntu0.5_all.deb
-rw-r--r-- 1 xxxx xxxx 358912 12月 24 18:39 libasan4_7.4.0-1ubuntu1~18.04.1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 9184 12月 24 18:39 libatomic1_8.3.0-6ubuntu1~18.04.1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 2586592 12月 24 18:39 libc6-dev_2.27-3ubuntu1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 71800 12月 24 18:39 libc-dev-bin_2.27-3ubuntu1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 42536 12月 24 18:39 libcilkrts5_7.4.0-1ubuntu1~18.04.1_amd64.deb
-rw-rw-r-- 1 xxxx xxxx 211364 12月 28 17:52 libdpkg-perl_1.19.0.5ubuntu2_all.deb
-rw-r--r-- 1 xxxx xxxx 22828 11月 2 2017 liberror-perl_0.17025-1_all.deb
-rw-r--r-- 1 xxxx xxxx 2380772 12月 24 18:39 libgcc-7-dev_7.4.0-1ubuntu1~18.04.1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 27964 12月 24 18:39 libitm1_8.3.0-6ubuntu1~18.04.1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 132648 12月 24 18:39 liblsan0_8.3.0-6ubuntu1~18.04.1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 11628 12月 24 18:39 libmpx2_8.3.0-6ubuntu1~18.04.1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 59224 11月 13 08:59 libnvidia-container1_1.0.5-1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 15600 11月 13 08:59 libnvidia-container-tools_1.0.5-1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 133348 12月 24 18:39 libquadmath0_8.3.0-6ubuntu1~18.04.1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 288164 12月 24 18:39 libtsan0_8.3.0-6ubuntu1~18.04.1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 126184 12月 24 18:39 libubsan0_7.4.0-1ubuntu1~18.04.1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 10993400 12月 24 18:39 linux-headers-4.15.0-38_4.15.0-38.41_all.deb
-rw-r--r-- 1 xxxx xxxx 1110208 12月 24 18:39 linux-headers-4.15.0-38-generic_4.15.0-38.41_amd64.deb
-rw-r--r-- 1 xxxx xxxx 999520 12月 24 18:39 linux-libc-dev_4.15.0-72.81_amd64.deb
-rw-r--r-- 1 xxxx xxxx 127048268 12月 24 18:39 linux-source-4.15.0_4.15.0-72.81_all.deb
-rw-r--r-- 1 xxxx xxxx 2348 12月 24 18:39 linux-source_4.15.0.72.74_all.deb
-rw-r--r-- 1 xxxx xxxx 153924 12月 28 17:50 make_4.1-9.1ubuntu1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 2216684 12月 24 18:39 manpages-dev_4.15-1_all.deb
-rw-r--r-- 1 xxxx xxxx 247872 12月 24 18:39 ncurses-term_6.1-1ubuntu1.18.04_all.deb
-rw-r--r-- 1 xxxx xxxx 611788 11月 13 08:59 nvidia-container-runtime_3.1.4-1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 574584 11月 13 08:59 nvidia-container-runtime-hook_1.4.0-1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 575236 11月 13 08:59 nvidia-container-toolkit_1.0.5-1_amd64.deb
-rw-r--r-- 1 xxxx xxxx 2948 11月 13 08:59 nvidia-docker2_2.2.2-1_all.deb
-rw-r--r-- 1 xxxx xxxx 332744 12月 24 18:39 openssh-server_1%3a7.6p1-4ubuntu0.3_amd64.deb
45572 12月 24 18:39 openssh-sftp-server_1%3a7.6p1-4ubuntu0.3_amd64.deb
14246 12月 28 18:26 Packages.gz
57448 12月 28 2017 pigz_2.4-1_amd64.deb
10896 12月 24 18:39 ssh-import-id_5.7-0ubuntu1.1_all.deb

Get Docker CE for Ubuntu

https://docs.docker.com/install/linux/docker-ce/ubuntu

How To Build Local APT Repositories?

https://www.centos.bz/2017/07/apt-mirror-deploy-ubuntu-local-repositry

https://odzangba.wordpress.com/2006/10/13/how-to-build-local-apt-repositories

How To Install Softwares Offline In Ubuntu 16.04

https://www.ostechnix.com/install-softwares-offline-ubuntu-16-04

https://www.jb51.net/article/99570.htm

Is there an apt command to download a deb file from the repositories to the current directory?

https://askubuntu.com/questions/30482/is-there-an-apt-command-to-download-a-deb-file-from-the-repositories-to-the-curr

How to list/download the recursive dependencies of a debian package?

https://stackoverflow.com/questions/22008193/how-to-list-download-the-recursive-dependencies-of-a-debian-package

How to download all dependencies and packages to directory?

https://stackoverflow.com/questions/13756800/how-to-download-all-dependencies-and-packages-to-directory

How To Create A Local Debian/Ubuntu Mirror With apt-mirror?

https://www.howtoforge.com/local_debian_ubuntu_mirror

How do I download a package from apt-get without installing it?

https://stackoverflow.com/questions/4419268/how-do-i-download-a-package-from-apt-get-without-installing-it

How to Force update from unsigned repository Ubuntu 16.04 ?

https://askubuntu.com/questions/732985/force-update-from-unsigned-repository-ubuntu-16-04

How to download .deb package and all dependencies?

https://superuser.com/questions/876727/how-to-download-deb-package-and-all-dependencies

Ubuntu 16.04: Download deb package and all package dependencies

https://www.hiroom2.com/2016/08/10/ubuntu-16-04-download-deb-package-and-all-package-dependencies

How to list all packages from a repository in ubuntu / debian?

https://serverfault.com/questions/252333/list-all-packages-from-a-repository-in-ubuntu-debian

https://www.linuxuprising.com/2018/11/how-to-list-all-packages-in-repository.html

https://askubuntu.com/questions/220478/how-to-get-list-of-installable-packages-from-repositories

THE DEB AND DEB-SRC TYPES: GENERAL FORMAT

https://manpages.debian.org/testing/apt/sources.list.5.en.html

Ubuntu本地软件源制作的更多相关文章

  1. CentOS使用安装光盘建立本地软件源

    本实验的目的是使用CentOS的两张DVD安装光盘作为本地软件源,避免执行yum安装命令时每次都要从网络重新下载. 安装createrepo软件包 createrepo是制作软件源所需要的一个工具,默 ...

  2. [ubuntu]deb软件源

    虽然ubuntu的中国服务器的速度已经非常不错,但是难免,会有网络不畅的情形,所以修改软件源地址是一个基础的知识点. 修改ubuntu的软件源的方式有多种,一直是通过ubuntu软件中心提供的UI,还 ...

  3. ubuntu更换软件源

     ubuntu更换软件源 /etc/apt/source.list 163: deb http://mirrors.163.com/ubuntu/ trusty main restricted u ...

  4. ubuntu 更新软件源

    ubuntu 更新软件源 修改文件sources.list 位于/etc/apt/sources.list,并备份原文件为sources.list.bak deb http://mirrors.163 ...

  5. linux -- ubuntu 何为软件源

    新手学Ubuntu的时候,一般不知道什么是源,但源又是Ubuntu下常用到的东西.因此,本文就详细介绍一下Ubuntu 源. 什么是软件源? 源,在Ubuntu下,它相当于软件库,需要什么软件,只要记 ...

  6. [转]Fedora22添加国内软件源和本地软件源

    Fedora22添加国内软件源和本地软件源 Linux系统和Windows系统一个很大的区别就是软件安装方式,windows系统下安软件,我们去相应的网站下载软件安装包离线安装就可以了.虽然Linux ...

  7. linux ubuntu 本地镜像 软件源 制作方法

    1.配置当前软件源,镜像非常大,所以首先要配置一下载速度快的软件源http://fffo.blog.163.com/blog/static/2119130682014322104136601/2.安装 ...

  8. Linux软件源书写格式解析及本地yum源制作

    1.Debian类系统 配置文件:/etc/apt/sources.list 例子:deb https://mirrors.aliyun.com/kali kali-rolling main cont ...

  9. 本地YUM源制作

    YUM相关概念 什么是YUM YUM(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及CentOS中的Shell前端软件包管理器.基于RPM包管 ...

随机推荐

  1. SpringBoot传参方式

    地址传参 1.创建一个Action类 package com.lion.action; import org.springframework.stereotype.Controller; import ...

  2. LC 20 Valid Parentheses

    问题 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the i ...

  3. 4.Linux系统命令及其使用详解

    运维工程师必会的109个Linux命令   文件管理basename:从文件名中去掉路径和扩展名 cat:把档案串连接后传到基本输出(屏幕或加 > filename 到另一个档案)cd:切换目录 ...

  4. 怎样在浏览器端增加一条Cookie

    可以使用 document.cookie, 这个属性可读可写, 读时是读取所有没有设置HttpOnly的cookie作为一个字符串返回, 写时是将一个cookie写入到document.cookie中 ...

  5. python经典小程序集锦(一) 实现九九乘法表

    本篇文章主要是收集整理一些小程序以供大家娱乐,或者是在面试的时候使用到.文章会持续更新,希望大家收藏关注哦. 1.代码实现过程 for i in range(1, 10): for j in rang ...

  6. c#将电脑时间同步到网络时间

    最近遇到个项目,需要控制软件使用时间,由于电脑不联网可以修改时间,故需要联网使电脑同步网络时间 网上寻找了很多解决方案,代码如下: //Forproc_Win32.cs//对常用Win32 API函数 ...

  7. 2.JVM、JRE、JDK之间的关系

    诠释一. JDK(java development kit) JDK是Java开发工具包,是整个Java的核心,包括了Java运行环境JRE.Java工具和Java基础类库. JRE(java run ...

  8. EF的导航属性

    在EF中,外键被称为导航属性. 在EF core中,查询的时候默认是只查自身而不会去查询外键表的.如果想要让查询结果包含外键实体,则需要使用include方法来让查询结果包含外键实体.如 db.Stu ...

  9. 使用jMeter构造大量并发HTTP请求进行微服务性能测试

    比如我开发好了一个微服务,想测试其在大并发请求下的性能表现如何. 比较方便的一个做法是使用工具jMeter来构造这些请求. 创建一个新的工程: 创建一个新的Thread Group,下图意思是这个工程 ...

  10. 虚拟机不能桥接联网 vmnet0上的网桥当前未运行

    win10家庭版更新到内测版后,原来可以正常桥接工作的虚拟机ubuntu不能在桥接模式下联网和ssh连接了,因为获取不到IP地址了. 上网搜索一下,发现直接粗暴的方法--修复VMware Workst ...