You are not logged in.

#1 2016-09-04 08:51:21

unable757
Member
Registered: 2016-04-03
Posts: 39

[Solved] Use pacman cachedir to install archlinux without internet

I am trying to install arch without internet at install time. On usb there is fat32 partition and ext4 partition. On ext4 partition, I have a directory called Packages. I tried to get all packages and install arch.

https://wiki.archlinux.org/index.php/Pa … _USB_stick

I used the same commands given

pacman -Syw base base-devel grub-bios xorg --cachedir=/root/repo/Packages
repo-add ./custom.db.tar.gz ./*

It completed successfully.

But when I used

 pacstrap /mnt base base-devel 

  it showed

warning: cannot resolve "ncurses", a dependency for "bash"
warning: cannot resolve "linux-api-headers", a dependency for "glibc"
...
...
error:failed to prepare transaction (could not satisfy dependencies)

I already have glibc. But I did not have ncurses. I had to download it separately.

How can get all the dependencies and get arch to install without internet?

I found instructions where we can clone the entire repos but that would be over kill.

Last edited by unable757 (2016-09-22 04:29:18)

Offline

#2 2016-09-07 03:19:43

Jristz
Member
From: America/Santiago
Registered: 2011-06-11
Posts: 1,048

Re: [Solved] Use pacman cachedir to install archlinux without internet

If you are using pacstrap and the host have the packages in they cache... why not use

pacstrap -c /mnt base base-devel

?


Lenovo ThinkPad L420 modified
:: Intel i7 2560QM :: 8 GB RAM :: SSD 256 GB ::
:: DVD read+Writter :: 3 USB 3.0 Expresa Card ::
:: a Favulous 1 mins lasting Io-Li battery ::cry::

Offline

#3 2016-09-07 11:51:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,432
Website

Re: [Solved] Use pacman cachedir to install archlinux without internet

You posted a link to a 3 step process and claimed to have only done the first step.  Why would you expect it to work?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2016-09-13 16:37:25

unable757
Member
Registered: 2016-04-03
Posts: 39

Re: [Solved] Use pacman cachedir to install archlinux without internet

Trilby wrote:

You posted a link to a 3 step process and claimed to have only done the first step.  Why would you expect it to work?

Sorry for that.
I did all the steps but I just wrote the first. I mounted the directory, changed pacman.conf (added the folder and removed all other repos) and updated.
I thought it was implied.


While making the repo, when I run the command

 pacman -Syw base base-devel --cachedir=/root/repo/Packages 

after Enter a selection (default=all):
I get

Enter a selection (default=all):
warning: skipping target: file
warning: skipping target: findutils
warning: skipping target: gawk
warning: skipping target: gettext
warning: skipping target: grep
warning: skipping target: gzip
warning: skipping target: pacman
warning: skipping target: sed
warning: skipping target: texinfo
warning: skipping target: util-linux
warning: skipping target: which
resolving dependencies... 

and then it continues like normal.

I guess these are the missing packages. Then I will also not have the dependencies of these packages.
Why do I get this warning and how do I get these packages and their dependencies?
When I individually try to install them, I still don't get all the dependencies

 pacman -Syw texinfo --cachedir=/root/repo/Packages 

only downloads texinfo and not ncurses which is a dependency.

Jristz wrote:

If you are using pacstrap and the host have the packages in they cache... why not use

pacstrap -c /mnt base base-devel

?

Will it not give the same error because I still don't have the packages? Does it not need them?

Offline

#5 2016-09-13 18:01:00

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved] Use pacman cachedir to install archlinux without internet

You need to specify each package you want to download separately, to make sure pacman -Sw downloads it. As for the "warning: skipping target: whatever" messages, that is because base and base-devel have several packages in common, and pacman -Sw deduplicated that.

(Honestly, I am not sure why that happens, but I am also not sure why some packages depend on things like gcc-libs in base. There is probably some sort of implicit policy among the Developers/TUs or something)

...

Then make sure that the extra CacheDir is known to pacman in the LiveUSB, and then run pacstrap with the "-c" flag (I am sure I don't need to remind you to see `pacstrap --help` wink wink).


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#6 2016-09-13 18:54:32

unable757
Member
Registered: 2016-04-03
Posts: 39

Re: [Solved] Use pacman cachedir to install archlinux without internet

Eschwartz wrote:

You need to specify each package you want to download separately, to make sure pacman -Sw downloads it.

Does this mean that I will not be able to get all the packages required to install archlinux using just the command pacman -Syw base?

Caching base and base-devel will not cache all dependencies.
After again running pacstrap, it said "xz" is required, which is not downloaded automatically.

Is there a list that gives me all the packages? Then I can make a very long pacman command to cache all required packages.

Last edited by unable757 (2016-09-13 18:56:24)

Offline

#7 2016-09-13 19:03:54

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved] Use pacman cachedir to install archlinux without internet

pacman comes with the pactree utility which can list a dependency graph of selected packages.

The following one-liner can list all the packages belonging to base and dependencies of those packages:

for i in $(pacman -Sqg base); do pactree -l $i; done 2>/dev/null|sort -u

Tweak as appropriate for your needs.

You can also list all installed packages on your system with `pacman -Qq`, in case you want to duplicate your current Arch system entirely -- in that case, you can just feed your packagelist on the current system to pacstrap on the LiveUSB.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#8 2016-09-15 12:15:06

unable757
Member
Registered: 2016-04-03
Posts: 39

Re: [Solved] Use pacman cachedir to install archlinux without internet

I cached all the packages given by

 for i in $(pacman -Sqg base); do pactree -l $i; done 2>/dev/null|sort -u 

(this lists all the packages and their dependencies in base)

After that, I created the repo, added it in pacman.conf and disabled all other repos.

Then

 pacstrap /mnt base 

gave the following

...
...
checking keyring...
checking package integrity...
Error occurred, no packages were upgraded.
error: <package>: missing required signature
...
...
error: failed to commit transaction (package missing required signature)

What can I do to get the signature?

Last edited by unable757 (2016-09-15 12:50:25)

Offline

#9 2016-09-15 18:43:54

unable757
Member
Registered: 2016-04-03
Posts: 39

Re: [Solved] Use pacman cachedir to install archlinux without internet

Ok, I set the siglevel to never.
I was able to install archlinux without internet.

This is what I did.
Create fat32 and ext4 partition on USB
Write iso to fat32 partition.
Using the usb or virtual machine, boot the iso and mount USB ext4 partition.
Use

for i in $(pacman -Sqg base); do pactree -l $i; done 2>/dev/null|sort -u > packages 

Then

sed ':a;N;$!ba;s/\n/ /g' <packages >packages.sh'

Add execute privilege to packages.sh, add 'pacman -Syw' at start and '--cachedir=<ext4 partition on usb>' at end of the file and run it.

cd to the ext4 partition on usb and create repo using

repo-add ./custom.db.tar.gz ./*' 

USB is ready to install Archlinux in computer without internet.

After booting, mount the ext4 partition to any folder and add it to cachedir option in pacman.conf.
In pacman.conf, add repo

[custom]
SigLevel = Never
Server = file:///<cache dir> 

and comment all other repos.

Use the pacstrap -c command.
It installs successfully.

If anybody has a better way to do what I am trying to do, please tell me.
Thanks.

Last edited by unable757 (2016-09-16 10:46:50)

Offline

Board footer

Powered by FluxBB