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. 【熊猫】POS销售

    select a.itemcode,b.itemname,b.spec,b.unit,b.rprice,sum(a.rqty) rqtyfrom tm_possale_detail a,sys_ite ...

  2. (原)JNI中env->GetByteArrayElements和AndroidBitmap_getInfo的冲突

    也不是很确定,前段时间的代码没有出问题,但是今天调试了半天,一直崩溃:vm aborting. 以前的部分代码: JNIEXPORT void JNICALL XXX (JNIEnv* env,job ...

  3. 为什么所有浏览器的userAgent都带Mozilla

    参看下面链接:<为什么所有的浏览器的userAgent都带Mozilla>

  4. Windows上Python3.5安装Scrapy(lxml)

    常用网址: Python 3.5: https://www.python.org/downloads/ Wheel文件:http://www.lfd.uci.edu/~gohlke/pythonlib ...

  5. PHP每日签到及连续签到奖励实现示例

    数据库字段 num 记录已经连续签到次数 times 记录签到的日期 格式年月日 如 20160101 PHP代码如下 <?php //获取今天的日期 $today = date('Ymd'); ...

  6. android TextView 垂直滚动 用动画实现

    项目中需要让TextView 滚动一会显示一行一会显示一行 想了下用移动动画实现.但是实际中在整这个动画时调了好久.主要用到的动画方式是移动动画:TranslateAnimation 代码: PS: ...

  7. Code repo

    http://www.oschina.net/news/15806/20-opensource-host-websites/

  8. QT 小票打印

    原地址: http://www.cppblog.com/biao/archive/2009/09/08/95603.html QString htmlString = QString("&l ...

  9. linux下so动态库一些不为人知的秘密(上)

    linux 下有动态库和静态库,动态库以.so为扩展名,静态库以.a为扩展名.二者都使用广泛.本文主要讲动态库方面知识.        基本上每一个linux 程序都至少会有一个动态库,查看某个程序使 ...

  10. 深入剖析MFC中对于Windows消息处理、运行机制

    序: 本人对Windows系统.MFC谈不上有深入的了解,但对MFC本身包装API的机制很有兴趣,特别是读了候老师的<深入浅出MFC>后,感觉到VISUAL C++的Application ...