Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mediaserver
envsetup
Commits
ba59e67b
Commit
ba59e67b
authored
5 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Set sources.list only for Ubuntu
parent
28962625
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
3.New_server_deployment/3.APT_upgrade/0_setup.sh
+11
-28
11 additions, 28 deletions
3.New_server_deployment/3.APT_upgrade/0_setup.sh
with
11 additions
and
28 deletions
3.New_server_deployment/3.APT_upgrade/0_setup.sh
+
11
−
28
View file @
ba59e67b
...
@@ -5,21 +5,23 @@ DEBIAN_FRONTEND=noninteractive
...
@@ -5,21 +5,23 @@ DEBIAN_FRONTEND=noninteractive
export
DEBIAN_FRONTEND
export
DEBIAN_FRONTEND
apt-get update
apt-get update
apt-get
install
-y
apt-transport-https gnupg
apt-get
install
-y
apt-transport-https gnupg
lsb-release
# move 50unattended-upgrades conf if any
# move 50unattended-upgrades conf if any
if
[
-f
/etc/apt/apt.conf.d/50unattended-upgrades.ucf-dist
]
;
then
if
[
-f
'
/etc/apt/apt.conf.d/50unattended-upgrades.ucf-dist
'
]
;
then
mv
/etc/apt/apt.conf.d/50unattended-upgrades.ucf-dist
/etc/apt/apt.conf.d/50unattended-upgrades
mv
'
/etc/apt/apt.conf.d/50unattended-upgrades.ucf-dist
'
'
/etc/apt/apt.conf.d/50unattended-upgrades
'
fi
fi
# update sources.list
# update sources.list
rm
-f
/etc/apt/sources.list~
rm
-f
/etc/apt/sources.list~
echo
"Updating /etc/apt/sources.list file."
if
(
lsb_release
-a
|
grep
'Ubuntu'
>
/dev/null 2>&1
)
;
then
cp
sources.list /etc/apt/sources.list
echo
"Updating /etc/apt/sources.list file."
if
(
rgrep
'14.04'
/etc/lsb-release
>
/dev/null
)
;
then
cp
sources.list /etc/apt/sources.list
sed
-i
's@bionic@trusty@'
/etc/apt/sources.list
if
(
lsb_release
-a
|
grep
'14.04'
>
/dev/null 2>&1
)
;
then
elif
(
rgrep
'16.04'
/etc/lsb-release
>
/dev/null
)
;
then
sed
-i
's@bionic@trusty@'
/etc/apt/sources.list
sed
-i
's@bionic@xenial@'
/etc/apt/sources.list
elif
(
lsb_release
-a
|
grep
'16.04'
>
/dev/null 2>&1
)
;
then
sed
-i
's@bionic@xenial@'
/etc/apt/sources.list
fi
fi
fi
# modify sources.list to use ubicast cache
# modify sources.list to use ubicast cache
...
@@ -37,25 +39,6 @@ apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold"
...
@@ -37,25 +39,6 @@ apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold"
apt-get
install
-y
apt-transport-https
apt-get
install
-y
apt-transport-https
apt-get autoremove
-y
apt-get autoremove
-y
# migrate to Ubuntu 16.04 if needed
if
(
rgrep
'14.04'
/etc/lsb-release
>
/dev/null
)
;
then
echo
"Upgrading to Ubuntu 16.04."
sed
-i
's@trusty@xenial@'
/etc/apt/sources.list
apt-get update
apt-get dist-upgrade
-y
-o
Dpkg::Options::
=
"--force-confold"
||
apt-get
install
-f
-y
-o
Dpkg::Options::
=
"--force-confold"
apt-get dist-upgrade
-y
-o
Dpkg::Options::
=
"--force-confold"
||
apt-get
install
-f
-y
-o
Dpkg::Options::
=
"--force-confold"
apt-get dist-upgrade
-y
-o
Dpkg::Options::
=
"--force-confold"
apt-get autoremove
-y
echo
"16.04 migration ok."
echo
"The server is rebooting, please wait at least 2 minutes"
echo
" before restarting the script to continue the configuration."
echo
"Date:
$(
date
)
."
echo
"Ignore the following message about reboot problem if any."
reboot
exit
1
fi
systemctl unmask nginx
||
true
# APT panel
# APT panel
if
(
!
test
-z
${
SKYREACH_APT_TOKEN
}
)
;
then
if
(
!
test
-z
${
SKYREACH_APT_TOKEN
}
)
;
then
echo
"Adding skyreach.list to APT sources."
echo
"Adding skyreach.list to APT sources."
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment