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. OS X EI Capitan 安装mysql-5.7.9

    先去下载mysql-5.7.9-osx10.9-x86_64.dmg安装(一直下一步,输入密码即可)mysql-5.7.9-osx10.9-x86_64.pkg好了,启动MySQL服务. Untitl ...

  2. Entity Framework 6 Code First创建

    基本上我是DB先设计好的,所以就按现存在的table去写程式. 1.Web.config里配置Db连接字串,Connection String Name为DefaultConnection <c ...

  3. Lambda 表达式中的变量范围

    delegate bool D(); delegate bool D2(int i); class Test { D del; D2 del2; public void TestMethod(int ...

  4. mysql中select into 和sql中的select into 对比

    现在有张表为student,我想将这个表里面的数据复制到一个为dust的新表中去.answer 01: create table dust select * from student;//用于复制前未 ...

  5. 智能电视TV开发---如何实现程序省电

    对于很多使用智能手机的用户来,很多抱怨手机耗电太快,很多人买手机的时候卖家都是推荐买两块电池,还有如果用户留心的话,在买手机的网页上,卖家会显示播放视频多长时间,听音乐多长时间,待机多长时间,不过看的 ...

  6. Android Studio导入GitHub

    方法一:引用开源项目的compile添加到gradle中http://www.zhihu.com/question/27027667 方法二:下载安装包引入:http://blog.csdn.net/ ...

  7. 关于left join连接查询 两张表里有同名字段的问题

    左连接查询在开发中很常用,但有个问题常常会遇到,两个表中有同名字段时,比如左右表都有一个id字段,会造成查询结果中左表的id值被右表的id值覆盖掉(大部分php框架都是这个效果),而且还不会报错,容易 ...

  8. autofac使用笔记

    在之前的项目中用来解耦的使用的轻型IOC框架是unity,它的使用也是很方便的提供在之前的文章的也提到过它的使用方式,但是使用久了之后发现了它的不足之处就是需要配置xml文件来对应的接口和实现的关系. ...

  9. SQL Server dbcc shrinkfile 不起作用

    方法 1.重建聚集索引. 方法 2.重建堆表. ---------------------------------------------------------------------------- ...

  10. Azure File SMB3.0文件共享服务(5)

      使用Java管理Azure文件共享服务   Azure文件共享服务提供了多种方式的访问接口,包括Powershell,.Net, Java, Python等等,本章主要介绍如何使用Java来访问A ...