Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- clear
- grep "Antergos" /etc/*-release > /dev/null 2>&1
- if [ $? -eq 1 ]; then echo "A script designed for Antergos Linux! BYE!"; exit 1; fi
- #sorry for my english ;)
- echo -e "\033[1m
- SCRIPT DOESN'T GUARANTEE CORRECT WORKING OF THE SYSTEM AFTER MIGRATION FROM ANTERGOS TO ARCH LINUX!!\n
- FOR USE ON YOUR OWN RESPONSIBILITY. THE SCRIPT MAKES A BASIC COPY OF MODIFIED FILES.\n
- HOWEVER, TO RESTORE THEM, YOU NEED TO DO IT MANUAL. THE BEST TO MAKE A FULL COPY OF THE SYSTEM.\033[0m \n[ To abort, press Ctrl+C, ENTER - to continue ]"
- read n
- echo -e "\033[1mList of files to be modified:\033[0m \n"
- echo -e "-> /etc/pacman.conf
- -> /etc/os-release
- -> /etc/issue
- -> /boot/grub/grub.cfg
- -> /etc/grub.d/10_antergos <-- It will be REMOVED! \n\n"
- echo -e "\033[1mList of Antergos packages to be removed (list without dependencies,\norphaned dependencies will also be removed):\033[0m \n"
- pacman -Qq | grep antergos || echo "Nothing here! (removed earlier?)"
- echo -e "\n\n"
- read -n 1 -p "Back up files that will be modified? (y/n)? " odp
- case $odp in
- [yY])
- sudo cp -v /etc/pacman.conf /etc/pacman.conf.ANTERGOS
- sudo cp -v /etc/os-release /etc/os-release.ANTERGOS
- sudo cp -v /etc/issue /etc/issue.ANTERGOS
- sudo cp -v /boot/grub/grub.cfg /boot/grub/grub.cfg.ANTERGOS
- sudo cp -v /etc/grub.d/10_antergos /etc/grub.d/_10_antergos.ANTERGOS
- sudo chmod -x /etc/grub.d/_10_antergos.ANTERGOS
- sudo pacman -Qq | grep antergos > ~/antergos_pkglist_$$.txt && echo "A list of specific Antergos packages have been saved to a file ~/antergos_pkglist.txt"
- echo -e "\nA copy of the files to be modified has been created,\nyou will find them with the extension '.ANTERGOS'!"
- ;;
- [nN])
- echo -e "\nNo backup selected!!"
- ;;
- *)
- echo -e "\nPlease select \"y\" or \"n\" (yes/no)!"
- exit 1
- ;;
- esac
- tmpfile=`mktemp` || exit 1
- echo -e "-> \033[1mRemoving Antergos-specific packages and dependencies\033[0m\n"
- sudo pacman -Rddnus --noconfirm $(pacman -Qq | grep antergos)
- echo -e "-> \033[1mRemoving GRUB Antergos modifications /etc/grub.d/10_antergos\033[0m\n"
- sudo rm -v /etc/grub.d/10_antergos
- echo -e "-> \033[1mReplacing the content /etc/pacman.conf\033[0m\n"
- cat > $tmpfile << "EOF"
- #
- # /etc/pacman.conf
- #
- # See the pacman.conf(5) manpage for option and repository directives
- #
- # GENERAL OPTIONS
- #
- [options]
- # The following paths are commented out with their default values listed.
- # If you wish to use different paths, uncomment and update the paths.
- #RootDir = /
- #DBPath = /var/lib/pacman/
- #CacheDir = /var/cache/pacman/pkg/
- #LogFile = /var/log/pacman.log
- #GPGDir = /etc/pacman.d/gnupg/
- #HookDir = /etc/pacman.d/hooks/
- HoldPkg = pacman glibc
- #XferCommand = /usr/bin/curl -C - -f %u > %o
- #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
- #CleanMethod = KeepInstalled
- #UseDelta = 0.7
- Architecture = auto
- # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
- #IgnorePkg =
- #IgnoreGroup =
- #NoUpgrade =
- #NoExtract =
- # Misc options
- #UseSyslog
- Color
- TotalDownload
- CheckSpace
- #VerbosePkgLists
- ILoveCandy
- # By default, pacman accepts packages signed by keys that its local keyring
- # trusts (see pacman-key and its man page), as well as unsigned packages.
- SigLevel = Required DatabaseOptional
- LocalFileSigLevel = Optional
- #RemoteFileSigLevel = Required
- # NOTE: You must run `pacman-key --init` before first using pacman; the local
- # keyring can then be populated with the keys of all official Arch Linux
- # packagers with `pacman-key --populate archlinux`.
- #
- # REPOSITORIES
- # - can be defined here or included from another file
- # - pacman will search repositories in the order defined here
- # - local/custom mirrors can be added here or in separate files
- # - repositories listed first will take precedence when packages
- # have identical names, regardless of version number
- # - URLs will have $repo replaced by the name of the current repo
- # - URLs will have $arch replaced by the name of the architecture
- #
- # Repository entries are of the format:
- # [repo-name]
- # Server = ServerName
- # Include = IncludePath
- #
- # The header [repo-name] is crucial - it must be present and
- # uncommented to enable the repo.
- #
- # The testing repositories are disabled by default. To enable, uncomment the
- # repo name header and Include lines. You can add preferred servers immediately
- # after the header, and they will be used before the default mirrors.
- #[testing]
- #Include = /etc/pacman.d/mirrorlist
- [core]
- Include = /etc/pacman.d/mirrorlist
- [extra]
- Include = /etc/pacman.d/mirrorlist
- #[community-testing]
- #Include = /etc/pacman.d/mirrorlist
- [community]
- Include = /etc/pacman.d/mirrorlist
- # If you want to run 32 bit applications on your x86_64 system,
- # enable the multilib repositories as required here.
- #[multilib-testing]
- #Include = /etc/pacman.d/mirrorlist
- [multilib]
- Include = /etc/pacman.d/mirrorlist
- # An example of a custom package repository. See the pacman manpage for
- # tips on creating your own repositories.
- #[custom]
- #SigLevel = Optional TrustAll
- #Server = file:///home/custompkgs
- EOF
- sudo mv -v $tmpfile /etc/pacman.conf
- echo -e "-> \033[1mReplacing the content /etc/os-release\033[0m\n"
- cat > $tmpfile << "EOF"
- NAME="Arch Linux"
- PRETTY_NAME="Arch Linux"
- ID=arch
- BUILD_ID=rolling
- ANSI_COLOR="0;36"
- HOME_URL="https://www.archlinux.org/"
- DOCUMENTATION_URL="https://wiki.archlinux.org/"
- SUPPORT_URL="https://bbs.archlinux.org/"
- BUG_REPORT_URL="https://bugs.archlinux.org/"
- LOGO=archlinux
- EOF
- sudo mv -v $tmpfile /etc/os-release
- echo -e "-> \033[1mReplacing the content /etc/issue\033[0m\n"
- cat > $tmpfile << "EOF"
- Arch Linux \r (\l)
- EOF
- sudo mv -v $tmpfile /etc/issue
- echo -e "-> \033[1mPamac removal\033[0m\n"
- kill -s SIGKILL $(pgrep pamac)
- sudo pacman --noconfirm --remove -nus pamac
- echo -e "-> \033[1mUpdating Pacman keys and repository databases - Please be patient\033[0m\n"
- sudo pacman-key --refresh
- sudo pacman -Syy
- echo -e "-> \033[1mReinstall linux and linux-headers\033[0m\n"
- sudo pacman -Syu --noconfirm linux linux-headers
- echo -e "-> \033[1mReinstall GRUB and refresh entries in grub.cfg\033[0m\n"
- sudo pacman -Syu --noconfirm grub
- sudo grub-mkconfig -o /boot/grub/grub.cfg
- echo -e "-> \033[1mFull system update\033[0m\n"
- sudo sudo pacman -Syyuu --noconfirm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement