Linux post install scripts

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

My Personal Ubuntu based OS Post Install Script

License

mryujitanaka/Ubuntu-Post-Install-Script

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Ubuntu Post Install Script

My personal Ubuntu based OS post install script that I use to uninstall, install and/or update packages. 🤓 🖖

🧐 About the Project

This project was created specifically to meet my needs after installing Ubuntu based OS on my computer. However, since the script I created was so good (at least for me), I decided that it was not fair to keep it just for myself. So I thought: «why not share it with the world?».

I bet you must have already wasted a lot of time downloading all your programs again after formatting your PC, right? You need to manually download a more updated program and so on. YUCK!

No more! Automate your processes and optimize your time! Let my script do all the work for you!

🛠 Built With

🏁 Getting Started

This means that you must first run the file 1, then the file 2 and finally the file 3.

ATTENTION! Before you run the scripts on your system, especially the first one (1.Setup.sh), make sure your terminal has Unlimited Scroolback enabled. With this function enabled, you will be able to fully view the entire script output history by scrolling your terminal sidebar up.

  • Have a computer with Ubuntu based distribution installed;
  • Have basic knowledge of Linux;
  • Basic familiarity with the Linux terminal;
  • Internet access.

👉 Then extract the .sh files.

👉 After extracting the .sh files, first run the 1.Setup.sh script on your terminal.

Читайте также:  Docker server ostype contains linux

⚠ If you don’t know how to run a .sh file on the terminal, click here.

👉 When the 1.Setup.sh script is finished, restart your computer.

👉 After restarting your computer, run the 2.Apps-to-Install.sh script.

👉 When the 2nd script is finished, restart your PC again.

⚠ You may be wondering: «what about the third script?». Well, it can be used whenever you want to update your packages, without installing new programs on your system. The 3.SystemUpdateUpgrade.sh script works more or less like a Windows Update, but YOU are in control!

🎉 That’s it! Now just test the programs that were automatically downloaded to your computer!

I recommend you run the scripts after you have freshly installed your ubuntu-based operating system.

The scripts were created specifically to meet my needs. So, if you want to change them to suit yours and/or share them with others, you can according to the license of this project.

Before running the scripts, I strongly recommend that you study them and observe what they will update/install on your computer.

I am not responsible for possible errors that may occur on your computer. Keep in mind that you are fully responsible for your actions from the moment you download any files or clone this repository.

The tests performed successfully were done on Ubuntu-based operating systems, like Pop_OS! 20.X LTS, Linux Mint XFCE 20.X LTS and Zorin OS 16.2 Lite.

📈 🤝 Contributing

Improvements are always welcome, but they are only possible if you contribute in some way. Do not be shy! If you found any errors in this project or simply would like to make suggestions for improvements , click here.

Add the programs below to the script to be downloaded:

Above the license, my script is based (and inspired by the WordPress Philosophy) in four freedoms:

  • The 1st: To run the program for any purpose.
  • The 2nd: To study how the program works and change it to make it do what you wish.
  • The 3rd: To redistribute.
  • The 4th: To distribute copies of your modified versions to others.

Distributed under the GPLv3 License. For more information, click here.

🥰 Acknowledgements

About

My Personal Ubuntu based OS Post Install Script

Источник

How do I make post-install scripts?

Easiest way is to gather all the commands you need and put them in a text file and make the text file executable.

We start out with going command line and do this:

touch post_install_script sudo 775 post_install_script gedit post_install_script 

And you start putting in commands you want to be executed.

Installing packages that are in Ubuntu Software Center.

Start with enabling all repositories and refreshing the software list because the LiveCD is outdated:

sudo sed 's/# deb/deb/' -i /etc/apt/sources.list sudo apt-get update 

Look up inside USC what already is there and check the package name. Examples with VLC and smplayer:

sudo apt-get install vlc sudo apt-get install smplayer 

In the same way of adding software like this you can also remove packages with:

Читайте также:  Cad приложения для linux

(just be careful to check dependencies first)

sudo add-apt-repository ppa:am-monkeyd/nautilus-elementary-ppa sudo apt-get update && sudo apt-get upgrade 

Those are either in USC or have a PPA so you can add these with either one of the 2. For instance I like the equinox themes and I can add them like this:

sudo add-apt-repository ppa:tiheum/equinox sudo apt-get update && sudo apt-get install gtk2-engines-equinox 
sudo add-apt-repository ppa:tiheum/equinox sudo apt-get update && sudo apt-get install faenza-icon-theme 

