我遇到了一个问题,在 Ubuntu 18.04.2 上使用 preseed 进行无人值守安装后,没有 root 拥有的文件。我在无法使用 sudo 时发现了这个问题。经过调查,我发现 /usr、/lib 和 /home 归 1001:1001 所有,而不是 root,任何文件或子目录也是如此。这在过去不是问题,所以我有点困惑。请参阅下面的预置文件:
# Localization
d-i debian-installer/locale string en_US.UTF-8
d-i debian-installer/language string en
d-i debian-installer/country string US
# Keyboard layout
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
d-i keyboard-configuration/charmap select UTF-8
d-i keyboard-configuration/layout string English (US)
### Network configuration
d-i netcfg/choose_interface select auto
d-i netcfg/use_autoconfig boolean true
d-i netcfg/get_domain string cg.chrysler.com
### Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string us.archive.ubuntu.com
d-i mirror/http/directory string /ubuntu
d-i mirror/http/proxy string
d-i proxy string
d-i mirror/protocol string http
### Account setup
d-i passwd/user-fullname string ictadmin
d-i passwd/username string ictadmin
d-i passwd/user-password password chrysler1
d-i passwd/user-password-again password chrysler1
d-i user-setup/encrypt-home boolean false
### Clock and time zone setup - TS verified ntp server
d-i clock-setup/utc boolean true
d-i time/zone string America/Detroit
d-i clock-setup/ntp boolean false
d-i clock-setup/ntp-server string ntp.example.com
# Automatically detect device name of install disk
d-i partman/early_command string debconf-set partman-auto/disk /dev/"$(fdisk -l |grep -i linux | awk '{print $1}' | cut -d / -f 3 |sed 's/p[0-9]$//p' |head -n1)"
### Partitioning and disk encryption
d-i partman-auto/method string crypto
d-i partman-crypto/passphrase password
d-i partman-crypto/passphrase-again password
d-i partman-lvm/purge_lv_from_device boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-auto/choose_recipe select atomic
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
### Package selection
tasksel tasksel/first multiselect ubuntu-desktop
ubiquity ubiquity/keep-installed string icedtea6-plugin openoffice.org
# Enable extras.ubuntu.com.
d-i apt-setup/extras boolean true
d-i pkgsel/include/install-recommends boolean true
### Boot loader installation
d-i grub-installer/only_debian boolean true## TO DO: Resolve how to create more file systems
## Need to have OS separated from data
d-i grub-installer/with_other_os boolean true
### Copy and install some extra stuff
### When ubiquity/success_command is invoked /target is mounted
ubiquity ubiquity/success_command string \
in-target apt purge gdm3 ; \
in-target apt update ; \
in-target apt-get -y install net-tools libwebkitgtk-3.0 terminator gdm3 ; \
in-target hostname `echo "ubn"$(lshw | grep -m 1 serial | awk '{print tolower ($2)}')` ; \
hostname > /target/etc/hostname ; \
sed -i "2s/.*/127.0.1.1\t$(cat /target/etc/hostname)/" /target/etc/hosts
ubiquity ubiquity/use_nonfree boolean true
ubiquity ubiquity/reboot boolean true