LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-07-2020, 04:42 AM   #1
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Kubuntu 20.04 on workstation, CentOS 6.x on servers
Posts: 1,180

Rep: Reputation: 47
How to create a custom automated install with specific list of packages?


I want to create a custom unattended install so that when I setup a system I can automate all the base install stuff I would normally do on a new system like copy custom utility scripts that I use, set aliases etc and also have specific packages installed by default. So I can add any custom packages, settings and so on. there's a few tutorials such as this one:

https://wiki.debian.org/DebianInstaller/Preseed

and this one:

https://wiki.debian.org/DebianCustom...2C_Binary_Only

That compliment each other.


But one thing I want to be able to do is to specify the list of packages I want to be installed automaticly, none of these tutorials seem to really explain those details or there are weird quircks, like not including packages already installed on the prototype system.

Essentially what I want to do is that whatever packages are on the prototype system, also end up on the custom CD and become part of the install, including dependencies.

So if I later realize I want another package as part of the CD I can go on the prototype system, apt-get install it, then run my script to regenerate the CD.

Also, I would like it to include the updated packages, so if I do apt-get upgrade on the prototype PC it would include the newer versions on the CD.

How would I go about doing that?

I want to upgrade all my servers to a newer OS as they are out of date so I figure before I do that I want to make this custom installer just to streamline everything and also have a more consistent install throughout. I eventually want to make my own custom server distro (basically just Debian or another distro that has my own custom front end on it so nothing crazy) and this knowledge will come in handy for that.

Last edited by Red Squirrel; 05-07-2020 at 04:44 AM.
 
Old 05-08-2020, 06:25 AM   #2
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,330

Rep: Reputation: 1431Reputation: 1431Reputation: 1431Reputation: 1431Reputation: 1431Reputation: 1431Reputation: 1431Reputation: 1431Reputation: 1431Reputation: 1431
I have not used it myself, but it reads to me like you need "respin" or something very like it.
 
Old 05-08-2020, 06:43 AM   #3
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,348

Rep: Reputation: 363Reputation: 363Reputation: 363Reputation: 363
Hi

I've done this a bit more "manually", by using dpkg --get-selections and dpkg --set-selections. But it shouldn't be difficult to do in a script.

The list is a simple text file, so you can edit it if you want.

Simple guide here:

https://www.cyberciti.biz/tips/linux...n-restore.html
 
Old 05-08-2020, 09:15 PM   #4
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Kubuntu 20.04 on workstation, CentOS 6.x on servers
Posts: 1,180

Original Poster
Rep: Reputation: 47
That could potentially work, does that command pickup all the dependencies too? I could write a script then have it generate the entries in the preseed file, as I think there is an option in there to specify packages to be installed.

So yeah I'll have to experiment. If apt-move does what I think it does, I should be able to put the physical packages on the image as well. Once I have it all set it should just be the thing of updating the staging OS then rerunning the script to create a new ISO with updated packages.

There's lot of stuff like respin etc but it seems lot of those are obsolete or not being updated anymore so I think I'm better off doing it a bit more manually... and it's a bit of a learning experience at same time to understand a little how the install process works.
 
Old 05-09-2020, 01:16 AM   #5
andre@home
Member
 
Registered: Oct 2003
Distribution: 2x Debian 8.1 webdav servers
Posts: 83

Rep: Reputation: 40
How many extra packages are we talking above the basic install of a Debian server?
Like 5 or 10 or 100?
Then consider how much you gain in whatever you wanna do.
Maybe I'm not correct, please then describe in more detail what yo wanna do.

When I wanna install a new server, I generally save my config files e.g. fstab & for Apache/WebDav, but for the rest I prefer a fresh install to be sure that I get the latest config files / packages whilst there are no remainders old installations that I need maybe to worry about.
Then I compare the new config files with the old one and learn what the improvements are and add that part that is essential to the new one to make at work I was used too in the old one.
When I need to reinstall another Debian server, I exactly know what to do and the installation and setup take very little time. The data disks are automatically mounted via the fstab file info and are coupled as webdav locations in de default-ssl config file under Apache2, so I need to take over that info too.

When I'm ready I make images of all server instillation on spare (boot) disks, so when there is a problem with one of the servers it is on-line in a few minutes again.
My main user is my son, a professional documentary photographer, he knows how to switch off the server, replace the problem boot disk with the backup/spare boot disk ...and switch the server on ... and continue to do his work...
We have 2 identical servers, on 2 different physical locations, both based upon the same Debian version, both have spare imaged boot disk.

I'm now in the phase to do experiments in a Virtual Machine (VM) to test Debian Buster, as this summer Debian 8 Jesse is running out of its LTS.
VM's are great for such experiments.... test installation and configuration files.....

Last edited by andre@home; 05-09-2020 at 01:18 AM.
 
Old 05-09-2020, 02:15 AM   #6
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 4,824
Blog Entries: 3

Rep: Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398
It's been more than a few years so things may have changed but when I was doing this kind of thing, I modified the preseed as little as possible and had one main shell script to run instead which managed most of the customization. It was run on first boot, though, if I recall correctly, I might have had another much shorter one which ran during the actual installation.

If you're doing a lot of testing and the LAN is much faster than your Internet connection, be sure to set up Apt-Cacher, Apt-Cacher-NG, or at least Squid (with very large caches) on another local machine and have use of the proxy be part of the preseed customization. You can comment that out later when you put things into production if the situation calls for it, but it has the potential to save lots of time and bandwidth during development and testing.
 
Old 05-10-2020, 01:24 AM   #7
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Kubuntu 20.04 on workstation, CentOS 6.x on servers
Posts: 1,180

Original Poster
Rep: Reputation: 47
There's not lot of packages off the top of my head but every time I do a new install there's always certain packages and things I need to do that come up. For example installing vim and sudo. There's also this weird thing Debian vim does where you can't right click and you need to modify a config file, so I want to get rid of that too. In fact another thing I realize is there may be packages I want to uninstall, as there are weird stuff with networking I have not looked at fully yet, but it seems something keeps overwriting my static IP. Or adding certain aliases by default in skel etc. I want to automate all of those little things as they add up.

Basically all little annoying "first boot" setup things like that I want to just be part of the image. I also want it to be offline since there could potentially be systems I want to install it on that won't be online. Basically once I have this setup, all my machines will be standardized to this same install, just to streamline everything.

Last edited by Red Squirrel; 05-10-2020 at 01:26 AM.
 
Old 05-10-2020, 12:58 PM   #8
andre@home
Member
 
Registered: Oct 2003
Distribution: 2x Debian 8.1 webdav servers
Posts: 83

Rep: Reputation: 40
Nowadays I keep track of my bash history, back it up in time... so it tells me exactly what to do, similar purpose just a few things...
Putting it back.. takes a few minutes to do the jobs...
Installation complete?
Using GFL I make an image of my boot disk.
Ready...
A problem... change the boot disk and after a few minutes the server is online again...
Just some thoughts...

Succes!
 
Old 05-11-2020, 01:58 AM   #9
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 14,512
Blog Entries: 9

Rep: Reputation: 4038Reputation: 4038Reputation: 4038Reputation: 4038Reputation: 4038Reputation: 4038Reputation: 4038Reputation: 4038Reputation: 4038Reputation: 4038Reputation: 4038
Quote:
Originally Posted by Red Squirrel View Post
There's not lot of packages off the top of my head but every time I do a new install there's always certain packages and things I need to do that come up. For example installing vim and sudo. There's also this weird thing Debian vim does where you can't right click and you need to modify a config file, so I want to get rid of that too. In fact another thing I realize is there may be packages I want to uninstall, as there are weird stuff with networking I have not looked at fully yet, but it seems something keeps overwriting my static IP. Or adding certain aliases by default in skel etc. I want to automate all of those little things as they add up.

Basically all little annoying "first boot" setup things like that I want to just be part of the image. I also want it to be offline since there could potentially be systems I want to install it on that won't be online. Basically once I have this setup, all my machines will be standardized to this same install, just to streamline everything.
First of all, there's various search phrases to aid you. I went with linux how to automate system set up after installation. Looks like kickstarter is one option.

Then, it's always better to install a system that does not install bloat by default, instead of later removing stuff.
So basically you are looking at creating your own respin (I showed you how to search Linux stuff, I'm sureyou can apply it to this keyword, too).
BTW, if we're talking Debian, various approved spins already exist (although they're hard to find on Debians site) and last time I looked sudo was already set up after install.

But lastly I wonder why you need to install so many clearly personal systems (vim quirks etc.) so often.
 
Old 05-14-2020, 01:31 AM   #10
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Kubuntu 20.04 on workstation, CentOS 6.x on servers
Posts: 1,180

Original Poster
Rep: Reputation: 47
Quote:
Originally Posted by ondoho View Post
But lastly I wonder why you need to install so many clearly personal systems (vim quirks etc.) so often.
I'm just trying to save myself work. I'm due to upgrade pretty much all my servers so figured I would streamline all the repetitious tasks.

I also eventually want to make my own software for web hosting (kinda like cpanel) that will automate all the config like mailboxes, virtual hosts dns etc.... and it's easier to just integrate it into a distro than to try to deal with the billion different versions of config file syntax that changes across all distros (ex: apache and such) so eventually will want to apply this knowledge when I make that particular installer which would be basically a preseed install that installs all the prerequisites and then runs my custom script at the end to copy all the appropriate files in their place.

Given there are some spins I'm just surprised this is not info that is more easily obtainable. For example Debian based distros like Ubuntu. How did they go about creating their installs?

Last edited by Red Squirrel; 05-14-2020 at 01:33 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
In if test the list contains only one specific string or multiple same specific string Mike_Brown Linux - Newbie 1 01-27-2016 10:52 PM
[SOLVED] How to install group packages in the list of the installed group packages at once chid9202 Linux - General 1 03-17-2015 09:13 PM
list packages from specific repository? h725 Debian 6 04-15-2010 02:39 AM
how to save a list of installed packages and install these packages later mandavi Ubuntu 5 09-07-2009 11:36 AM
Problem with packages - local list doesn't list all packages from a mirror simopal6 Debian 2 09-01-2008 04:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 11:24 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration