View difference between Paste ID: jtffXtvB and jm2Ry6yy
SHOW: | | - or go back to the newest paste.
1
#!/bin/bash
2
clear
3
grep "Antergos" /etc/*-release > /dev/null 2>&1
4
if [ $? -eq 1 ]; then echo "A script designed for Antergos Linux! BYE!"; exit 1; fi
5
#sorry for my english ;)
6
echo -e "\033[1m
7
SCRIPT DOESN'T GUARANTEE CORRECT WORKING OF THE SYSTEM AFTER MIGRATION FROM ANTERGOS TO ARCH LINUX!!\n
8
FOR USE ON YOUR OWN RESPONSIBILITY. THE SCRIPT MAKES A BASIC COPY OF MODIFIED FILES.\n
9
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 ]"
10
read n
11
12
echo -e "\033[1mList of files to be modified:\033[0m \n"
13
echo -e "-> /etc/pacman.conf
14
-> /etc/os-release
15
-> /etc/issue
16
-> /boot/grub/grub.cfg
17
-> /etc/grub.d/10_antergos <-- It will be REMOVED! \n\n"
18
19
echo -e "\033[1mList of Antergos packages to be removed (list without dependencies,\norphaned dependencies will also be removed):\033[0m \n"
20
pacman -Qq | grep antergos || echo "Nothing here! (removed earlier?)"
21
echo -e "\n\n"
22
23
24
read -n 1 -p "Back up files that will be modified? (y/n)? " odp
25
case $odp in
26
    [yY])
27
            sudo cp -v /etc/pacman.conf /etc/pacman.conf.ANTERGOS
28
            sudo cp -v /etc/os-release /etc/os-release.ANTERGOS
29
            sudo cp -v /etc/issue /etc/issue.ANTERGOS
30
            sudo cp -v /boot/grub/grub.cfg /boot/grub/grub.cfg.ANTERGOS
31
            sudo cp -v /etc/grub.d/10_antergos /etc/grub.d/_10_antergos.ANTERGOS
32
            sudo chmod -x /etc/grub.d/_10_antergos.ANTERGOS
33
            sudo pacman -Qq | grep antergos > ~/antergos_pkglist_$$.txt && echo "A list of specific Antergos packages have been saved to a file ~/antergos_pkglist.txt"
34
            echo -e "\nA copy of the files to be modified has been created,\nyou will find them with the extension '.ANTERGOS'!"
35
            ;;
36
    [nN])
37
            echo -e "\nNo backup selected!!"
38
            ;;
39
    *)
40
            echo -e "\nPlease select \"y\" or \"n\" (yes/no)!"
41
            exit 1
42
            ;;
43
esac
44
45
46
tmpfile=`mktemp` || exit 1
47
48
49
echo -e "-> \033[1mRemoving Antergos-specific packages and dependencies\033[0m\n"
50
sudo pacman -Rddnus --noconfirm $(pacman -Qq | grep antergos)
51
52
echo -e "-> \033[1mRemoving GRUB Antergos modifications /etc/grub.d/10_antergos\033[0m\n"
53
sudo rm -v /etc/grub.d/10_antergos
54
55
echo -e  "-> \033[1mReplacing the content /etc/pacman.conf\033[0m\n"
56
cat > $tmpfile << "EOF"
57
#
58
# /etc/pacman.conf
59
#
60
# See the pacman.conf(5) manpage for option and repository directives
61
62
#
63
# GENERAL OPTIONS
64
#
65
[options]
66
# The following paths are commented out with their default values listed.
67
# If you wish to use different paths, uncomment and update the paths.
68
#RootDir     = /
69
#DBPath      = /var/lib/pacman/
70
#CacheDir    = /var/cache/pacman/pkg/
71
#LogFile     = /var/log/pacman.log
72
#GPGDir      = /etc/pacman.d/gnupg/
73
#HookDir     = /etc/pacman.d/hooks/
74
HoldPkg     = pacman glibc
75
#XferCommand = /usr/bin/curl -C - -f %u > %o
76
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
77
#CleanMethod = KeepInstalled
78
#UseDelta    = 0.7
79
Architecture = auto
80
81
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
82
#IgnorePkg   =
83
#IgnoreGroup =
84
85
#NoUpgrade   =
86
#NoExtract   =
87
88
# Misc options
89
#UseSyslog
90
Color
91
TotalDownload
92
CheckSpace
93
#VerbosePkgLists
94
ILoveCandy
95
96
# By default, pacman accepts packages signed by keys that its local keyring
97
# trusts (see pacman-key and its man page), as well as unsigned packages.
98
SigLevel    = Required DatabaseOptional
99
LocalFileSigLevel = Optional
100
#RemoteFileSigLevel = Required
101
102
# NOTE: You must run `pacman-key --init` before first using pacman; the local
103
# keyring can then be populated with the keys of all official Arch Linux
104
# packagers with `pacman-key --populate archlinux`.
105
106
#
107
# REPOSITORIES
108
#   - can be defined here or included from another file
109
#   - pacman will search repositories in the order defined here
110
#   - local/custom mirrors can be added here or in separate files
111
#   - repositories listed first will take precedence when packages
112
#     have identical names, regardless of version number
113
#   - URLs will have $repo replaced by the name of the current repo
114
#   - URLs will have $arch replaced by the name of the architecture
115
#
116
# Repository entries are of the format:
117
#       [repo-name]
118
#       Server = ServerName
119
#       Include = IncludePath
120
#
121
# The header [repo-name] is crucial - it must be present and
122
# uncommented to enable the repo.
123
#
124
125
# The testing repositories are disabled by default. To enable, uncomment the
126
# repo name header and Include lines. You can add preferred servers immediately
127
# after the header, and they will be used before the default mirrors.
128
129
#[testing]
130
#Include = /etc/pacman.d/mirrorlist
131
132
[core]
133
Include = /etc/pacman.d/mirrorlist
134
135
[extra]
136
Include = /etc/pacman.d/mirrorlist
137
138
#[community-testing]
139
#Include = /etc/pacman.d/mirrorlist
140
141
[community]
142
Include = /etc/pacman.d/mirrorlist
143
144
# If you want to run 32 bit applications on your x86_64 system,
145
# enable the multilib repositories as required here.
146
147
#[multilib-testing]
148
#Include = /etc/pacman.d/mirrorlist
149
150
[multilib]
151
Include = /etc/pacman.d/mirrorlist
152
153
# An example of a custom package repository.  See the pacman manpage for
154
# tips on creating your own repositories.
155
#[custom]
156
#SigLevel = Optional TrustAll
157
#Server = file:///home/custompkgs
158
EOF
159
sudo mv -v $tmpfile /etc/pacman.conf
160
161
echo -e  "-> \033[1mReplacing the content /etc/os-release\033[0m\n"
162
cat > $tmpfile << "EOF"
163
NAME="Arch Linux"
164
PRETTY_NAME="Arch Linux"
165
ID=arch
166
BUILD_ID=rolling
167
ANSI_COLOR="0;36"
168
HOME_URL="https://www.archlinux.org/"
169
DOCUMENTATION_URL="https://wiki.archlinux.org/"
170
SUPPORT_URL="https://bbs.archlinux.org/"
171
BUG_REPORT_URL="https://bugs.archlinux.org/"
172
LOGO=archlinux
173
EOF
174
sudo mv -v $tmpfile /etc/os-release
175
176
177
echo -e  "-> \033[1mReplacing the content /etc/issue\033[0m\n"
178
cat > $tmpfile << "EOF"
179
Arch Linux \r (\l)
180
181
EOF
182
sudo mv -v $tmpfile /etc/issue
183
184
185
echo -e  "-> \033[1mPamac removal\033[0m\n"
186
kill -s SIGKILL $(pgrep pamac)
187
sudo pacman --noconfirm --remove -nus pamac
188
189
190
echo -e  "-> \033[1mUpdating Pacman keys and repository databases - Please be patient\033[0m\n"
191
sudo pacman-key --refresh
192
sudo pacman -Syy
193
194
echo -e  "-> \033[1mReinstall linux and linux-headers\033[0m\n"
195
sudo pacman -Syu --noconfirm linux linux-headers
196
197
198
echo -e  "-> \033[1mReinstall GRUB and refresh entries in grub.cfg\033[0m\n"
199
sudo pacman -Syu --noconfirm grub
200
sudo grub-mkconfig -o /boot/grub/grub.cfg
201
202
203
echo -e  "-> \033[1mFull system update\033[0m\n"
204
sudo sudo pacman -Syyuu --noconfirm