So you gather all the installation instructions that you want to add and put them in your script each on a new line. You can speed things up by removing duplicate entries: sudo apt-get upgrade does not need to be done with every PPA: you can do that after adding all the PPAs but(!) before you install the software from the PPA.

Theoretically you can have 1 of these script files for all Ubuntu installations but you might need to tweak them for every system.

This is my newest attempt to creating a post install script:

enter image description here

  1. update sources list
  2. remove all directories in my home and create them again in /discworld2/ After that I recreate my home directory directories using symlinks. This way I am able to format my home and keep my files (they are not only on another partition but even on another disc);
  3. install software I want;
  4. set power management the way I want it.
  5. add ppa’s I want

After installing I just execute my post_install file and it will run for a long time but it will take care of everything I want (well I will be adding more and more things over time so it will get longer).

I probably can improve it by making compound statements of some of these lines

Источник

What is a post-installation script for a package?

What is a post-installation script, exactly? Where are post-installation scripts located? I came across this question that is somewhat related, but it discusses post-installation triggers rather than post-installation scripts.

«Advanced package manager detects the post-installation script and Dpkg runs the script.» Nope. Dpkg is the sole handler of postinst scripts. Apt has nothing to do with it. Apt calls dpkg to do most things, remember.

1 Answer 1

The name of the script itself says what it does. In other words, the script contains commands that should be executed after installation is complete.

Let’s understand it in a better way through an example:

  • Assume you’re installing a newer kernel. Once the installation of the .deb file is complete, it needs to tell GRUB that the kernel is installed, so that you can boot into it. So the post-installation of the package will tell GRUB that the kernel is installed by executing the commands update-grub and update-initramfs . For more info see the FAQ section.

A more generic example can be this:

  • Assume you’re installing the package foo . Let’s say now that the package needs a service called bar to be disabled. How will it disable it? The developers will add the command systemctl disable bar.service , which will disable the service, in the foo package’s post-installation script. So the package’s post-installation script consists of additional commands, updates etc. Installation consists of the following steps:
    1. Extract the control files of the new package.
    2. If another version of the same package was installed before the new installation, execute prerm script of the old package.
    3. Run preinst script, if provided by the package.
    4. Unpack the new files, and at the same time back up the old files, so that if something goes wrong, they can be restored.
    5. If another version of the same package was installed before the new installation, execute the postrm script of the old package. Note that this script is executed after the preinst script of the new package, because new files are written at the same time old files are removed.
    6. Configure the package.
Читайте также:  Geforce 8400 gs drivers linux

Post-installation comes under the «Configure the package». It consists of:

  1. Telling other applications about the successful installation of the package.
  2. Precising paths to the package so that users and other applications can use/execute it.
  3. Look for any errors in the installation and print the error message.

FAQ section

    Where are these scripts located? These scripts are located in /var/lib/dpkg/info . These scripts have a .postinst extension. You can run locate .postinst to find more of these scripts. A sample post-installation script looks like this:
#!/bin/sh set -e if [ -x /usr/sbin/update-initramfs ]; then /usr/sbin/update-initramfs -u -k all fi 
Command Description Forceful Syntax
apt purge Removes the package along with its configuration files. Depends on the situation. sudo apt purge
dpkg -r Removes the package forcefully. Offers a lot of useful arguments. Yes, when used with certain arguments sudo dpkg -r —force-all
dpkg -P Purges the package forcefully. Offers a lot of useful arguments. Yes, when used with certain arguments. sudo dpkg -P —force-all
  • Your Ubuntu version (output of lsb_release -d ).
  • Output of sudo apt update .
  • Full output of sudo apt -f install .
  • Contents of the post-installation script of the package.

Other details should be provided when asked.

Friends and relatives of this script.

Try running ls in /var/lib/dpkg/info and grep the output with the pattern aptitude . You’ll find a lot of similar kinds of scripts as it’s output. Some of them are .postrm , .preinst , prerm and .list along with the signatures file. Here is a table showing the functions of each of these scripts:

Script Function
Post removal ( .postrm ) This script consists of commands to be run AFTER the removal is complete.
Pre-installation ( .preinst ) This script consists of commands to be run before the installation.
Pre-removal ( .prerm ) this script consists of the commands to be run before the removal process
Lists file ( .list ) This file contains the list of directories owned/belongs to the package.

For more information refer to the manpage of dpkg

Источник

Оцените статью
Adblock
detector