Skip to content

Ubuntu & Debian Related Topics

Disable Firewall Ubuntu

ufw disable

Disable IPv6 Persistent

Disable IPv6 using GRUB Perform the following steps with root privileges to disable IPv6 in Ubuntu 18.04/16.04 Permanently using grub method.

Edit:

/etc/default/grub

Modify GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT to append ipv6.disable=1:

GRUB_CMDLINE_LINUX="ipv6.disable=1"
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"

Update the grub configuration:

update-grub

Reboot the server

Unattended Upgrades

apt install -y unattended-upgrades apt-listchanges

Edit the config to your preference

nano /etc/apt/apt.conf.d/50unattended-upgrades

Example values in Debian:

        "origin=Debian,codename=${distro_codename}-updates";
        "origin=Debian,codename=${distro_codename}-proposed-updates";
        "origin=Debian,codename=${distro_codename},label=Debian";
        "origin=Debian,codename=${distro_codename},label=Debian-Security";
        "origin=Debian,codename=${distro_codename}-security,label=Debian-Security";

Unattended-Upgrade::AutoFixInterruptedDpkg "true";
Unattended-Upgrade::MinimalSteps "true";
Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";
Unattended-Upgrade::Remove-New-Unused-Dependencies "true";
Unattended-Upgrade::Remove-Unused-Dependencies "true";
Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-WithUsers "true";
Unattended-Upgrade::Automatic-Reboot-Time "05:00";

Automatic call via /etc/apt/apt.conf.d/20auto-upgrades

echo unattended-upgrades unattended-upgrades/enable_auto_updates boolean true | debconf-set-selections
dpkg-reconfigure -f noninteractive unattended-upgrades

Check the /etc/apt/apt.conf.d/20auto-upgrades for those 2 lines:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

Manual Run:

unattended-upgrade -d

To enable unattended-upgrade use the following command:

sudo dpkg-reconfigure --priority=low unattended-upgrades

Remove Snap Store from Ubuntu

sudo rm -rf /var/cache/snapd/ 
sudo apt autoremove --purge snapd gnome-software-plugin-snap 
sudo rm -rf ~/snap

Remove cloud-init

apt-get purge cloud-init
rm -rf /etc/cloud/ && rm -rf /var/lib/cloud/

Clear BOOT Partition on Ubuntu when 100%

dpkg --purge `dpkg --list|grep "linux-"|grep -v \`uname -r|sed 's/-generic//g'\`|cut -d" " -f3|grep "[0-9]-"|paste -sd " " -`

Comments