Category: Debian

  • How to extract .deb file in Ubuntu?

    You can use dpkg-deb command to extract the contents of a .deb file in the Ubuntu or Debian system.

    dpkg-deb -x file.deb folder

    Example:

    dpkg-deb -x anydesk_6.3.2-1_amd64.deb anydesk

    Here we extract the content of the file anydesk_6.3.2-1_amd64.deb to the directory “anydesk’.

    Back to dpkg

  • How to Upgrade Debian 10 to Debian 11

    How to Upgrade Debian 10 to Debian 11

    One of the advantages of the Debian operating system is easy to upgrade to the newer version.

    Login to your Debian 10 server using SSH or console. Install all available software updates with the command

    apt update && apt upgrade -y

    Remove any unused packages

    apt autoremove

    Change /etc/apt/sources.list

    Make a backup of the file

    cp /etc/apt/sources.list ~/

    Edit the file /etc/apt/sources.list

    In the file, change all “buster” entries to “bullseye”. You can do this manually or using sed command

    sed -i 's/buster/bullseye/g' /etc/apt/sources.list

    Update System

    Update repository cache with

    apt update

    Upgrade software with

    apt upgrade

    Do a full-upgrade with

    apt full-upgrade

    Now reboot system

    reboot

    After reboot, you need to make sure all services running properly, there is a chance some services won’t work as expected, in that case, you need to debug and fix i.

    See Debian

  • sudo: command not found

    sudo: command not found

    On a Debian server, when running a command with sudo, I got the error

    sudo: command not found
    

    To fix this, you need to install “sudo” package. If you are logged in as non-root user, then you need to become root, for this, you can use the command

    su -
    

    Enter the root password when it prompt for the password.

    Once logged in as user root, you can install sudo with the command

    apt install sudo
    

    To add a user to sudo group, run the command

    usermod -aG sudo USER_NAME
    

    Or

    adduser USER_NAME sudo
    

    adding user to sudo group

    If you don’t have a user, you can create a user with the command

    useradd -m --shell /bin/bash USER_NAME
    

    To verify if the user has sudo rights, you can use the command “sudo -v”. You can also use “id” or “groups” command, which lists all groups the current user is in, you can verify if the user is part of sudo group.

  • Debian 11.0 Bullseye released

    Debian 11.0 Bullseye released

    Debian 11.0 Bullseye released on August 14th, 2021 is the next major Debian GNU/Linux distribution release. Debian 10 buster is designated as oldstable.

    Debian 11.0 Bullseye

    https://www.debian.org/releases/bullseye/

    Debian 12 “Bookworm” is the new testing distribution with is expected to be released in 2023.

    You can download the latest version of Debian 11.0 ISO from

    https://www.debian.org/download

    What is new in Debian 11.0

    Debian 11.0 is powered by Linux 5.10 LTS kernel. It supports exFAT file system. Control groups v2 support. Improved support for alternative init systems.

    The new release of Debian 11.0 comes with a lot more software packages. It includes 11294 new packages. Most software on the distribution has been updated.

    You can find the list of software packages and versions at

    https://www.debian.org/releases/stable/amd64/release-notes/ch-whats-new.en.html#major-packages

    Upgrade Debian 10 to Debian 11.0

    You can find instructions for upgrading Debian 10 to Debian 11.0 at

    https://www.debian.org/releases/stable/amd64/release-notes/ch-upgrading.en.html

    See Debian

  • How to install development tools on Debian/Ubuntu

    Development tools are programs used to build software from its source code. These include compilers, make, and other generally used libraries.

    To install development tools on Ubuntu/Debian, run

    apt install -y build-essential
    apt install -y autoconf automake gdb libffi-dev zlib1g-dev libssl-dev git wget

    See Ubuntu, Debian

  • Create a Debian Container in LXD

    Debian OS templates are available in images:debian/VERSION. To see all available Debian OS templates, run

    lxc image list images: debian

    To create a container with Debian 10 OS, run

    lxc launch  images:debian/10 my-debian

    Example

    lxd debian container

    See LXD

  • CloudPanel – Free Hosting Control Panel Debian 10/Nginx

    CloudPanel – Free Hosting Control Panel Debian 10/Nginx

    CloudPanel is a free hosting control panel, that make deploying web application on cloud easier. It use Nginx web server, support multile PHP versions, comes with nginx configuration for various popular CMS and web applications.

    https://www.cloudpanel.io/

    Install CloudPanel

    CloudPanel need a server with Debian 10.

    To install CloudPanel, run

    apt update && apt -y upgrade && apt -y install curl wget sudo
    curl -sSL https://installer.cloudpanel.io/ce/v1/install.sh | sudo bash
    

    After install you can access cloudPanel at

    https://serverIP:8443

    When you access cloudpanel for first time, you will be asked to create a user. This user can be used to access cloudpanel to manage your web sites.

    To list users, run

    clpctl user:list
    

    To change a user password

    clpctl user:reset:password --userName=USER_HERE --password='PW_HERE'
    

    See Hosting Control Panel

  • Uninstalling Software in Debian Server

    To uninstall a software on Debian server, run

    apt remove PKG_NAME
    

    Example

    uninstall software on debian server

    To all installed software with specific name, run

    dpkg-query -l PKG_NAME
    

    Example

    root@lab:~# dpkg-query -l 'nginx*'
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name           Version          Architecture Description
    +++-==============-================-============-=========================================================
    ii  nginx          1.14.2-2+deb10u3 all          small, powerful, scalable web/proxy server
    ii  nginx-common   1.14.2-2+deb10u3 all          small, powerful, scalable web/proxy server - common files
    un  nginx-doc                        (no description available)
    un  nginx-extras                     (no description available)
    ii  nginx-full     1.14.2-2+deb10u3 amd64        nginx web/proxy server (standard version)
    un  nginx-light                      (no description available)
    root@lab:~# 
    

    In above list, packages start with

    ii = installed
    un = currently not installed on the server

    When you uninstall a package, it won’t remove all config files, such packages list as uninsalled (un). To completely delete a package, its config file and data, use

    apt remove --purge PKG_NAME
    

    Example

    apt remove --purge apache2
    

    After removing a software package, you may need to run apt autoremove to remove any unused dependency.

    apt autoremove
    

    See apt

  • apt-cache

    To search for available packages, run

    apt-cache search PKG_NAME
    

    Example

    boby@sok-01:~$ apt-cache search wget
    devscripts - scripts to make the life of a Debian Package maintainer easier
    wget - retrieves files from the web
    abcde - A Better CD Encoder
    apt-mirror - APT sources mirroring tool
    axel - light command line download accelerator
    filetea - Web-based file sharing system
    getdata - management of external databases
    libcupt4-2-downloadmethod-wget - flexible package manager -- wget download method
    libwget0 - Download library for files and recursive websites
    ow-shell - shell utilities to talk to an 1-Wire owserver
    puf - Parallel URL fetcher
    pwget - downloader utility which resembles wget (implemented in Perl)
    python-wget - pure Python download utility for Python 2
    python3-wget - pure Python download utility for Python 3
    snarf - command-line URL grabber
    tcllib - Standard Tcl Library
    texlive-latex-extra - TeX Live: LaTeX additional packages
    wget2 - file and recursive website downloader
    wget2-dev - development file for libwget2
    wput - tiny wget-like ftp-client for uploading files
    boby@sok-01:~$ 
    

    Ubuntu find Dependencies for a package
    apt

  • Auto upgrade software in Ubuntu/Debian

    To auto upgrade software packages in Ubuntu/Debian, install

    apt install -y unattended-upgrades
    

    Edit

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

    In this file, you can configure various settings.

    See apt

  • apt The method driver /usr/lib/apt/methods/https could not be found

    When running apt update on a Debian server, i get error

    root@shop:~# apt-get update
    E: The method driver /usr/lib/apt/methods/https could not be found.
    N: Is the package apt-transport-https installed?
    root@shop:~# 
    

    apt https error

    To fix the error, run

    apt-get install apt-transport-https ca-certificates
    

    See apt

  • Install bitninja firewall

    To install bitninja on Debian/Ubuntu, run

    sudo su -c "echo deb http://apt.bitninja.io/debian/ bitninja non-free >> /etc/apt/sources.list.d/bitninja.list"
    sudo su -c "wget -O- http://apt.bitninja.io/7F8B47DC.gpg | apt-key add -"
    sudo apt-get update
    sudo apt-get install bitninja
    sudo bitninja-config --set license_key=YOUR_LICENSE_KEY_HERE
    sudo /etc/init.d/bitninja start
    

    To scan malware, run

    bitninjacli --module=MalwareScanner --scan=/var/www