Install linux package offline

Install package along with all the dependencies offline [duplicate]

I decided to download all needed packages using first PC and transfer them to the second PC via USB. I have searched how to get all needed packages for some deb installation and here’s what I’ve found.

apt-get --print-uris --yes install A | grep ^\' | cut -d\' -f2 > downloads.list 

on first PC I got empty file because this package is already installed there (and I don’t want to uninstall it).

Also package A is very complicated and depends on package B which depends on package C and package C is not installed on the second PC.

So how can I download all needed packages? Or is there any other way of installing it?

4 Answers 4

keryx
It’s a gui application for installing packages on complete offline system.

apt-offline : CLI
Let offPC is the offline computer and onPC is the online computer.

  1. Install apt-offline on offPC
  2. Download apt-offline from onPC. (try: http://packages.debian.org/wheezy/all/apt-offline/download)
  3. Copy and paste the ‘.deb’ file to offPC
  4. Install it by opening it. (or using sudo dpkg -i ‘/path/to/file/apt-offline.deb’ )
  5. Generate update link file [offPC]
    sudo apt-offline set /tmp/updateee —update

gpgv: Signature made Fri 21 Jun 2013 02:08:43 PM UTC using DSA key ID 437D05B5 gpgv: Good signature from «Ubuntu Archive Automatic Signing Key » gpgv: Signature made Fri 21 Jun 2013 02:08:43 PM UTC using RSA key ID C0B21F32 gpgv: Good signature from «Ubuntu Archive Automatic Signing Key (2012) «

Note1: Before using the file (updateee, package), you have to transfer the file from offPC to onPC (using Pen drive or something). Also copy the folder containing downloaded file to onPC to offPC.

Note2: If you get an error

E: Unable to locate package package_name

while installing, that means the package is not known to the offPC. This occurs due to many reason. such as Personal package maintained be private parties. (Search PPA)
Try add software sources by opeing software sources (from unity), then tick on Universe and other filds

Источник

apt-offline – Fully Upgrade Offline Debian-based Distributions

Brief: This article guide walks Debian-based users through the download, installation, and usage of the apt-offline tool to effortlessly upgrade Debian-based Linux distribution with limited, slow, or zero internet connection.

apt-offline is an offline package management utility that is used to install/upgrade software packages with their dependencies on Debian-based Linux distributions with no direct internet connection.

apt-offline Features

  • It retrieves full bug reports of installed and upgraded packages.
  • Downloads source deb package with associated build dependencies (particularly important for developers).
  • Leverages the power of APT on a disconnected Debian or Debian distro machine.

Installing apt-offline in Debian Systems

The apt-offline tool is available to install from the default repositories of Debian and Debian-based Linux distributions such as Ubuntu and Linux Mint.

$ sudo apt install apt-offline

Install APT-Offline in Debian Systems

If you’re system not connected to the internet, you can download the apt-offline file and transfer it to the Debian-based system without an internet connection using scp or sftp tools.

Once the .deb file has been transferred to your offline Debian-based system, install it with the command:

$ sudo dpkg -i apt-offline_1.8.4-1_all.deb

Upgrade Debian Systems Offline Using apt-offline

With apt-offline installed on both online and offline Debian-based systems, we can move on and demonstrate its usage.

Installing a Package on Offline Debian System

On the offline Debian-based system, we will create a directory called SystemUpdate.

Inside this directory, we should be able to generate a database of files (signature file) that will help the online Debian-based system download updates for us. For instance, let us assume we want to download the Vim editor for the offline machine.

We will first create a signature file for vim.

$ cd SystemUpdate $ sudo apt-offline set apt-offline.sig --install-packages vim

The generated signal file (apt-offline.sig) will be responsible for installing vim on your offline Debian-based system.

The next step is to copy the SystemUpdate directory from the offline Debian-based system to the online Debian-based system.

On the online Debian-based system, navigate inside the copied directory and execute the following command to collect system update data for the offline Debian-based system.

$ cd SystemUpdate $ sudo apt-offline get apt-offline.sig --bundle apt-offline-bundle.zip

Collect System Update for Offline System

The downloaded vim data for the offline Debian-based system will be saved in the specified apt-offline-bundle.zip file. Copy the SystemUpdate directory back to the offline system.

On the offline system, navigate to the newly copied directory content:

Implement the downloaded updates on the apt-offline-bundle.zip file with the command:

$ sudo apt-offline install apt-offline-bundle.zip

Install Packages Offline in Debian Systems

If you check the Vim version, you might think it’s not installed.

Check Vim Version

However, its binary files exist:

$ whereis vim vim: /etc/vim usr/share/vim usr/share/man/man1/vim.1.gz 

Updating or Upgrading the Offline Debian Systems

Here, we will only need to regenerate the steps covered above:

1. Create a signature file on the offline system for updating or upgrading.

$ sudo apt-offline set update-offline.sig --update $ sudo apt-offline set upgrade-offline.sig --upgrade

2. Copy the directory with the signature file to the online system and collect system update/upgrade data for the offline method.

$ sudo apt-offline get update-offline.sig --bundle update-offline-bundle.zip $ sudo apt-offline get upgrade-offline.sig --bundle upgrade-offline-bundle.zip

3. Copy the generated .zip file back to the offline machine and install your updates/upgrades.

$ sudo apt-offline install update-offline-bundle.zip $ sudo apt-offline install upgrade-offline-bundle.zip

apt-offline makes it easier for disconnected or offline Debian-based systems to install the latest updates/packages and perform system/package upgrades since the update and upgrade files can be downloaded and installed later.

Источник

Ubuntu Wiki

On the machine that you wish to install a package (or set of packages) or perform an upgrade on, complete the following steps.

With Synaptic

Within synaptic check the desired packages to be installed or select Edit > Mark all upgrades to perform an upgrade and select File > Generate package download script. Save the file as /tmp/apt-get-list

If the machine you are going to use to download packages runs Microsoft Windows, go to step 2.

If the other machine you are downloading packages on is unix or linux with wget installed (this includes ubuntu and other major distributions of linux), save the file onto a portable device such as a USB thumb drive, floppy, CD-ROM, Network Share, etc and run it on the other machine as shown below; when finished go to step 4.

# substitute the right path and filename here. mkdir -p ~/deb_files && cd ~/deb_files && sh /path/to/download-script

With apt-get

If you do not have synaptic installed, you can use apt-get.

# this step is complete optional and requires you to have a connection to the internet # use it if you wish to upgrade or get the latest packages. sudo apt-get update # If you wish to install a set of packages apt-get install --print-uris package_name_1 package_name_2 package_name_etc | tee /tmp/apt-get-list # Or if you wish to upgrade all packages apt-get upgrade --print-uris package_name | tee /tmp/apt-get-list

Generating a URI list

In the previous step, we saved the package list as /tmp/apt-get-list, if you saved it differently, substitute the right path and filename here.

perl -nle 'print $1 if /\W?(ftp|http.*?)\W?(?:\s|\z)/' < /tmp/apt-get-list >uri_list

Now you can copy this file uri_list to the other machine using a memory stick, network, floppy, etc.

Downloading packages on another machine

We use wget here to download files here, your operating system and setup might not have wget in which case you could use something like curl, lynx, lwp-download, etc.

Downloading packages on a unix-like machine with wget

Most popular unix-like operating systems provide wget, these include linux, unix, cygwin, etc. If you don’t have wget installed, install it before running this command. Please consult your Operating System manual, Systems Administrator or Support Channel if you require assistance.

mkdir -p ~/deb_files && cd ~/deb_files while read uri; do wget "$uri"; done < /path/to/uri_list

Downloading packages on Microsoft Windows with wget

If you don't have wget installed, you can get a binary executable here gnuwin32

Open up a command prompt by navigating to Start -> Run then typing cmd.exe and clicking Ok. Note the path to the uri_list file, you must get it right for the following commands to work. You can drag the uri_list file in Windows Explorer into your Command Prompt window to get the complete and correct path.

REM substitute the right path and filenames here mkdir deb_files && cd deb_files for /f %g in (\path\to\uri_list) do (wget %g)

Now copy the deb_files folder back to your machine, but be sure to verify that the files have actually been downloaded first.

Installing the packages

After you have copied the deb_files folder back to your machine, you can install them this way

# substitute the right path names here cd /path/to/deb_files/ && sudo dpkg -i *.deb

OfflinePackageDownload (последним исправлял пользователь 77-21-62-108-dynip 2009-12-18 20:35:06)

The material on this wiki is available under a free license, see Copyright / License for details.

Источник

Читайте также:  Safe mode linux server
Оцените статью
Adblock
detector