I am currently trying to install software offline (studying this question) and want to use Offline Repository according to this answer.
I followed steps like:
- put all debs in
/var/my-local-repo
sudo bash -c 'dpkg-scanpackages /var/my-local-repo /dev/null > /var/my-local-repo/Packages'
(note:dpkg-dev
is already installed to perform this action)- set repository as root by
echo "deb file:/var/my-local-repo ./" > /etc/apt/sources.list.d/my-local.list
andsudo apt-get update
But when I tried to install package, following errors display:
Below is example output from terminal while installing synaptic
:
$ sudo apt-get install synaptic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
docbook-xml libcairo-perl libept1.4.12 libglib-perl libgtk2-perl
libpango-perl librarian0 rarian-compat sgml-data
Suggested packages:
docbook docbook-dsssl docbook-xsl docbook-defguide libfont-freetype-perl
libgtk2-perl-doc perlsgml w3-recs opensp libxml2-utils dwww menu deborphan
tasksel
The following NEW packages will be installed:
docbook-xml libcairo-perl libept1.4.12 libglib-perl libgtk2-perl
libpango-perl librarian0 rarian-compat sgml-data synaptic
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/3,437 kB of archives.
After this operation, 17.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
WARNING: The following packages cannot be authenticated!
libept1.4.12 sgml-data docbook-xml libcairo-perl libglib-perl libpango-perl
libgtk2-perl synaptic librarian0 rarian-compat
Install these packages without verification? [y/N] Y
Err file:/var/my-local-repo/ ./ libept1.4.12 1.0.12
File not found
Err file:/var/my-local-repo/ ./ sgml-data 2.0.9-1
File not found
Err file:/var/my-local-repo/ ./ docbook-xml 4.5-7.2
File not found
Err file:/var/my-local-repo/ ./ libcairo-perl 1.104-1
File not found
Err file:/var/my-local-repo/ ./ libglib-perl 3:1.304-1
File not found
Err file:/var/my-local-repo/ ./ libpango-perl 1.224-2
File not found
Err file:/var/my-local-repo/ ./ libgtk2-perl 2:1.249-2
File not found
Err file:/var/my-local-repo/ ./ synaptic 0.81.1
File not found
Err file:/var/my-local-repo/ ./ librarian0 0.8.1-5ubuntu1
File not found
Err file:/var/my-local-repo/ ./ rarian-compat 0.8.1-5ubuntu1
File not found
E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/libept1.4.12_1.0.12_i386.deb File not found
E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/sgml-data_2.0.9-1_all.deb File not found
E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/docbook-xml_4.5-7.2_all.deb File not found
E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/libcairo-perl_1.104-1_i386.deb File not found
E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/libglib-perl_3%3a1.304-1_i386.deb File not found
E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/libpango-perl_1.224-2_i386.deb File not found
E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/libgtk2-perl_2%3a1.249-2_i386.deb File not found
E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/synaptic_0.81.1_i386.deb File not found
E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/librarian0_0.8.1-5ubuntu1_i386.deb File not found
E: Failed to fetch file:/var/my-local-repo//var/my-local-repo/rarian-compat_0.8.1-5ubuntu1_i386.deb File not found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Here we can see that apt tries to fetch debs from /var/my-local-repo//var/my-local-repo/
instead of var/my-local-repo/
And if I move all debs into /var/my-local-repo/var/my-local-repo/
(by creating subdirectories) then after apt works fine and package is installed!
And synaptic working fine.
So, My question is Why Apt fetching debs from wrong location or/and What correction is needed in echo "deb file:/var/my-local-repo ./"
?
Found solution/correction myself after 1 to 2 days and correction needed which is working as follows:
Way-1:-
If Packages.gz
file is created by following command:
dpkg-scanpackages /var/my-local-repo | gzip > Packages.gz
Then It has all debs location information like follows:
Filename: /var/my-loca-repo/synaptic_0.81.1_i386.deb
Way-2 (recommended):-
If Packages.gz
file is created by following command:
(In other words After changing to that directory containing all debs)
dpkg-scanpackages . | gzip > ./Packages.gz
Then It has all debs location information like follows:
Filename: ./synaptic_0.81.1_i386.deb
Now if Packages.gz
is create by Way-1 then required correction in repository .list is:
deb file:/// var/my-local-repo/
or deb file:// /var/my-local-repo/
But it is recommended to create Packages.gz
by Way-2 then no correction is needed and right repository to be in .list is:
deb file:///var/my-local-repo/ ./
or deb file:/var/my-local-repo/ ./
Earlier I created Packages.gz
by Way-1 and set repository for 2nd way that's why apt
tries to fetch debs from directory which is not desired.
But Now I understand the reason and used 2nd way for creating Packages.gz
by dpkg-scanpackages
and final commands are:
For generating Packages.gz
:
dpkg-scanpackages . | gzip > ./Packages.gz
For setting repository:
sudo su
echo "deb file:/var/my-local-repo ./" > /etc/apt/sources.list.d/my-local.list
sudo apt-get update
And then package installed successfully as below:
$ sudo apt-get install synaptic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
docbook-xml libcairo-perl libept1.4.12 libglib-perl libgtk2-perl
libpango-perl librarian0 rarian-compat sgml-data
Suggested packages:
docbook docbook-dsssl docbook-xsl docbook-defguide libfont-freetype-perl
libgtk2-perl-doc perlsgml w3-recs opensp libxml2-utils dwww menu deborphan
tasksel
The following NEW packages will be installed:
docbook-xml libcairo-perl libept1.4.12 libglib-perl libgtk2-perl
libpango-perl librarian0 rarian-compat sgml-data synaptic
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/3,437 kB of archives.
After this operation, 17.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
WARNING: The following packages cannot be authenticated!
libept1.4.12 sgml-data docbook-xml libcairo-perl libglib-perl libpango-perl
libgtk2-perl synaptic librarian0 rarian-compat
Install these packages without verification? [y/N] Y
Selecting previously unselected package libept1.4.12:i386.
(Reading database ... 174777 files and directories currently installed.)
Preparing to unpack .../libept1.4.12_1.0.12_i386.deb ...
Unpacking libept1.4.12:i386 (1.0.12) ...
Selecting previously unselected package sgml-data.
Preparing to unpack .../sgml-data_2.0.9-1_all.deb ...
Unpacking sgml-data (2.0.9-1) ...
Selecting previously unselected package docbook-xml.
Preparing to unpack .../docbook-xml_4.5-7.2_all.deb ...
Unpacking docbook-xml (4.5-7.2) ...
Selecting previously unselected package libcairo-perl.
Preparing to unpack .../libcairo-perl_1.104-1_i386.deb ...
Unpacking libcairo-perl (1.104-1) ...
Selecting previously unselected package libglib-perl.
Preparing to unpack .../libglib-perl_3%3a1.304-1_i386.deb ...
Unpacking libglib-perl (3:1.304-1) ...
Selecting previously unselected package libpango-perl.
Preparing to unpack .../libpango-perl_1.224-2_i386.deb ...
Unpacking libpango-perl (1.224-2) ...
Selecting previously unselected package libgtk2-perl.
Preparing to unpack .../libgtk2-perl_2%3a1.249-2_i386.deb ...
Unpacking libgtk2-perl (2:1.249-2) ...
Selecting previously unselected package synaptic.
Preparing to unpack .../synaptic_0.81.1_i386.deb ...
Unpacking synaptic (0.81.1) ...
Selecting previously unselected package librarian0.
Preparing to unpack .../librarian0_0.8.1-5ubuntu1_i386.deb ...
Unpacking librarian0 (0.8.1-5ubuntu1) ...
Selecting previously unselected package rarian-compat.
Preparing to unpack .../rarian-compat_0.8.1-5ubuntu1_i386.deb ...
Unpacking rarian-compat (0.8.1-5ubuntu1) ...
Processing triggers for sgml-base (1.26+nmu4ubuntu1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.54ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for doc-base (0.10.5) ...
Scrollkeeper was installed, forcing re-registration of all documents.
Unregistering 33 doc-base files, re-registering 33 doc-base files...
Registering documents with scrollkeeper...
Setting up libept1.4.12:i386 (1.0.12) ...
Setting up sgml-data (2.0.9-1) ...
Setting up libcairo-perl (1.104-1) ...
Setting up libglib-perl (3:1.304-1) ...
Setting up libpango-perl (1.224-2) ...
Setting up libgtk2-perl (2:1.249-2) ...
Setting up synaptic (0.81.1) ...
Setting up librarian0 (0.8.1-5ubuntu1) ...
Processing triggers for sgml-base (1.26+nmu4ubuntu1) ...
Setting up docbook-xml (4.5-7.2) ...
Processing triggers for sgml-base (1.26+nmu4ubuntu1) ...
Setting up rarian-compat (0.8.1-5ubuntu1) ...
Processing triggers for libc-bin (2.19-0ubuntu6) ...
No comments:
Post a Comment