Download and install linux kernel on offline machine
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Download and install linux kernel on offline machine
Any hints on how to do that? I want to write 2 scripts - one for downloading it on an online machine, the other one is for installing it on the target offline computer.
Does the kernel come as another .deb package by any chance? That would dramatically simplify the workflow for me, but I cannot find where it is or its name.
Many thanks!
Does the kernel come as another .deb package by any chance? That would dramatically simplify the workflow for me, but I cannot find where it is or its name.
Many thanks!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Download and install linux kernel on offline machine
If you do it before applying a kernel update on your online machine, you can just :
Code: Select all
$ apt download linux-generic
Get:1 linux-headers-generic_4.15.0.72.74_amd64.deb [2348 B]
Fetched 2348 B in 0s (0 B/s)
Get:1 linux-modules-4.15.0-72-generic_4.15.0-72.81_amd64.deb [13.0 MB]
Fetched 13.0 MB in 0s (0 B/s)
Get:1 linux-headers-4.15.0-72-generic_4.15.0-72.81_amd64.deb [1107 kB]
Fetched 1107 kB in 0s (0 B/s)
Get:1 linux-image-generic_4.15.0.72.74_amd64.deb [2392 B]
Fetched 2392 B in 0s (0 B/s)
Get:1 linux-headers-4.15.0-72_4.15.0-72.81_all.deb [10.9 MB]
Fetched 10.9 MB in 0s (0 B/s)
Get:1 amd64-microcode_3.20191021.1+really3.20181128.1~ubuntu0.18.04.1_amd64.deb [31.6 kB]
Fetched 31.6 kB in 0s (0 B/s)
Get:1 intel-microcode_3.20191115.1ubuntu0.18.04.2_amd64.deb [2407 kB]
Fetched 2407 kB in 0s (0 B/s)
Get:1 linux-image-4.15.0-72-generic_4.15.0-72.81_amd64.deb [7991 kB]
Fetched 7991 kB in 0s (0 B/s)
Get:1 linux-generic_4.15.0.72.74_amd64.deb [1868 B]
Fetched 1868 B in 0s (0 B/s)
Get:1 linux-modules-extra-4.15.0-72-generic_4.15.0-72.81_amd64.deb [32.7 MB]
Fetched 32.7 MB in 6s (3934 kB/s)
All the packages necessary for offline installation of
linux-generic
were downloaded to the current directory into the archive:
linux-generic_4.15.0.72.74.tar.gz
Extract into a folder and run the extracted install.sh to install.
If you want to do it after you installed the update to your online machine, then the packages shown above are what you will need to download, you can individually
apt download
each one of them (the package names are what's before the first _
in each file name in the list above).Re: Download and install linux kernel on offline machine
Great, fantastic thank you gm10, I ended up doing something very close to that. For the record:
1. to get packages to the local repo transferable to the offline machine:
2. to install the kernel update offline
1. to get packages to the local repo transferable to the offline machine:
Code: Select all
# List of kernel packages
declare -a kernelUpdatesList=("amd64-microcode" "intel-microcode" "iucode-tool" \
"linux-headers-generic" "linux-image-generic" "linux-generic")
patchesLM=$(mintupdate-cli -k list)
if [ -n "$patchesLM" ]; then
echo "WARNING!!!! Found a new linux kernel update:"
echo "$patchesLM"
for i in "${kernelUpdatesList[@]}"; do
echo "Processing <$i>:"
apt-get download $(apt-cache depends --recurse --no-recommends \
--no-suggests --no-conflicts --no-breaks --no-replaces \
--no-enhances $i | grep "^\w" | sort -u | grep -v i386)
done
else
echo "No additional kernel security patches found."
fi
2. to install the kernel update offline
Code: Select all
source ./conf/imaging.properties
# List of kernel packages
declare -a kernelUpdatesList=("amd64-microcode" "intel-microcode" "iucode-tool" \
"linux-headers-generic" "linux-image-generic" "linux-generic")
# copying kernel update files from data repo to apt repo
source ./lib/utils/f_copy-files-to-linux-apt-repo.sh "/your/location/"
# Refreshing apt-index
source ./lib/utils/f_add-system-repo-to-apt-index.sh
for i in "${kernelUpdatesList[@]}"; do
echo "Processing <$i>:"
sudo apt-get -y install $i
done
Re: Download and install linux kernel on offline machine
This is so weird, I have just installed Mint 19.3 with the 5.0.0-32-generic kernel as shown by the
Has something changed in v19.3 or am I doing something wrong???
uname -r command
. The Update Manager requires version 5.3.0.28 for upgrading, however when I run the following, all I get is files for version 4.15.0-76. Has something changed in v19.3 or am I doing something wrong???
gm10 wrote: ⤴Sun Dec 22, 2019 4:47 am If you do it before applying a kernel update on your online machine, you can just :
Code: Select all
$ apt download linux-generic ... [cut] [/quote]
Re: Download and install linux kernel on offline machine
The command I gave was for the LTS kernel series (4.15). If you want the HWE kernel series (currently 5.3), the command would be
Code: Select all
apt download linux-generic-hwe-18.04
Re: Download and install linux kernel on offline machine
If your machine was manufactured before 1-1-2018, you should definitely use the LTS kernel package (4.15). Mint Linux is no longer "based on ubuntu 18.04 LTS" because they removed the LTS core. So far, I have the LTS core reinstalled and running on my older hardware, and I'm having fewer issues (and avoiding issues others are reporting) with the LTS core (both the kernel and the xserver) installed.afora wrote: ⤴Mon Feb 03, 2020 3:14 am This is so weird, I have just installed Mint 19.3 with the 5.0.0-32-generic kernel as shown by theuname -r command
. The Update Manager requires version 5.3.0.28 for upgrading, however when I run the following, all I get is files for version 4.15.0-76.
Has something changed in v19.3 or am I doing something wrong???
In short, if your system worked well with Linux Mint 19.2 and with the LTS kernel, installing "linux-generic" will put you back on the most stable LTS kernels. It's also a good idea to remove the kernel package from linux mint repos if you want the LTS kernels. I think it was "linux-kernel-generic" or something like that. You can find it with
apt list --installed linux*|grep linuxmint
. If your hardware is newer than that, and your hardware won't run, can't boot or runs crippled with the LTS kernel, you can use the hwe kernel package that gm10 mentioned. Again, I'd use the ubuntu hwe kernel package and remove the linuxmint repo package if you want to stay up to date.
Warning: The hwe kernels are less stable than the LTS kernels. They are also only supported for 6 months. In August, 5.3 will be unsupported and the next version (5.5?) will become the hwe kernel, with more opportunities for compatibility issues for older hardware. You're more likely to have issues on the hwe kernel package than on the LTS kernel package. I would only recommend the hwe kernel package if your hardware doesn't run the LTS kernels.
Re: Download and install linux kernel on offline machine
Thank you gm10! Is there a generalised version of the command that can survive the upgrade up from ubuntu 18.04 (LM 19)?
Thanks Racer, that's half a day worth of background reading for somebody completely new to linux, packed in a few sentences! To be honest my amateur-desktop-user-of-linux impression (and yes I have a compsci degree in the previous life) of this change (in ubuntu? in LM?) is to confuse the hell out of me. This also breaks a few scripts that I have written previously. I guess welcome to linux, eh? I have a funny sensation that this is not the worst I have to brace myself against in the future.
Code: Select all
apt download linux-generic-hwe-18.04
- Pjotr
- Level 24
- Posts: 20129
- Joined: Mon Mar 07, 2011 10:18 am
- Location: The Netherlands (Holland) 🇳🇱
- Contact:
Re: Download and install linux kernel on offline machine
Incorrect. The latest point releases of Ubuntu 18.04 LTS also feature an HWE kernel by default.
Incorrect. There is probably no meaningful difference in stability; only in maintenance period.
The main reason why an LTS kernel is preferable, is because you'll never need to make a kernel version jump. Like you have to do with the short-lived HWE kernels, when maintenance ends. Such jumps can be "bumpy".
For the record: this is a how-to for installing a kernel on an offline machine:
https://easylinuxtipsproject.blogspot.c ... .html#ID22
Last edited by Pjotr on Mon Feb 03, 2020 6:10 pm, edited 2 times in total.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Re: Download and install linux kernel on offline machine
Thanks Pjotr,
Well, I am after a solution that I can script for automated execution. Hence on my end, changing the kernel version numbers manually is not going to work. Is there anything more generalized?
From the link:
Well, I am after a solution that I can script for automated execution. Hence on my end, changing the kernel version numbers manually is not going to work. Is there anything more generalized?
From the link:
For example, in order to install kernel 5.3.0-23 (64-bit) in an offline Linux Mint 19.3 or Ubuntu 18.04.3, you download the following three packages (they're mentioned in the installation order):
http://nl.archive.ubuntu.com/ubuntu/poo ... _amd64.deb
http://nl.archive.ubuntu.com/ubuntu/poo ... _amd64.deb
http://nl.archive.ubuntu.com/ubuntu/poo ... _amd64.deb
Re: Download and install linux kernel on offline machine
I'm not sure what your motivations are here, but that statement is provably false. Paste this block of commands into a terminal window and then paste the results back here in "code".."/code" tags please. You'll see that I'm correct. The latest point release of Ubuntu Desktop boots the LTS 4.15.0 kernel.
Code: Select all
cd ~/Downloads;\
[ -f ubuntu-18.04.3-desktop-amd64.iso ] && mv ubuntu-18.04.3-desktop-amd64.iso ubuntu-18.04.3-desktop-amd64.iso.save;\
sudo mkdir /media/ubuntu-18.04.3-desktop;\
wget 'http://releases.ubuntu.com/18.04.3/ubuntu-18.04.3-desktop-amd64.iso'&&
sudo mount -t iso9660 -o loop ubuntu-18.04.3-desktop-amd64.iso /media/ubuntu-18.04.3-desktop&&
sudo file /media/ubuntu-18.04.3-desktop/casper/vmlinuz
I don't know the origins of this provably false statement, but it's often repeated in the Linux Mint community. Repeating it over and over doesn't ever make it true, though. Here's the truth:
On Ubuntu, LTS releases always get LTS kernels (and LTS xservers).
Ubuntu has never released a desktop LTS ISO that didn't boot a LTS kernel. And every Ubuntu LTS ISO has installed LTS components. They might install the "next generation" LTS components from the next LTS release, and those next generation components might come from a "hwe" package. But the components on the ISO are always some LTS version, never a short support true "hwe" package.
For example, if you were to check the 16.04.6 release, you'll find that it also has the 4.15.0 LTS kernel, and it gets that from the kernel-generic-hwe-16.04 package which locks to the LTS kernel that was used in the 18.04.1 LTS release. When we get 18.04.4 or 18.04.5, it should lock the linux*hwe-18.04 packages on the LTS kernel from the 20.04.1 LTS release. At that point, Ubuntu will be distributing ISOs with a newer LTS kernel through the hwe package, but it will still be a LTS kernel (and LTS xserver) I'm fairly certain that Ubuntu won't release an ISO for 18.04 that doesn't have LTS components. They haven't ever done that in the past that I can remember.
One other thing, when you have a stable, running Ubuntu system, it never pushes you onto the hwe packages. If you installed from 16.04.3 for example, and stayed with 16.04 and are still running it, it would not have upgraded you to the hwe-16.04 packages. You will still be running the previous LTS kernel. I don't feel like downloading that ISO, and I don't remember what kernel version we had back then. You wouldn't get a new LTS kernel on 16.04 unless you ask for it, or unless you ask for an upgrade to 18.04.1 or higher, and it won't push a LTS upgrade until the *.1 release. If you are running 18.04 now, the ubuntu update manager won't even offer an upgrade until August or so when 20.04.1 comes out. If you try to upgrade to 20.04 in April or May, the update manager will tell you you can't. The only way to force it to upgrade early is to turn on the non-LTS release upgrades, and then you'll get 20.04 as early as April or May when the 20.04 release comes up, but you'll also get 20.10 in October when that comes out because you've gone off the LTS upgrade path and onto the standard release path.
The highlighted portions are contradictory. Maybe "unstable" was a poor choice of word for me, but when the first 5.3 kernel came through and broke one of my systems (the one with nvidia graphics), I considered that an "unstable environment."Pjotr wrote: ⤴Mon Feb 03, 2020 5:54 pmIncorrect. There is probably no meaningful difference in stability; only in maintenance period.
The main reason why an LTS kernel is preferable, is because you'll never need to make a kernel version jump. Like you have to do with the short-lived HWE kernels, when maintenance ends. Such jumps can be "bumpy".
For the record: this is a how-to for installing a kernel on an offline machine:
https://easylinuxtipsproject.blogspot.c ... .html#ID22
- Pjotr
- Level 24
- Posts: 20129
- Joined: Mon Mar 07, 2011 10:18 am
- Location: The Netherlands (Holland) 🇳🇱
- Contact:
Re: Download and install linux kernel on offline machine
Sorry, but that's manifestly incorrect. I could have used an even stronger word, but it's a sunny morning and life is good.Racer-X- wrote: ⤴Mon Feb 03, 2020 10:46 pmI'm not sure what your motivations are here, but that statement is provably false. Paste this block of commands into a terminal window and then paste the results back here in "code".."/code" tags please. You'll see that I'm correct. The latest point release of Ubuntu Desktop boots the LTS 4.15.0 kernel.I'll post my results back in an hour or two. I'm on a slow link. Also, I hope I don't have any typos in the mount and file commands, but you get the gist of what I'm doing there. Do a "file" on the boot kernel, vmlinuz, in the /casper directory inside the ISO.Code: Select all
cd ~/Downloads;\ [ -f ubuntu-18.04.3-desktop-amd64.iso ] && mv ubuntu-18.04.3-desktop-amd64.iso ubuntu-18.04.3-desktop-amd64.iso.save;\ sudo mkdir /media/ubuntu-18.04.3-desktop;\ wget 'http://releases.ubuntu.com/18.04.3/ubuntu-18.04.3-desktop-amd64.iso'&& sudo mount -t iso9660 -o loop ubuntu-18.04.3-desktop-amd64.iso /media/ubuntu-18.04.3-desktop&& sudo file /media/ubuntu-18.04.3-desktop/casper/vmlinuz
I don't know the origins of this provably false statement, but it's often repeated in the Linux Mint community. Repeating it over and over doesn't ever make it true, though. Here's the truth:
On Ubuntu, LTS releases always get LTS kernels (and LTS xservers).
Ubuntu has never released a desktop LTS ISO that didn't boot a LTS kernel. And every Ubuntu LTS ISO has installed LTS components. They might install the "next generation" LTS components from the next LTS release, and those next generation components might come from a "hwe" package. But the components on the ISO are always some LTS version, never a short support true "hwe" package.
Just boot from a fresh installation of Ubuntu 18.04.3, and you'll find it runs on the 5.0.x kernel. Or even easier: create a bootable DVD / USB stick with the 18.04.3 iso and boot into a live session for that check.
uname -r
will tell you all you need to know.The official release notes of Ubuntu 18.04.3 would have told you this as well, by the way:
https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes
Key quote (under the header "Updated Packages":
"Ubuntu 18.04.3 ships with a v5.0 based Linux kernel"
In a couple of days Canonical will release the fourth point release: Ubuntu 18.04.4. I haven't checked yet, but I expect that it'll run by default on the 5.3.x kernel.
Having a newer default kernel is the most important feature of these point releases. It's their major "raison d'être" (reason of existence). Because it means you can do a fresh installation of Ubuntu 18.04 LTS even on very new hardware.
No contradiction at all; please don't make a word play out of it. Generally, the HWE kernels themselves aren't less stable than the LTS kernels. It's the "jump" from one HWE kernel series to a another, newer HWE kernel series that can be bumpy. That's why it's better to stick to an older LTS kernel series, if that kernel series is OK for your hardware.Racer-X- wrote: ⤴Mon Feb 03, 2020 10:46 pmThe highlighted portions are contradictory. Maybe "unstable" was a poor choice of word for me, but when the first 5.3 kernel came through and broke one of my systems (the one with nvidia graphics), I considered that an "unstable environment."Pjotr wrote: ⤴Mon Feb 03, 2020 5:54 pm Incorrect. There is probably no meaningful difference in stability; only in maintenance period.
The main reason why an LTS kernel is preferable, is because you'll never need to make a kernel version jump. Like you have to do with the short-lived HWE kernels, when maintenance ends. Such jumps can be "bumpy".
For the record: this is a how-to for installing a kernel on an offline machine:
https://easylinuxtipsproject.blogspot.c ... .html#ID22
Finally I may add that your bad experience with one particular HWE kernel, doesn't mean that HWE kernels generally are of lesser quality. In my experience, and I've been a fulltime Ubuntu / Mint user since 2006 (Ubuntu until 11.04, then Xubuntu, then Mint), the quality of HWE kernels is generally identical to the quality of LTS kernels.
Bonus information: the HWE jumps are "only" a temporary nuisance. If you currently have a machine running on the 5.3 kernel series: when the 5.3 series reaches EOL, you can expect to be offered an upgrade to a newer kernel series that'll be LTS again. Probably the 5.4.x.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
- Pjotr
- Level 24
- Posts: 20129
- Joined: Mon Mar 07, 2011 10:18 am
- Location: The Netherlands (Holland) 🇳🇱
- Contact:
Re: Download and install linux kernel on offline machine
It would be nice to have the 5.5 or newer, but several sources contradict each other:
5.4:
https://itsfoss.com/ubuntu-20-04-release-features/
https://fossbytes.com/ubuntu-20-04-lts- ... -features/
5.5 or newer:
https://www.omgubuntu.co.uk/2019/10/ubu ... e-features
Do you perhaps have a link to the source that rules them all?
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Re: Download and install linux kernel on offline machine
No, I am my own source in this case, with knowledge about how Canonical operates. Unless they run into trouble with a specific series, the LTS version will be whatever latest series they've got working and tested by the time they freeze the repo, so basically whatever they're working on mid to late March. That will either be a late 5.5 or an early 5.6 - by the time 20.04 releases the kernel.org stable series will be 5.6.
- Pjotr
- Level 24
- Posts: 20129
- Joined: Mon Mar 07, 2011 10:18 am
- Location: The Netherlands (Holland) 🇳🇱
- Contact:
Re: Download and install linux kernel on offline machine
Alright, thanks. I hereby accept you as the source that rules them all.gm10 wrote: ⤴Wed Feb 05, 2020 8:15 amNo, I am my own source in this case, with knowledge about how Canonical operates. Unless they run into trouble with a specific series, the LTS version will be whatever latest series they've got working and tested by the time they freeze the repo, so basically whatever they're working on mid to late March. That will either be a late 5.5 or an early 5.6 - by the time 20.04 releases the kernel.org stable series will be 5.6.
I'm looking forward to meeting the Kleptomaniac Octopus:
https://www.phoronix.com/scan.php?page= ... 5-Released
For the enlightenment of the casual reader of this thread: the LTS kernel of the upcoming Ubuntu 20.04, will double as the final kernel series upgrade for Ubuntu 18.04.3 and for Linux Mint 19.3, both of which were released with a short-lived HWE kernel. Doubtlessly for the sake of efficiency.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Re: Download and install linux kernel on offline machine
I'm bumping this question up as the technical problem was a bit buried in the above discussion I cannot add much to. Here you go:
Thank you gm10! Is there a generalised version of the command that can survive the upgrade up from ubuntu 18.04 (LM 19)?
Thank you gm10! Is there a generalised version of the command that can survive the upgrade up from ubuntu 18.04 (LM 19)?
Code: Select all
apt download linux-generic-hwe-18.04
Re: Download and install linux kernel on offline machine
Upgrade to what? LM 20? There you'd go back to the initial version I posted:afora wrote: ⤴Wed Feb 05, 2020 10:56 pm I'm bumping this question up as the technical problem was a bit buried in the above discussion I cannot add much to. Here you go:
Thank you gm10! Is there a generalised version of the command that can survive the upgrade up from ubuntu 18.04 (LM 19)?
Code: Select all
apt download linux-generic-hwe-18.04
Code: Select all
apt download linux-generic
Re: Download and install linux kernel on offline machine
upgrade from, I presume judging from the package name, the 18.04 HWE kernel, to the next Ubuntu version. Again, I presume it's going to be 20? or 18.05?
I am happy with the HWE kernel, I would rather not touch the script every time there's a new Ubuntu upgrade. Something similar for the LTE name without a number woudl be great. Just like the one you are quoting above
I am happy with the HWE kernel, I would rather not touch the script every time there's a new Ubuntu upgrade. Something similar for the LTE name without a number woudl be great. Just like the one you are quoting above
Re: Download and install linux kernel on offline machine
That does not exist. Also it's not like these upgrades to the next major release happen automatically. Unless you install Linux Mint 20 to those offline machines next year they will stay on LM 19, which remains supported until 2023.