Code: Select all
sudo apt-get update
sudo apt-get install program_name
sudo apt-get install program_name
sudo apt-get install program_name
sudo apt-get install program_name
Code: Select all
sudo apt-get update
sudo apt-get install program_name
sudo apt-get install program_name
sudo apt-get install program_name
sudo apt-get install program_name
You only need to run the
sudo apt-get update
at the beginning of your script. Code: Select all
sudo apt install gimp inkscape kdenlive
Thanks ye i tried that, i updated the list, moved the sources.list to new computer and then ran the update command to install the programs in the sources.list file. It ran the updates but never installed the programs. I'm not too sure how to see what it actually did because the update took a while to do. Maybe there's a log somewhere.
Thanks yeah I'm looking for the simplist way, that's why I was thinking of making a script, that way it's automated. I like what you said, you can have everything on one line, that will make it super simple and less code in the script.vanadium wrote: ⤴Thu Oct 21, 2021 6:10 am To add here, you can further simplify by listing all your packages on a single "sudo apt install" line, e.g.There is no easier way than writing it out in a script: you cannot avoid telling your system what to install.Code: Select all
sudo apt install gimp inkscape kdenlive
AndyMH wrote: ⤴Thu Oct 21, 2021 6:34 am What is being proposed will only work for stuff in the standard repositories, it will not work if you have software installed from ppa, deb file, additional repos or anything you have to build. Nor is program name necessarily the same as package name. If you are migrating from an earlier version of LM, you also have to contend with the absence of python2 for any software you used to use that depended on it.
I have a script that takes a vanilla install of LM20 and installs all the software I want, sets up my network shares, installs printers, etc. I benefit from having a separate home partition so I don't need to worry about all my config files. The setup folder is over 1GB, the script runs to some +1000 lines (okay, probably 50% comments). It took me a couple of weeks to do on and off.
How complicated do you want to make it?
If you just want stuff from the standard repos, you don't need to write your own script, the mint backup tool will do what you want. Or you could simply clone the old drive to the new drive - foxclone, rescuezilla, clonezilla.
Too big to post on the forum, send me an email (click on me to get my profile page, there is a 'send an email' link).Would you mind sharing your script you made here ? I would love to see it.
Regarding the picture you sent showing the backup, i see it backs up programs as well as settings, is that right?
dpkg --get-selections | cut -f1 > dpkg__get-selections_original.txt
will allow you to keep a list of installed package of your original computer. dpkg --get-selections...
will just give you a list of packages, I've been tripped up in the past - where and how did I install stuff? I now keep a simple text file on my backup drive, launcher on the desktop. Whenever I make any change, I make a date/timestamped note of it, if I install stuff - how - software manager, ppa, deb, etc.Code: Select all
cat example.list | xargs sudo apt-get -y install
Code: Select all
cat example.list
example.lst
with any text editor. Use Xed, it comes with Mint.Yes, if the software installation method is other than dpkg it will not appear.
I agree with updating your change log for any hardware or software change. If you work in an enterprise environment, updating the change log is standard operating procedure.
Code: Select all
find /usr/share/applications -maxdepth 1 -type f -exec basename {} .desktop \; | sort > ~/Desktop/applications.txt
Code: Select all
#!/bin/bash
## If a sub-command fails, the entire pipeline command fails, terminating the script
set -eu -o pipefail # fail on error and report it, debug all lines
sudo -n true
test $? -eq 0 || exit 1 "you should have sudo privileges to run this script"
echo installing the must-have pre-requisites
while read -r p ; do sudo apt-get install -y $p ; done < <(cat << "EOF"
perl
htop
curl
git
wget
EOF
)
echo "========================================================================"
echo installing the nice-to-have pre-requisites
echo you have 5 seconds to proceed ...
echo or
echo hit Ctrl+C to quit
echo -e "\n"
echo "========================================================================"
sleep 6
## Don't forget to place your *.list file in directory
cat applications.list | xargs sudo apt-get -y install
clear
echo "========================================================================"
echo "Packages installed"
echo "========================================================================"
read -p "Press enter to close..."
thanksMichael_Hathaway wrote: ⤴Mon Oct 25, 2021 4:19 am Maybe this will help you. You can modify to your needs. Check prerequisites add/remove as needed. I have tested on a virtual machine before posting.
Code: Select all
#!/bin/bash ## If a sub-command fails, the entire pipeline command fails, terminating the script set -eu -o pipefail # fail on error and report it, debug all lines sudo -n true test $? -eq 0 || exit 1 "you should have sudo privileges to run this script" echo installing the must-have pre-requisites while read -r p ; do sudo apt-get install -y $p ; done < <(cat << "EOF" perl htop curl git wget EOF ) echo "========================================================================" echo installing the nice-to-have pre-requisites echo you have 5 seconds to proceed ... echo or echo hit Ctrl+C to quit echo -e "\n" echo "========================================================================" sleep 6 ## Don't forget to place your *.list file in directory cat applications.list | xargs sudo apt-get -y install clear echo "========================================================================" echo "Packages installed" echo "========================================================================" read -p "Press enter to close..."
comm -23 <(apt-mark showmanual | sort -u) <(gzip -dc /var/log/installer/initial-status.gz | sed -n 's/^Package: //p' | sort -u) | grep -Ev ^lib