个人工具

UbuntuHelp:Synaptic/PackageDownloadScript

来自Ubuntu中文

跳转至: 导航, 搜索

Note: You can download old packages this way but you can not get any updated packages. Check apt-medium on how to get the apt-tools to work on offline systems. --- Start Synaptic Package Manager (SPM). Mark all the applications that you want to install/upgrade in the usual way. After that, instead of clicking the “Apply” button from the toolbar as you would normally do, go to the File menu and select “Generate Package Download Script” menu option to generate the download script. A dialog box will prompt to save the generated script file. Give it a name like ‘ubuntu.sh’ and click the “Save” button. This script file needs to be carried to a machine which has a fast Internet connection and it needs to be executed there.

Downloading

You can download or save the files to a USB keydrive

Downloading in Windows

The first line need to be removed if the script is to be run on a Windows machine.

Linkification and DownThemAll way

This is the easiest way. You can install two plug-in for Mozilla Firefox. The first one is Linkification to convert text links into genuine, clickable links. DownThemAll plug-in is a download manager/accelerator. When downloaded and installed, go to Tools > DownThemAll > >downthemall:

  • Save files in your USB keydrive.
  • Include *.deb in fast filtering

And Start !.

Ubuntu Live CD

You can boot the Ubuntu Live CD and run the ‘ubuntu.sh’ script in a terminal. This can be impractical if you has no administrator´s permissions to access to the Internet using the Live CD.

Windows Wget way

The first line need to be removed if the script is to be run on a Windows machine and rename to file to ubuntu.bat You can use Wget for Windows. Don´t forget set the path to the folder where wget.exe is. You can also put wget.exe in c:\wgetdir\ ( edit the script with a text editor and replace all references to wget with c:\wgetdir\wget )

Downloading in Linux

It will be convenient if the machine with fast Internet connection runs some flavour of GNU/Linux operating system with wget installed on it. Start a shell/command prompt, change to the directory where you want to store the files to downloaded and run the script as shown:

sh ubuntu.sh

An alternative way using the file manager (Nautilus), is to move the script to the directory where you want to store the files to dowload and click in the script file (ubuntu.sh)

Installation

Once the downloads are finished, carry all the downloaded files to the Ubuntu machine and copy them to a new folder (say 'Downloads') in the home directory. Start Synaptic Package Manager again and select the same package(s) name(s) that you initially selected. Go to “Add downloaded packages” from the File menu, notice that the window that pops up is titled "Select directory" not "Select file(s)", you do not select individual package files but the directory which contains them. Therefore you should browse to the directory which contains 'Downloads', click once on 'Downloads' to select it, then click Open. Synaptic will then scan the selected directory for packages and offer to install them. It is similar to use

sudo dpkg - i *.deb

See also