LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-27-2008, 02:24 AM   #1
uaa
LQ Newbie
 
Registered: Apr 2008
Posts: 4

Rep: Reputation: 0
offline update package lists in Ubuntu


how to update the packages index offline
Hello,
running this command will update my software lists

Code:
sudo apt-get update
if I ran this instead


Code:
sudo apt-get update --print-uris
I'll get links to the files that apt-get use to update, OK.

lets say I'm a user without any kind of internet connection and I want to get the latest software list to my Ubuntu system. so I can chose what I want and run "generate download script" from synaptic so I ran this:



Code:
sudo apt-get update --print-uris | grep ^\' | cut -d\' -f2 > file.txt
It gave me the links to the file that the apt-get update gets it's informations from.

Quote:
in apt-get man page:
--print-uris
....
This also works with the source and update commands. When used with the update command the MD5 and size are not included, and it is up to the user to decompress any compressed files. Configuration Item: APT::Get::Print-URIs.
is that right I mean no other way that if I downloaded these files to do something make the apt-get update command use the files I downloaded instead of the files from the internet.
please provide some way it would be nice to those who doesn't have internet so they can chose the software they want and download it later.

the same:
https://lists.ubuntu.com/archives/ub...st/045455.html
 
Old 07-28-2008, 11:25 AM   #2
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
http://batmat.net/apt-offline/ch3.html

HTH
 
Old 07-28-2008, 01:51 PM   #3
uaa
LQ Newbie
 
Registered: Apr 2008
Posts: 4

Original Poster
Rep: Reputation: 0
I'm sorry I wasn't clear.
after I got the files. how to make "apt-get update" use them instead of trying to connect to internet.

Many files have the same name so moving them as is to the lists folder won't fix it.
like the file Packages.bz2 .

And where to put the *.gpg files

I ran the command
Code:
sudo apt-get upate --print-uris
and I got this result:

Code:
'http://security.ubuntu.com/ubuntu/dists/hardy-security/restricted/binary-i386/Packages.bz2' security.ubuntu.com_ubuntu_dists_hardy-security_restricted_binary-i386_Packages 0 :
'http://security.ubuntu.com/ubuntu/dists/hardy-security/main/binary-i386/Packages.bz2' security.ubuntu.com_ubuntu_dists_hardy-security_main_binary-i386_Packages 0 :
'http://security.ubuntu.com/ubuntu/dists/hardy-security/universe/binary-i386/Packages.bz2' security.ubuntu.com_ubuntu_dists_hardy-security_universe_binary-i386_Packages 0 :
'http://security.ubuntu.com/ubuntu/dists/hardy-security/multiverse/binary-i386/Packages.bz2' security.ubuntu.com_ubuntu_dists_hardy-security_multiverse_binary-i386_Packages 0 :
'http://security.ubuntu.com/ubuntu/dists/hardy-security/restricted/source/Sources.bz2' security.ubuntu.com_ubuntu_dists_hardy-security_restricted_source_Sources 0 :
'http://security.ubuntu.com/ubuntu/dists/hardy-security/main/source/Sources.bz2' security.ubuntu.com_ubuntu_dists_hardy-security_main_source_Sources 0 :
'http://security.ubuntu.com/ubuntu/dists/hardy-security/universe/source/Sources.bz2' security.ubuntu.com_ubuntu_dists_hardy-security_universe_source_Sources 0 :
'http://security.ubuntu.com/ubuntu/dists/hardy-security/Release' security.ubuntu.com_ubuntu_dists_hardy-security_Release 0 
'http://security.ubuntu.com/ubuntu/dists/hardy-security/Release.gpg' security.ubuntu.com_ubuntu_dists_hardy-security_Release.gpg 0 
'http://security.ubuntu.com/ubuntu/dists/hardy-security/restricted/i18n/Translation-en_US.bz2' security.ubuntu.com_ubuntu_dists_hardy-security_restricted_i18n_Translation-en%5fUS 0 :
'http://security.ubuntu.com/ubuntu/dists/hardy-security/main/i18n/Translation-en_US.bz2' security.ubuntu.com_ubuntu_dists_hardy-security_main_i18n_Translation-en%5fUS 0 :
'http://security.ubuntu.com/ubuntu/dists/hardy-security/universe/i18n/Translation-en_US.bz2' security.ubuntu.com_ubuntu_dists_hardy-security_universe_i18n_Translation-en%5fUS 0 :
'http://security.ubuntu.com/ubuntu/dists/hardy-security/multiverse/i18n/Translation-en_US.bz2' security.ubuntu.com_ubuntu_dists_hardy-security_multiverse_i18n_Translation-en%5fUS 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy/main/binary-i386/Packages.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy_main_binary-i386_Packages 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy/universe/binary-i386/Packages.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy_universe_binary-i386_Packages 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy/multiverse/binary-i386/Packages.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy_multiverse_binary-i386_Packages 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy/main/source/Sources.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy_main_source_Sources 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy/universe/source/Sources.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy_universe_source_Sources 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy/Release' ftp.linux.org.tr_pub_ubuntu_dists_hardy_Release 0 
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy/Release.gpg' ftp.linux.org.tr_pub_ubuntu_dists_hardy_Release.gpg 0 
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy/main/i18n/Translation-en_US.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy_main_i18n_Translation-en%5fUS 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy/universe/i18n/Translation-en_US.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy_universe_i18n_Translation-en%5fUS 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy/multiverse/i18n/Translation-en_US.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy_multiverse_i18n_Translation-en%5fUS 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy-updates/restricted/binary-i386/Packages.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy-updates_restricted_binary-i386_Packages 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy-updates/main/binary-i386/Packages.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy-updates_main_binary-i386_Packages 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy-updates/universe/binary-i386/Packages.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy-updates_universe_binary-i386_Packages 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy-updates/multiverse/binary-i386/Packages.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy-updates_multiverse_binary-i386_Packages 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy-updates/restricted/source/Sources.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy-updates_restricted_source_Sources 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy-updates/main/source/Sources.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy-updates_main_source_Sources 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy-updates/universe/source/Sources.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy-updates_universe_source_Sources 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy-updates/Release' ftp.linux.org.tr_pub_ubuntu_dists_hardy-updates_Release 0 
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy-updates/Release.gpg' ftp.linux.org.tr_pub_ubuntu_dists_hardy-updates_Release.gpg 0 
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy-updates/restricted/i18n/Translation-en_US.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy-updates_restricted_i18n_Translation-en%5fUS 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy-updates/main/i18n/Translation-en_US.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy-updates_main_i18n_Translation-en%5fUS 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy-updates/universe/i18n/Translation-en_US.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy-updates_universe_i18n_Translation-en%5fUS 0 :
'ftp://ftp.linux.org.tr/pub/ubuntu/dists/hardy-updates/multiverse/i18n/Translation-en_US.bz2' ftp.linux.org.tr_pub_ubuntu_dists_hardy-updates_multiverse_i18n_Translation-en%5fUS 0 :

