Updating (-Syu) while offline?

With a fresh install, I sudo pacman -Syu and then I copied all the files it downloaded to /var/cache/pacman/pkg into a usb. Then I reformatted the USB SSD and re-installed Manjaro. Without connecting to the internet, I opened the Terminal to the folder with all the files I saved earlier.

sudo pacman -U *.* initialized the process but couldn’t complete because of kde-plasma conflict. I forgot the message, but it has something to do with knetattach? However, when I connected to the net, and do a sudo pacman -Syu with all the files copied (from the usb) back into /var/cache/pacman/pkg Manjaro had no problem installing, it didn’t download anything new but used what was already in the cache. Exactly what I wanted, BUT is it possible to do THIS without connecting to the net?

I am not sure if the following will work (off-line), but it is worth a try:

  1. In addition to all the packages that you save and later restore on the new installation, do the same with the pacman database files in /var/lib/pacman/sync/*.db .
  2. Then, instead of sudo pacman -U *.* , try sudo pacman -Su .

I will give it a try later today with a fresh installation, and will let you know how it goes.

https://wiki.archlinux.org/index.php/Pacman/Tips_and_tricks#Installing_packages_from_a_CD/DVD_or_USB_stick

I did a sudo pacman -Syu just so I could get the updated *.db files in the /var/lib/pacman/sync/. I only copied 4 files (community.db, core.db, extra.db, multilib.db). Didn’t backup mhwd.db (there by default). Upon a fresh installation, I restored the pkg files, and put back these 4 *.db files into /var/lib/pacman/sync/ and then executed sudo pacman -Su All this without connecting to the net and the update went through. There’s a few errors because it was trying to fetch some URLs, but other than that, everything is working.

For those that might be reading this and are going through the same thing, here’s something to keep in mind and a recap:

In my case, there was no way to copy some files from the /var/cache/pacman/pkg folder to my USB. At first I didn’t understand why, then I paid careful attention to the files that couldn’t be copied and noticed that any file with a semicolon in its name can’t be copied to USB (even if it’s EXT4). But they can be copied to your Desktop or other places in the same drive that Manjaro is running on. So I did that and then zipped the folder and copied the zip file into the backup USB. The *.db files in /var/lib/pacman/sync can be copied without a problem.

Upon a fresh Manjaro installation, I copied the zip file containing all the packages (from my USB) onto the desktop. Unzipped it and then executed sudo rsync ~/Desktop/pkg/* /var/cache/pacman/pkg and then manually copied all the four *.db files and put it back into /var/lib/pacman/sync and then executed: sudo pacman -Su

Thanks Bertie for the solution.

I am happy (relieved?) that it worked. Scanning through the link provided by @freggel.doe it seems that we just scratched the surface and got away with it. I was wondering if some internet access would still be required and judging by the errors it seems to be the case. Maybe the specific URLs can give a clue to what is still missing.

Also, judging by the complicated method in the link as opposed to my simple few steps, I am now worried about your next update.

I’m currently exploring Manjaro via an external SSD. So reinstalling it is fast. No work is being done on Manjaro at the moment, but hopefully I will make a full switch to it and leave macOS by this summer.

I just installed manjaro-kde-21.0-210318-linux510, and noticed that sudo pacman -Syu didn’t do anything and stated that all system are updated. So this whole time I was on Linux 5.9, and the packages that I backup is around 1.3GB, but with this linux510, apparently it doesn’t need to download anything.

The guide posted by @freggel.doe is a little complicated. It might take a while before I fully understand the instructions in that guide. In the meantime, I guess if I really need to backup the system update, I might have to do it via Timeshift.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.