Fwd: How to install using apt-get from local .deb files without Internet OR how to bypass sudo apt-get update

22 views
Skip to first unread message

Narendra Sisodiya

unread,
May 9, 2011, 1:17:55 PM5/9/11
to iitdlug, Ubuntu India Local Community
I recently created a offline installer..  debbundle.. 
I got a bug in it..
Let me explain the process..

See code -> 

To install vim-gtk, I am first downloading all deb package (and not installing it.)

mkdir -p vim-gtk
mkdir -p vim-gtk/partial
sudo apt-get -y -o dir::cache::archives=./vim-gtk install --download-only vim-gtk
sudo rm vim-gtk/lock

Now I am copying this folder and another system which do not have Internet..

so on system 2, I am running following commands..

cd /media/usbdrive/vim-gtk
sudo apt-get -y -o dir::cache::archives=/media/usbdrive/vim-gtk install vim-gtk


This is not installing vim-gtk on second system which is just freshly installed.

Initially when I created this project few days back, I was using same machine as build-server and install-test server. SO i was not getting this error//

Source of Error : basically, a freshly installed system do not have -- sudo apt-get update
If I run sudo apt-get update command then I command will work..
So basically, on a freshly installed system one has to apply "sudo apt-get install update" in order to install some package. How I can bypass this because my second machine do not have Internet.

Let me know if anybody want any more clarity.


PS: I am forwarding this to OSCOntrib mailing list so that people can create something similar for yum..
--
┌─────────────────────────┐
│    Narendra Sisodiya
│    http://narendrasisodiya.com
└─────────────────────────┘



--
┌─────────────────────────┐
│    Narendra Sisodiya
│    http://narendrasisodiya.com
└─────────────────────────┘

Sharad Birmiwal

unread,
May 9, 2011, 1:48:47 PM5/9/11
to iit...@googlegroups.com
What I understand from your explanation is that the second machine
without internet might have an older snapshot of the repository. Thus,
when it tries to install vim-gtk, it's looking for an older version of
vim-gtk and corresponding dependencies? But you had a fresh
installation on the machine *with* internet?

> This is not installing vim-gtk on second system which is just freshly installed.

Please show us the error as well besides your explanation.

> cd /media/usbdrive/vim-gtk
> sudo apt-get -y -o dir::cache::archives=/media/usbdrive/vim-gtk install
> vim-gtk
>

The following might work.

cd /media/usbdrive/vim-gtk
sudo apt-get -y install *deb


SB

Narendra Sisodiya

unread,
May 9, 2011, 2:04:33 PM5/9/11
to iit...@googlegroups.com
On Mon, May 9, 2011 at 11:18 PM, Sharad Birmiwal <sharadb...@gmail.com> wrote:
What I understand from your explanation is that the second machine
without internet might have an older snapshot of the repository.

infact , the problem is -- there is not snapshot on second machine..

what apt-get update do ?? what change it makes in file system,. what exact files it download ?? second machine is missing these files..
Now you got the problems ??


 
Thus,
when it tries to install vim-gtk, it's looking for an older version of
vim-gtk and corresponding dependencies? But you had a fresh
installation on the machine *with* internet?


Second machine do not has any internet... not even while installing ..

 
> This is not installing vim-gtk on second system which is just freshly installed.

Please show us the error as well besides your explanation.

> cd /media/usbdrive/vim-gtk
> sudo apt-get -y -o dir::cache::archives=/media/usbdrive/vim-gtk install
> vim-gtk
>

The following might work.

cd /media/usbdrive/vim-gtk
sudo apt-get -y install *deb


Nope 
Infact, sudo dpkg -i *deb  will work very fine..
But I want to use apt-get..

Sharad Birmiwal

unread,
May 9, 2011, 2:28:06 PM5/9/11
to iit...@googlegroups.com
>> cd /media/usbdrive/vim-gtk
>> sudo apt-get -y install *deb
>
> Nope
> Infact, sudo dpkg -i *deb  will work very fine..

Errr.. I meant "sudo dpkg -i *deb" :)


SB

Chhatoi Pritam Baral

unread,
May 9, 2011, 11:54:56 PM5/9/11
to iit...@googlegroups.com
>without internet might have an older snapshot of the repository.

I guess you are looking for these files:
/var/cache/apt/pkgcache.bin
/var/cache/apt/srcpkgcache.bin
 

Regards,
Chhatoi Pritam Baral

Narendra Sisodiya

unread,
May 10, 2011, 11:25:18 AM5/10/11
to iit...@googlegroups.com
On Tue, May 10, 2011 at 9:24 AM, Chhatoi Pritam Baral <chhato...@gmail.com> wrote:
>without internet might have an older snapshot of the repository.

I guess you are looking for these files:
/var/cache/apt/pkgcache.bin
/var/cache/apt/srcpkgcache.bin

I will check this ..
I got following reply form other mailing list .. I will test this too..


Use dpkg-scanpackages (which is in package dpkg-dev).  See
http://www.debian.org/doc/manuals/apt-howto/ch-basico.en.html#s-dpkg-scanpackages

Try adding line:
deb file:/media/usbdrive vim-gtk/
to /etc/apt/sources.list .  Then in /media/usbdrive as root type:
dpkg-scanpackages vim-gtk /dev/null | gzip > vim-gtk/Packages.gz
aptitude update
 
Then you can use aptitude to install the packages. 

Reply all
Reply to author
Forward
0 new messages