Linux를 새로 설치한 후 복원할 수 있도록 Linux에 설치된 소프트웨어/시스템 구성을 추적하는 방법은 무엇입니까?

Linux를 새로 설치한 후 복원할 수 있도록 Linux에 설치된 소프트웨어/시스템 구성을 추적하는 방법은 무엇입니까?

나는 내가 설치한 모든 소프트웨어와 구성을 추적하기 위해 일종의 Linux용 유틸리티를 작성하려고 생각하고 있습니다. 새로 설치한 후 이를 실행하고 Ubuntu 복사본을 새로 설치하기 전의 상태로 복원할 수 있습니다.

정확히 어디서부터 시작해야 할지 모르겠습니다. 에서 사용자가 설치한 소프트웨어 목록을 얻을 수 있다는 것을 알고 있습니다 dpkg -i | grep ii.

답변1

데비안과 그 후손에는 간단한 패키지(종속성만 포함)를 만들 수 있는 도구가 있습니다. 직업에 딱 맞습니다.

이름은 equivs-build(이름이 어디서 왔는지 모르겠습니다)입니다. 하나를 생성하면 .deb설치할 수 있습니다.gdebi

여기 makefile이 있습니다. (원한다면 수동으로 할 수도 있습니다. make 파일은 10%의 편의성만 추가하지만 프로세스를 문서화합니다.)

#create source
%.equivs-control: src/%.equivs-control
        @echo %linking "$@" from "$<"
        ln -s -t . "$<"

#make deb
%.deb: %.equivs-control
        @echo %making "$@" from "$<"
        equivs-build "$<"

#install one
.PHONY: %.install
%.install: %.deb
        @echo %installing "$<"
        sudo gdebi "$<"

하지만 먼저 몇 가지 도구를 설치해야 합니다.

#!/bin/bash
ln -fs -T ../equivs src
ln -fs -t . src/makefile

#install what we need
sudo apt-get install equivs gdebi-core make

구성 파일src/my-packages_1.0_all.equivs-control

Section: local
Priority: optional
#Homepage: https:
Standards-Version: 3.9.2
Package: my-packages
Version: 1.0
Maintainer: ctrl-alt-delor@local>

Depends: python3-pystache, equivs, make, gdebi-core, intel-microcode, firmware-linux, multiarch-support, cpufrequtils, openssh-server, stow, etckeeper, ntp, bomstrip, nodejs, dos2unix, faketime, wget, nocache, schedtool, cpulimit, smem, inotify-tools, keepassx, mawk, mmv, yakuake, xdotool, acl, gparted, gufw, htop, sshfs, bindfs, k4dirstat, openssh-client, vim, rsync, emacs, vim, avahi-discover, yaml-mode, markdown, pandoc, dc, xinput, iotop, strace, curl, screen, kdesdk-dolphin-plugins, cvs, easygit, git, git-flow, git-gui, gitg, tig, kdesvn, subversion, hgview, mercurial-common, tortoisehg-nautilus, python-dulwich, task-british-desktop, task-british-kde-desktop, task-desktop, task-english, task-kde-desktop, task-laptop, redshift-plasmoid, gtk2-engines-oxygen, kde-config-gtk-style, kde-config-gtk-style-preview, libreoffice-style-oxygen, appmenu-qt, vlc, konversation, encfs, diffpdf, diffuse, dirdiff, kdiff3, meld, tor, idle3, ipython3-qtconsole, backintime-kde, couchapp, augeas-lenses, augeas-tools, augeas-doc, python3-augeas, sass-elisp, ruby-sass, eclipse-jdt, eclipse-mercurialeclipse, python3-requests, filepp, texlive-latex-base, texlive-latex-extra, tth, golang-mode, zenmap, wireshark

# Readme: <README.Debian file; defaults to a generic one>
Description: All of the stuff I want installed.
 This is managed by my install script system.

사용하려면: - 쉘 스크립트를 실행하십시오(이렇게 하면 설치 시스템이 시작됩니다) - 실행make my-packages_1.0_all.install

파일 이름을 엉망으로 만드는 경우 주의하세요. 일부는 에서 가져오고 Package: line일부는 도구에 내장되어 있습니다.


더 많은 작업을 수행할 수 있고 살펴볼 가치가 있는 다른 구성 관리 도구가 있습니다.

관련 정보