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
14481177
Commit
14481177
authored
8 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Changed APT setup.
parent
1b0ebf19
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
3.New_server_deployment/3.Initialize_APT/0_setup.sh
+22
-30
22 additions, 30 deletions
3.New_server_deployment/3.Initialize_APT/0_setup.sh
with
22 additions
and
30 deletions
3.New_server_deployment/3.Initialize_APT/0_setup.sh
+
22
−
30
View file @
14481177
#!/bin/bash
source
/root/envsetup/global-conf.sh
# migrate to Ubuntu 16.04 / apply sources.list
if
(
rgrep
'14.04'
/etc/lsb-release
>
/dev/null
)
;
then
echo
"Upgrading to Ubuntu 16.04."
apt-get update
apt-get dist-upgrade
-y
cp
sources16.list /etc/apt/sources.list
apt-get update
DEBIAN_FRONTEND
=
noninteractive /usr/bin/apt-get dist-upgrade
-o
Dpkg::Options::
=
"--force-confold"
--force-yes
-y
apt-get
install
-f
-y
apt-get dist-upgrade
-y
else
echo
"Updating Ubuntu 16.04 sources.list."
cp
sources16.list /etc/apt/sources.list
fi
# update
apt-get update
apt-get
install
-y
apt-transport-https
# resolvconf
apt-get purge
-y
resolvconf
# modify sources.list to use ubicast cache
if
(
!
test
-z
${
APT_CACHE_HOST
}
)
;
then
...
...
@@ -36,8 +20,8 @@ if ( ! test -z ${SKYREACH_API_KEY} ); then
fi
# APT proxy
if
[
${
PROXY
}
=
"1"
]
;
then
if
[
${
PROXY_AUTHENTICATION
}
=
"1"
]
;
then
if
[
"
${
PROXY
}
"
=
"1"
]
;
then
if
[
"
${
PROXY_AUTHENTICATION
}
"
=
"1"
]
;
then
# general settings
echo
"Proxy: http://
${
PROXY_USER
}
:
${
PROXY_PWD
}
@
${
PROXY_HTTP
}
:
${
PROXY_PORT
}
"
>>
/etc/apt-cacher-ng/acng.conf
else
...
...
@@ -46,7 +30,25 @@ if [ ${PROXY} = "1" ]; then
fi
fi
# update
apt-get update
apt-get
install
-y
apt-transport-https
apt-get dist-upgrade
-y
# migrate to Ubuntu 16.04 / apply sources.list
if
(
rgrep
'14.04'
/etc/lsb-release
>
/dev/null
)
;
then
echo
"Upgrading to Ubuntu 16.04."
cp
sources16.list /etc/apt/sources.list
apt-get update
DEBIAN_FRONTEND
=
noninteractive /usr/bin/apt-get dist-upgrade
-o
Dpkg::Options::
=
"--force-confold"
--force-yes
-y
apt-get
install
-f
-y
apt-get dist-upgrade
-y
else
echo
"Updating Ubuntu 16.04 sources.list file."
cp
sources16.list /etc/apt/sources.list
apt-get update
apt-get dist-upgrade
-y
fi
# unattended-upgrades
echo
"Installing and configuring unattended-upgrades."
...
...
@@ -54,13 +56,3 @@ apt-get install -y unattended-upgrades
sed
-i
's@//Unattended-Upgrade::Mail "root";@Unattended-Upgrade::Mail "root";@'
/etc/apt/apt.conf.d/50unattended-upgrades
sed
-i
's@//*.*"vim";@"mysql-server";@'
/etc/apt/apt.conf.d/50unattended-upgrades
sed
-i
's@//*.*"libc6";@"mysql-client";@'
/etc/apt/apt.conf.d/50unattended-upgrades
# configure frequence
cat
>
/etc/apt/apt.conf.d/10periodic
<<
EOF
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";
EOF
# resolvconf
apt-get purge
-y
resolvconf
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