apt-get

Use apt-get with the "--print-uris" option to do it. I also add "-qq" so it would be quiet.

Create script:

sudo apt-get <<>> --print-uris -qq | sed -n "s/'([^ ]+)' ([^ ]+) ([^ ]+) MD5Sum:([^ ]+)/wget -c \1/p" > script.cmd

Examples

sudo apt-get install anjuta --print-uris -qq | sed -n "s/'([^ ]+)' ([^ ]+) ([^ ]+) MD5Sum:([^ ]+)/wget -c \1/p" > install-anjuta.cmd
sudo apt-get upgrade --print-uris -qq | sed -n "s/'([^ ]+)' ([^ ]+) ([^ ]+) MD5Sum:([^ ]+)/wget -c \1/p" > upgrade.cmd
sudo apt-get dist-upgrade --print-uris -qq | sed -n "s/'([^ ]+)' ([^ ]+) ([^ ]+) MD5Sum:([^ ]+)/wget -c \1/p" > dist-upgrade.cmd

Create md5sum file:

sudo apt-get <<>> --print-uris -qq | sed -n -e "s/[0-9]%[0-9a-f][0-9a-f]//" -e "s/'([^ ]+)' ([^ ]+) ([^ ]+) MD5Sum:([^ ]+)/\4 .\/\2/p" > md5sum.txt

Examples:

sudo apt-get install anjuta --print-uris -qq | sed -n -e "s/[0-9]%[0-9a-f][0-9a-f]//" -e "s/'([^ ]+)' ([^ ]+) ([^ ]+) MD5Sum:([^ ]+)/\4 .\/\2/p" > md5sum.txt
sudo apt-get upgrade --print-uris -qq | sed -n -e "s/[0-9]%[0-9a-f][0-9a-f]//" -e "s/'([^ ]+)' ([^ ]+) ([^ ]+) MD5Sum:([^ ]+)/\4 .\/\2/p" > md5sum.txt
sudo apt-get dist-upgrade --print-uris -qq | sed -n -e "s/[0-9]%[0-9a-f][0-9a-f]//" -e "s/'([^ ]+)' ([^ ]+) ([^ ]+) MD5Sum:([^ ]+)/\4 .\/\2/p" > md5sum.txt

Create script to download repository listings:

sudo apt-get update --print-uris -qq | sed -n "s/'([^ ]+)' ([^ ]+) ([^ ]+) :/wget -c \1 -O \2.bz2/p" > update.cmd

Synaptic

In synaptic you can select the packages you want to install and under the first menu there is an option to generate a script which you can take to another machine and run there. This script will "wget" (i.e. "download") all the packages you specified that you wanted (and their dependencies) which you run on a computer that does have internet access.

Once run you'll have all the package files needed by the disconnected computer. Carry them on a CD/USB stick and install them by sudo dpkg -i *.deb.

Cube

You can use Cube. It is an offline package management system which is compatible with Ubuntu, Linux Mint and other distributions that use apt-get.
Latest Preview of Cube 1.0.8 (February 7, 2014 Release) Camicri Cube

Running in freshly installed Ubuntu 12.04 Ubuntu

On Windows

References

  1. How can I install software or packages without Internet (offline)? answer1 answer2
  2. Camicri Cube: An Offline And Portable Package Management System
  3. Get packages and dependencies for installing offline

Ubuntu package offline install的更多相关文章

  1. remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.

    如果cmake提示下列错误:......CMake Error at cmake/readline.cmake:85 (MESSAGE):  Curses library not found.  Pl ...

  2. How to create Web Deployment Package and install the package

    Create Web Deployment Package To configure settings on the Connection tab In the Publish method drop ...

  3. ubuntu 13.10 install wireshark

    ubuntu 13.10 install wireshark 今天在使用java jsoup操作remote server的是否,在本地执行可以成功返回内容,然后打成jar包,使用shell在 ser ...

  4. 【maven】maven命令 package、install、deploy 的区别

    maven命令  package.install.deploy  的区别

  5. ubuntu mac terminal install software

    http-server // ubuntu sudo npm install http-server -g npm node.js yarn

  6. anaconda2下面安装opencv2.4.13.4完成----解决默认安装的问题----Thefunction is not implemented. Rebuild the library with Windows, GTK+ 2.x orCarbon support. If you are on Ubuntu or Debian, install libgtk2.0‑dev and pkg

    转载自:http://blog.csdn.net/qingyanyichen/article/details/73550924 本人下载编译安装了opencv2.4.9,oppencv2.4.10,o ...

  7. CentOS中实现与Ubuntu下apt-get install build-essential功能类似的命令

    CentOS中实现与Ubuntu下apt-get install build-essential功能类似的命令 在Ubuntu中安装完系统后,可以直接使用apt-get install build-e ...

  8. Debian/Ubuntu pip default install to $HOME/.local

    pip default install to $HOME/.local on Debian/Ubuntu After pip 8.1.1-2 on Debian or Ubuntu you can p ...

  9. ubuntu openfire Server install

    1.首先登录到ubuntu server.在安装openfire 服务器之前,先确保你的系统已经更新到最新.然后输入下面的命令,一行一行执行,最后安装可用的更新 sudo apt-get update ...

随机推荐

  1. Intent中的重要属性详解

    Intent中的四个重要属性主要有四个,分别是Action.Data.Category.Extras. Intent作为联系各Activity,BroadcaseReciver,Service之间的纽 ...

  2. Spring整合Hibernate 一 - 注入SessionFactory

    Spring3 整合 Hibernate4 - 注入SessionFactory 版本: spring-framework-3.2.4.RELEASE hibernate-release-4.2.5. ...

  3. Foundation--NSString+NSMutableString

    NSString 字符串创建: 1.NSString *strr = @"0123456789"; 2.NSString *str = [NSString stringWithSt ...

  4. node.js入门(二) 第一个程序 Hello World

    新建一个名为"hello.js"文本文件,然后输入如下内容 //载入http模块 var http = require('http'); //构建一个http服务器 var ser ...

  5. ckeditor的使用与验证

    1.使id=id的textArea变为富文本编辑框 function inittextarea(id) {  CKEDITOR.replace(id,{         width:'600px',  ...

  6. AngularJS入门基础PPT(附下载链接)

    学习了Angularjs有段时间,自己写了一个PPT,个人认为总结的非常全面,对于入门基础够了. 大致模块有:Angularjs简单介绍,Angularjs特性,hello world,Control ...

  7. CSS 怀疑 Verify

    1. height 之前好像看到有人说,div标签的height设置一个固定值后,div标签的height会随着内容的增多而变大 经测试,内容会溢出div标签,但div标签的height不会随着变化

  8. SQLServer 2012 可视化窗口中,设置“时间”默认值为“当前时间"

    最近,需要在SQLServer 2012中,设置datetime的默认值为当前时间. 通过可视化窗口进行设置,而不是将getdate()函数写在sql语句中,也不是将‘2022-2-2 22:22:2 ...

  9. JS三元运算符

    语法是 条件 ? 结果1 : 结果2; 问号(?)的前面是条件:后面跟着用冒号(:)分隔的结果1和结果2;满足条件时结果1否则结果2. 例子: var a=1; a>2?a:a=3; alert ...

  10. c++中在一个类中定义另一个只有带参数构造函数的类的对象

    c++中在一个类中定义另一个只有带参数构造函数的类的对象,编译通不过 #include<iostream> using namespace std; class A { public:  ...