DEV Community

Zaki Arrozi Arsyad
Zaki Arrozi Arsyad

Posted on

linux : package and service management

Package management

  • First, we need to update our repository
$ apt-get update
Enter fullscreen mode Exit fullscreen mode
  • Install a package
$ apt-get install APPNAME
Enter fullscreen mode Exit fullscreen mode
  • Check if a package is already installed
$ dpkg -l | grep APPNAME
Enter fullscreen mode Exit fullscreen mode
  • Remove a package
$ apt-get remove APPNAME
Enter fullscreen mode Exit fullscreen mode
  • Search packages by a keyword
$ apt-cache search β€œKEYWORD”
Enter fullscreen mode Exit fullscreen mode

Service management

  • Check if a service is running
$ systemctl status APPNAME
Enter fullscreen mode Exit fullscreen mode
  • Start a service
$ systemctl start APPNAME
Enter fullscreen mode Exit fullscreen mode
  • Stop a service
$ systemctl stop APPNAME
Enter fullscreen mode Exit fullscreen mode
  • Restart a service
$ systemctl restart APPNAME 
Enter fullscreen mode Exit fullscreen mode
  • Check autostart enable
$ systemctl is-enabled APPNAME 
Enter fullscreen mode Exit fullscreen mode
  • Enable autostart
$ systemctl enable APPNAME 
Enter fullscreen mode Exit fullscreen mode
  • Disable autostart
$ systemctl disable APPNAME 
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
mhasan profile image
Mahmudul Hasan

Thanks for sharing!