LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   offline update package lists in Ubuntu (https://www.linuxquestions.org/questions/linux-software-2/offline-update-package-lists-in-ubuntu-658508/)

uaa 07-27-2008 02:24 AM

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

jomen 07-28-2008 11:25 AM

http://batmat.net/apt-offline/ch3.html

HTH

uaa 07-28-2008 01:51 PM

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.

jomen 07-28-2008 03:35 PM

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.

uaa 07-28-2008 04:34 PM

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

jomen 07-28-2008 04:58 PM

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.

uaa 07-28-2008 10:02 PM

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.


All times are GMT -5. The time now is 04:38 AM.