It seems like the command shows the files needed and the names they should stored by.

after downloading these files should I rename them manually, or there is better way to do it.
and what should I do with *.gpg files again.
 
Old 07-28-2008, 03:35 PM   #4
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
The method described does this:
- it creates a file "wget-script" - it contains all the adresses of all the files which need to be downloaded
You save this file to a usb-drive for example and then take to a machine with good internet connection.
- there you use that file to fetch all the packages (using "wget") sh -x ./wget-script
- you then bring the drive back home - and use the directory on the usb-drive to which you saved all these files as the archive for apt to do the update

You still have to "sync" (update the list of newly available packages on your machine - but just the update of the _list_) This does not use much bandwidth
- whereas the download of all these packages will require a lot of time on a slow connection and use quite a lot of bandwidth.
This approach is ideal for situations where you have only a limited amount of traffic per month available - or where the connection is slow.

I have done this all the time when I had only a 56k modem connection - I took the file on a usb-drive to the computer-pool of my university, downloaded, and made the upgrade using this at home.

If this is not what you actually asked for ... I misunderstood you completely.

Last edited by jomen; 07-28-2008 at 03:40 PM.
 
Old 07-28-2008, 04:34 PM   #5
uaa
LQ Newbie
 
Registered: Apr 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Thank you I do the same as you used to do. because I've dial up connection, but using Synaptic package manger when you only download the lists, mark updates or program then Generate download scrip.
it's all automatic.

Now I need to update the list without having internet at all for some other people. I know I can copy what inside the folder /var/lib/apt/lists
but I don't prefer it.

like I said earlier I want the update command to use the files I download instead of internet.

Thanks any way
 
Old 07-28-2008, 04:58 PM   #6
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
If /var/lib/apt/lists is the one and only file which holds the info on the newest/all available packages - IF you know that to be the case...
- then why not go that way and transfer this file to the others?
With the updated/current list of packages they too could use the same procedure (I suppose).
You could then also make them to use the files you downloaded. If they have no internet connection the only files available to them would be the files you provide.
You could also edit the file (apt sources list?) which defines which sources are to be used to do any upgrade - similar to specifying a CD as an install source - and remove all other sources.
 
Old 07-28-2008, 10:02 PM   #7
uaa
LQ Newbie
 
Registered: Apr 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Thought /var/lib/apt/lists/ is a directory what you said is still true. I can transfer it to others.
But when working on forums it's hard to do it. and there come the architecture of the packages i386 and AMD64 problems.

What I really need is an apt expert. or a script that will put the files I donwloaded for update lists in their respective palaces.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
offline upgrade/install package b r sarkar Linux - Newbie 1 03-05-2008 07:20 AM
repository for offline update seuchato SUSE / openSUSE 1 08-05-2006 06:26 AM
where do i get the package lists for various versions of redhat linux voodowizard Linux - Newbie 2 08-24-2005 12:50 AM
Installing DEB package offline CircuitSix Linux - Software 1 05-02-2005 07:18 PM
offline update RedHat 9 forumuser7 Red Hat 5 08-23-2004 02:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration